Changes

Jump to navigation Jump to search
75 bytes added ,  12:13, 14 September 2016
more organization
== Example Commands ==
# <code>ansible -m setup wiki.example.com</code> will show you all the ansible 'facts' about that host.
# <code>ansible -m setup wiki.example.com</code> will show you all the ansible 'facts' (aka [[ansible_variables]]) about that host.
# <code>ansible all -m setup -a "filter=ansible_distribution*"</code> use a filter action to see specific variables
#<code>ansible -m debug -a "var=hostvars['wiki.example.com']" localhost</code> gives you the '[[ansible hostvars]]'
# <code>ansible-playbook play1.yml play2.yml</code> Run multiple playbooks
 
== Variables ==
; You have 3 plays in one playbook. Will play 3 be able to reference facts registered in play 1?:
: facts, yes, play vars, no
: vars associated to the host, persist, vars defined in the play, do not, set_facts, registered vars and gathered facts associate to the host so those do persist for the run
 
== Playbooks ==
Ansible "[http://docs.ansible.com/playbooks.html Playbooks]" use an easy and descriptive language based on YAML.
== Ansible Docs ==
Some of the docs pages I've visited
 
* https://docs.ansible.com/ansible/playbooks_intro.html
* https://docs.ansible.com/ansible/intro_inventory.html
* http://docs.ansible.com/playbooks_best_practices.html
* http://docs.ansible.com/playbooks_loops.html
* https://docs.ansible.com/ansible/playbooks_conditionals.html
* https://docs.ansible.com/ansible/playbooks_startnstep.html
* https://docs.ansible.com/ansible/playbooks_roles.html#task-include-files-and-encouraging-reuse
* http://jpmens.net/2012/06/06/configuration-management-with-ansible/
* [http://jinja.pocoo.org/docs/dev/ Jinja] - the template engine for Ansible
 
 
== Examples ==
<source lang="bash">
# use the setup module to view defined variables; add filter action to see specific variables
ansible all -m setup -a "filter=ansible_distribution*"
 
# Run multiple playbooks
ansible-playbook play1.yml play2.yml
</source>
 
* [https://docs.ansible.com/ansible/playbooks_conditionals.html Conditionals]
 
 
== Variables ==
; You have 3 plays in one playbook. Will play 3 be able to reference facts registered in play 1?:
: facts, yes, play vars, no
: vars associated to the host, persist, vars defined in the play, do not, set_facts, registered vars and gathered facts associate to the host so those do persist for the run
 
[[Category:Configuration Management]]
[[Category:DevOps]]
4,558

edits

Navigation menu