Skip to content

Test exercise for DevOps position @ Boozt: Ansible, Bash, Vagrant, HAProxy, NGINX, Apache httpd, PHP-FPM, PHP, CentOS 8, GitHub Workflow CI, Markdown

License

Notifications You must be signed in to change notification settings

gorshunovr/boozt-lab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Boozt lab

CI-linting

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
.
|-- 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:

cd /vagrant/ansible/ && ansible-playbook -i inventory.txt deploy-app.yml

The deploy-app.yml Ansible playbook deploys the following 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.

  2. Source code of the application app is in app/ subdirectory, and is being synced by Ansible to /var/www/html/ on the n0 VM. Application simply prints phpinfo().

  3. HAProxy load balancer listens on *:80 and passes traffic to two backends: 127.0.0.1:81 and 127.0.0.1:82.

  4. Nginx listens on 127.0.0.1:81 and serves /var/www/html/index.php PHP application.

  5. Apache httpd listens on 127.0.0.1:82 and serves same /var/www/html/index.php PHP application.

  6. The URL http://192.168.100.101 being opened from the host machine would show balanced PHP application.

  7. Operating system on the VM is CentOS 8.

  8. 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.

  9. 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

About

Test exercise for DevOps position @ Boozt: Ansible, Bash, Vagrant, HAProxy, NGINX, Apache httpd, PHP-FPM, PHP, CentOS 8, GitHub Workflow CI, Markdown

Topics

Resources

License

Stars

Watchers

Forks