Skip to content

Latest commit

 

History

History
70 lines (45 loc) · 3.9 KB

README.md

File metadata and controls

70 lines (45 loc) · 3.9 KB

Introduction

Repository Introduction

Welcome to our GitHub repository where you'll find Ansible scripts written to facilitate the development of web applications by mirroring a typical production environment. This approach might address common challenges where hardware or time constraints make it difficult to set up a test or acceptance environment that accurately reflects various production settings.

Purpose of This Repository

This repository hosts Ansible scripts that allow you to deploy a complex web application environment either locally on your development machine, on-premises hardware, or in a cloud setup. By leveraging these scripts, developers may accelerate the setup process and ensure consistency across different environments, from development to production.

Environment Roles Defined

The provided Ansible scripts are prepared to configure the following roles essential for a full-featured web application infrastructure:

  • Web Server: Hosts the web application interface.
  • Cache: Improves response time and reduces load on the database by storing recently accessed data.
  • Database: Manages data storage and retrieval.
  • Identity Server: Handles authentication and authorization services.
  • REST API endpoints: Facilitates communication between the client apps and server.
  • Load Balancer: Distributes incoming network traffic across multiple servers.
  • Certificate Authority: Issues SSL/TLS certificates for secured communications.
  • HTTPS offloading: Relieves backend application servers of the processing load associated with encrypting and decrypting public HTTPS traffic.
  • Prometheus monitoring: Collects and stores metrics as time-series data.
  • Grafana dashboards: Provides visualization of the metrics collected by Prometheus.

Setup Instructions

Prerequisites

Before running the Ansible playbooks, ensure that you have the following:

  • Ansible installed on your local machine or a control node.
  • Sufficient privileges to manage the systems designated in your inventory.
  • Machines (VMs, containers, or bare metal) defined in your hosts file and accessible over your network.

Running the Playbooks

To deploy the roles listed above, follow these steps:

  1. Navigate to your local clone of this repository: Open a terminal and ensure you are in the repository directory.

  2. Setup your inventory: Ensure that your hosts file in the ./playbooks directory is updated to reflect the infrastructure where you want to deploy the roles.

  3. Configure role variables Default variables are provided for all roles in role_folder/defaults/vars.yml and initialized by reading environment variables. Example environment variables are available.

  4. Execute the Ansible Playbook: Run the following command to start the deployment process. This command will prompt you for your sudo password due to the -K flag and provide detailed output with the -vvv verbosity level.

    ansible-playbook site.yml -K -i hosts -vvv

Expected Outcome

After executing the playbook, all specified roles should be successfully configured and running across your specified machines. You can verify the status of each role through the corresponding management interfaces or by checking the services directly on each machine.

Troubleshooting

If you encounter any issues during the setup, consider the following troubleshooting steps:

  • Verify network connectivity between your control node and the target machines.
  • Check the permissions and authentication details for the accounts used.
  • Review the verbose output provided by the Ansible execution for errors or warnings.

Contributing

We welcome contributions to improve the scripts or documentation. Please feel free to fork the repository, make your changes, and submit a pull request.