linux_wiki:ansible

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
linux_wiki:ansible [2018/07/21 00:23]
billdozor [Repo Controlled]
linux_wiki:ansible [2018/07/21 00:34]
billdozor [Playbook/Role Creation]
Line 237: Line 237:
 \\ \\
 **Playbooks map ansible groups to roles** **Playbooks map ansible groups to roles**
-  * Example playbook<code bash># File: webservers_nginx.yml+  * Example playbook<code yaml># File: webservers_nginx.yml
 # Description: Nginx Webservers # Description: Nginx Webservers
 # Last Updated: 2018-04-08 # Last Updated: 2018-04-08
Line 261: Line 261:
  
 If you do need to gather facts, consider gathering a subset of facts instead of everything in order to keep the fact collection fast. If you do need to gather facts, consider gathering a subset of facts instead of everything in order to keep the fact collection fast.
-  * Example: Collect only the ansible_distribution facts<code bash># Gather host facts for this playbook+  * Example: Collect only the ansible_distribution facts<code yaml># Gather host facts for this playbook
   gather_facts: yes   gather_facts: yes
   # Gather only ansible_distribution info (OS attributes)   # Gather only ansible_distribution info (OS attributes)
Line 341: Line 341:
     - Navigate to the playbooks directory<code bash>cd ${HOME}/repos/ansible/playbooks/</code>     - Navigate to the playbooks directory<code bash>cd ${HOME}/repos/ansible/playbooks/</code>
     - Copy your playbook template to a new playbook yaml file.<code bash>cp TEMPLATE_PLAYBOOK.yml my_new_playbook.yml</code>     - Copy your playbook template to a new playbook yaml file.<code bash>cp TEMPLATE_PLAYBOOK.yml my_new_playbook.yml</code>
-      - Playbook Template<code bash TEMPLATE_PLAYBOOK.yml># File: TEMPLATE_PLAYBOOK.yml+      - Playbook Template<code yaml TEMPLATE_PLAYBOOK.yml># File: TEMPLATE_PLAYBOOK.yml
 # Description: PLAYBOOK DESCRIPTION HERE # Description: PLAYBOOK DESCRIPTION HERE
 # Last Updated: 2018-03-15 # Last Updated: 2018-03-15
Line 358: Line 358:
   gather_facts: no   gather_facts: no
 </code> </code>
-    - Edit the new playbook<code bash>vim ansible/playbooks/my_new_playbook.yml+    - Edit the new playbook (vim ansible/playbooks/my_new_playbook.yml)<code yaml>
 - hosts: my_ansible_group - hosts: my_ansible_group
   roles:   roles:
  • linux_wiki/ansible.txt
  • Last modified: 2019/05/25 23:50
  • (external edit)