Table of Contents |
---|
Overview
We have two categories of Ansible playbooks; installations and tasks. Installation playbooks follow a hierarchy to install and configure VMs in the correct order where tasks are used for one-off or repeating jobs that we need to run, e.g. adding SSH access for a developer or running database backups.
Installation
Ansible is a Python so the easiest way to install it is using Pip;
...
- Check out $TIS-DEVOPS
- Create a new directory under ansible/roles/docker-compose/stackstemplates/:stack_name, these files are treated like Jinja2 templates so variables can be used throughout.
Add a docker-compose.yml in that new directory. If your application needs environment variables then use an environment section, i.e.
Code Block environment: DATABASE_HOST: "{{ database['host'] }}"
Create new playbook under ansible/ directory that matches your service name
- Add the hosts to the Ansible inventory file for platforms you are targeting.
Commit and push your changes to Github.
- Create a deploy job in Jenkins by copying the 'revalidation-dev-deploy' job and changing the export STACK=revalidation to match your stack name.
...