/sample-playbook-for-ci-testing

A sample playbook for testing in CI

Primary LanguagePython

Building a simple LAMP stack and deploying Application using Ansible Playbooks.

CircleCI TravisCI AppVeyor Azure Pipelines shippable

These playbooks require Ansible 1.2.

These playbooks are meant to be a reference and starter's guide to building Ansible Playbooks. These playbooks were tested on CentOS 6.x so we recommend that you use CentOS or RHEL to test these modules.

You can test this playbook on your local machine installing Docker and Pipenv, python package and virtualenv manager.

Once done, you just run the following commands:

$ git clone https://github.com/toVersus/sample-playbook-for-ci-testing.git
$ cd ./sample-playbook-for-ci-testing
$ pipenv sync
$ pipenv run test

demo

This LAMP stack can be on a single node or multiple nodes. The inventory file 'hosts' defines the nodes in which the stacks should be configured.

[webservers]
localhost

[dbservers]
bensible

Here the webserver would be configured on the local host and the dbserver on a server called "bensible". The stack can be deployed using the following command:

$ ansible-playbook -i hosts site.yml

Once done, you can check the results by browsing to http://localhost/index.php. You should see a simple test page and a list of databases retrieved from the database server.