Ansible is an IT automation tool. It can configure systems, deploy software, and orchestrate more advanced IT tasks such as continuous deployments or zero downtime rolling updates.
→ docs.ansible.com
Two types of Ansible git repositories:
Components
Static inventories
Ansible component repositories can be used from another repository as Ansible collections (preferred) or git submodules.
Public collections: galaxy.ansible.com
Private collections: any artifact repository manager such as Artifactory
1 repository for all roles
1 repository for all the roles of the same perimeter
1 repository for 1 role
├─ playbooks ├─ plugins └─ roles .ansible-lint .editorconfig .galaxy.yml LICENCE README.md
└─ roles └─ <myrolename> ├─ handlers │ └─ main.yml └─ tasks ├─ main.yml └─ <mysubtask>.yml
Commit on main only
Create a feature branch and submit a Pull|Merge Request
Create my branch and commit on it only
CI badge must be present at the top of the README.md file
README.md
CI must run on every commit of main branch
CI must run on every commit of a Pull|Merge Request
CI must block the completion of a Pull|Merge Request if there is an error
ansible-lint MUST be ran in the CI pipeline
ansible-lint
# installs ansible-lint pip install "ansible-lint[yamllint]" # validates the source code ansible-lint
Inventories can be:
Dynamic (preferred)
Static
yaani can be used to merge multiple sources
You can go back to the presentation home page