Open main menu

Changes

no edit summary
==Playbooks==
Ansible "[http://docs.ansible.com/playbooks.html Playbooks]" use an easy and descriptive language based on YAML.
 
==Roles==
[https://www.redhat.com/sysadmin/developing-ansible-role 8 steps to developing an Ansible role] (aka when a playbook becomes a re-usable role)
==Targets==
#<code>yamllint</code>
#<code>ansible-playbook --syntax-check</code>
#<code>ansible-lint</code> https://ansible.readthedocs.io/projects/lint/ TLDR; you might want to setup a venv and then pip3 install ansible-lint
#molecule test (integration)
#<code>ansible-playbook --check</code> (against prod)
Another aspect of scope is <tt>includes</tt> vs. <tt>imports</tt> and loosely speaking, control structures like <tt>loop</tt> and the deprecated <tt>with_items</tt>
* https://stackoverflow.com/questions/68863854/iterate-list-within-role-task-provide-each-element-as-vars-to-include-tasks
* https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_reuse.html#comparing-includes-and-imports-dynamic-and-static-re-use
*https://stackoverflow.com/questions/68863854/iterate-list-within-role-task-provide-each-element-as-vars-to-include-tasks*https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_reuse.html#comparing-includes-and-imports-dynamic-and-static-re-use == Ansible with VSCode ==
https://marketplace.visualstudio.com/items?itemName=redhat.ansible
*https://docs.ansible.com/ansible/playbooks_conditionals.html#sts=The When Statement%C2%B6
 
==Controlling Whitespace in Jinja2 Templates==
See [[Controlling whitespace in Jinja2 templates]]
==Ansible References==
*http://jpmens.net/2012/06/06/configuration-management-with-ansible/
*[http://jinja.pocoo.org/docs/dev/ Jinja] - the template engine for Ansible
*[https://cheat.readthedocs.io/en/latest/ansible/index.html Dan's Cheat Sheets]
*== To Do == # Follow and learn from Jeff Geerling's Drupal site https://github.com/geerlingguy/jeffgeerling-com because his techniques embody best practices for PHP, Drupal, Docker, Ansible, etc. In episode 12 of Ansible 101 - Real-world Ansible Playbooks [https://cheatwww.readthedocsyoutube.iocom/enlive/latest_QZr4xKhir4?si=LOyBibByqdmLb7M6&t=1107 here] he discusses his Drupal playbook and the 'deploy' tag. But sadly the playbooks are private (Midwestern Mac infrastructure), so you'll have to read the screen to emulate it exactly. The closest I found was https://github.com/geerlingguy/ansible-awx-varnish-php-app/indexblob/master/main.html Danyml# Add info (separate page) about the Ansible clone of the Ruby deployment system 'Capistrano' called 'Anistrano's Cheat Sheets]## https://www.oliverdavies.uk/talks/deploying-php-ansible-ansistrano## https://github.com/ansistrano/deploy
{{References}}