2024-09-24 10:20:42 +00:00
|
|
|
# Verdnatura Ansible playbooks
|
|
|
|
|
|
|
|
Collection of Ansible playbooks used in the Verdnatura server farm.
|
|
|
|
|
|
|
|
## Install Ansible
|
|
|
|
|
|
|
|
Instal Ansible on Debian.
|
|
|
|
```
|
|
|
|
apt install ansible
|
|
|
|
```
|
|
|
|
|
|
|
|
## Run playbook
|
|
|
|
|
|
|
|
Before merging changes into protected branches, playbooks should be tested
|
|
|
|
locally to ensure they work properly.
|
|
|
|
|
2024-09-24 11:10:26 +00:00
|
|
|
Launch playbook on the fly on a host not declared in the inventory.
|
2024-09-24 10:20:42 +00:00
|
|
|
```
|
|
|
|
ansible-playbook playbooks/test.yml -u root -i <ip_or_hostname>,
|
|
|
|
```
|
|
|
|
|
|
|
|
*Note the comma at the end of the hostname or IP.*
|
|
|
|
|
2024-09-24 10:28:52 +00:00
|
|
|
## Common playbooks
|
2024-09-24 10:20:42 +00:00
|
|
|
|
|
|
|
* **facts.yml**: Collect and display facts from a host.
|
|
|
|
* **ping.yml**: Checking that a host is alive and reachable by Ansible.
|
|
|
|
* **test.yml**: Test an specific role. Don't forget to undo changes before pushing!
|
|
|
|
* **debian.yml**: Setup base Debian server
|
|
|
|
|
|
|
|
## Documentation
|
|
|
|
|
|
|
|
* https://docs.ansible.com/ansible/latest/reference_appendices/config.html
|
|
|
|
* https://docs.ansible.com/ansible/latest/collections/ansible/builtin/gather_facts_module.html
|
|
|
|
* https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_vars_facts.html
|