https://github.com/gorshunovr/boozt-lab
Test exercise for DevOps position @ Boozt: Ansible, Bash, Vagrant, HAProxy, NGINX, Apache httpd, PHP-FPM, PHP, CentOS 8, GitHub Workflow CI, Markdown
https://github.com/gorshunovr/boozt-lab
ansible apache-httpd balancer haproxy httpd nginx php-fpm php-fpm7 vagrant virtualization
Last synced: 2 months ago
JSON representation
Test exercise for DevOps position @ Boozt: Ansible, Bash, Vagrant, HAProxy, NGINX, Apache httpd, PHP-FPM, PHP, CentOS 8, GitHub Workflow CI, Markdown
- Host: GitHub
- URL: https://github.com/gorshunovr/boozt-lab
- Owner: gorshunovr
- License: apache-2.0
- Created: 2020-06-17T18:01:52.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-06-20T12:45:06.000Z (almost 5 years ago)
- Last Synced: 2025-03-18T07:52:17.183Z (3 months ago)
- Topics: ansible, apache-httpd, balancer, haproxy, httpd, nginx, php-fpm, php-fpm7, vagrant, virtualization
- Language: Shell
- Homepage:
- Size: 20.5 KB
- Stars: 0
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Boozt lab

## Environment
Environment is expected to be launched via `vagrant up` command. Vagrant would
bring up one CentOS 8 virtual machine:* *n0* - this is the main VM:
* Ansible (VM manages itself trough Ansible)
* HAProxy load balancer
* PHP-FPM PHP backend (for both Nginx and Apache httpd)
* NGINX web server
* Apache httpd web server
* App – simple PHP app, prints phpinfo()
* VM has an additional private network interface with static IP address
192.168.100.101```code
.
|-- ansible/
|-- app/
|-- bootstrap.sh*
|-- LICENSE
|-- README.md
`-- Vagrantfile
```## Exercise
Ansible is installed on *n0* virtual machine via `bootstrap.sh` shell script,
which is called by Vagrant during provisioning process. After Ansible is
installed, Vagrant runs Ansible playbook `deploy-app.yml` automatically:```bash
cd /vagrant/ansible/ && ansible-playbook -i inventory.txt deploy-app.yml
```The [deploy-app.yml](ansible/deploy-app.yml) Ansible playbook deploys the
following [roles](ansible/roles/) onto a VM:* HAProxy load balancer
* PHP-FPM PHP backend (for both Nginx and Apache httpd)
* NGINX web server
* Apache httpd web server
* App – simple PHP app, prints phpinfo()1. Installable souce code in this repository allows to bootstrap environment by
running simple `vagrant up` command.1. Source code of the application `app` is in [app/](app/) subdirectory, and is
being synced by Ansible to `/var/www/html/` on the `n0` VM. Application simply
prints phpinfo().1. HAProxy load balancer listens on `*:80` and passes traffic to two backends:
`127.0.0.1:81` and `127.0.0.1:82`.1. Nginx listens on `127.0.0.1:81` and serves `/var/www/html/index.php` PHP
application.1. Apache httpd listens on `127.0.0.1:82` and serves same
`/var/www/html/index.php` PHP application.1. The URL [http://192.168.100.101](http://192.168.100.101) being opened from the
host machine would show balanced PHP application.1. Operating system on the VM is CentOS 8.
1. Exercise uses Vagrant to bring up whole environment by running `vagrant up`
command.Although VirtualBox has been recommended to be used as a virtualization
software, another virtualization software has been used for tests, and
reasonable efforts have been made to ensure that environment would also work
on VirtualBox.1. SELinux remains enabled.
## Conventions
* Ansible roles and playbooks should be linted by `ansible-lint` and/or
`ansible-review` tools
* Documentation should be in Markdown format and linted by `markdownlint`