{"id":15984787,"url":"https://github.com/phra/complex-ansible-example","last_synced_at":"2025-06-30T00:06:27.263Z","repository":{"id":148083633,"uuid":"126854715","full_name":"phra/complex-ansible-example","owner":"phra","description":"Example of a complex Ansible deploy","archived":false,"fork":false,"pushed_at":"2018-06-20T09:27:42.000Z","size":174,"stargazers_count":8,"open_issues_count":0,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-01T02:04:51.917Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phra.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-26T16:05:15.000Z","updated_at":"2024-11-06T22:08:01.000Z","dependencies_parsed_at":"2023-05-19T03:00:15.005Z","dependency_job_id":null,"html_url":"https://github.com/phra/complex-ansible-example","commit_stats":{"total_commits":33,"total_committers":1,"mean_commits":33.0,"dds":0.0,"last_synced_commit":"ceea7e9b83a92db2ab43b917c173feb88545f83d"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/phra/complex-ansible-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phra%2Fcomplex-ansible-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phra%2Fcomplex-ansible-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phra%2Fcomplex-ansible-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phra%2Fcomplex-ansible-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phra","download_url":"https://codeload.github.com/phra/complex-ansible-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phra%2Fcomplex-ansible-example/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259914866,"owners_count":22931323,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-08T02:10:31.969Z","updated_at":"2025-06-15T03:02:08.129Z","avatar_url":"https://github.com/phra.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"LAMP Stack + HAProxy: Example Playbooks\n-----------------------------------------------------------------------------\n\n- Requires Ansible 1.2\n- Expects CentOS/RHEL 6 hosts\n\nThis example is an extension of the simple LAMP deployment. Here we'll install\nand configure a web server with an HAProxy load balancer in front, and deploy\nan application to the web servers. This set of playbooks also have the\ncapability to dynamically add and remove web server nodes from the deployment.\nIt also includes examples to do a rolling update of a stack without affecting\nthe service.\n\nYou can also optionally configure a Nagios monitoring node.\n\n### Initial Site Setup\n\nFirst we configure the entire stack by listing our hosts in the 'hosts'\ninventory file, grouped by their purpose:\n\n\t\t[webservers]\n\t\twebserver1\n\t\twebserver2\n\t\t\n\t\t[dbservers]\n\t\tdbserver\n\t\t\n\t\t[lbservers]\n\t\tlbserver\n\t\t\n\t\t[monitoring]\n\t\tnagios\n\nAfter which we execute the following command to deploy the site:\n\n\t\tansible-playbook -i hosts site.yml\n\nThe deployment can be verified by accessing the IP address of your load\nbalancer host in a web browser: http://\u003cip-of-lb\u003e:8888. Reloading the page\nshould have you hit different webservers.\n\nThe Nagios web interface can be reached at http://\u003cip-of-nagios\u003e/nagios/\n\nThe default username and password are \"nagiosadmin\" / \"nagiosadmin\".\n\n### Removing and Adding a Node\n\nRemoval and addition of nodes to the cluster is as simple as editing the\nhosts inventory and re-running:\n\n        ansible-playbook -i hosts site.yml\n\n### Rolling Update\n\nRolling updates are the preferred way to update the web server software or\ndeployed application, since the load balancer can be dynamically configured\nto take the hosts to be updated out of the pool. This will keep the service\nrunning on other servers so that the users are not interrupted.\n\nIn this example the hosts are updated in serial fashion, which means that\nonly one server will be updated at one time. If you have a lot of web server\nhosts, this behaviour can be changed by setting the 'serial' keyword in\nwebservers.yml file.\n\nOnce the code has been updated in the source repository for your application\nwhich can be defined in the group_vars/all file, execute the following\ncommand:\n\n\t ansible-playbook -i hosts rolling_update.yml\n\nYou can optionally pass: -e webapp_version=xxx to the rolling_update\nplaybook to specify a specific version of the example webapp to deploy.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphra%2Fcomplex-ansible-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphra%2Fcomplex-ansible-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphra%2Fcomplex-ansible-example/lists"}