Show more whitespace throughout playbook examples to encourage better standards in first playbooks folks write.

This commit is contained in:
Michael DeHaan
2014-02-28 14:18:44 -05:00
parent 4b281ca5c7
commit a6b4b9a751
8 changed files with 53 additions and 6 deletions
+11 -2
View File
@@ -136,6 +136,7 @@ Filters Often Used With Conditionals
The following tasks are illustrative of how filters can be used with conditionals::
tasks:
- shell: /usr/bin/foo
register: result
ignore_errors: True
@@ -691,13 +692,16 @@ the main playbook.
You can do this by using an external variables file, or files, just like this::
---
- hosts: all
remote_user: root
vars:
favcolor: blue
vars_files:
- /vars/external_vars.yml
tasks:
- name: this is just a placeholder
command: /bin/echo foo
@@ -731,8 +735,10 @@ This is useful, for, among other things, setting the hosts group or the user for
Example::
---
- remote_user: '{{ user }}'
hosts: '{{ hosts }}'
- hosts: '{{ hosts }}'
remote_user: '{{ user }}'
tasks:
- ...
@@ -765,12 +771,15 @@ As an example, the name of the Apache package may be different between CentOS an
but it is easily handled with a minimum of syntax in an Ansible Playbook::
---
- hosts: all
remote_user: root
vars_files:
- "vars/common.yml"
- [ "vars/{{ ansible_os_family }}.yml", "vars/os_defaults.yml" ]
tasks:
- name: make sure apache is running
service: name={{ apache }} state=running