summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlias Trichopoulos <hlias.nop@gmail.com>2020-02-03 18:30:12 +0100
committerGitHub <noreply@github.com>2020-02-03 12:30:12 -0500
commitd6f2b4e788ed13756ba4e4a05b8b7a879900dbc3 (patch)
tree8d4920728dbf3869d150231fe5ebbbc92287be74
parentea105dcb2fa3dcb150c23f08fc33791600c2c715 (diff)
downloadansible-d6f2b4e788ed13756ba4e4a05b8b7a879900dbc3.tar.gz
Fix indentation (#66991)
-rw-r--r--docs/docsite/rst/user_guide/playbooks_intro.rst44
1 files changed, 22 insertions, 22 deletions
diff --git a/docs/docsite/rst/user_guide/playbooks_intro.rst b/docs/docsite/rst/user_guide/playbooks_intro.rst
index 8b75efd7de..3591b1de2b 100644
--- a/docs/docsite/rst/user_guide/playbooks_intro.rst
+++ b/docs/docsite/rst/user_guide/playbooks_intro.rst
@@ -132,14 +132,14 @@ This playbook, ``verify-apache.yml``, contains a single play with variables, the
In the example above, the second task notifies the handler. A single task can notify more than one handler::
- - name: template configuration file
- template:
- src: template.j2
- dest: /etc/foo.conf
- notify:
+ - name: template configuration file
+ template:
+ src: template.j2
+ dest: /etc/foo.conf
+ notify:
- restart memcached
- restart apache
- handlers:
+ handlers:
- name: restart memcached
service:
name: memcached
@@ -157,9 +157,9 @@ By default, handlers run after all the tasks in a particular play have been comp
If you need handlers to run before the end of the play, add a task to flush them using the :ref:`meta module <meta_module>`, which executes Ansible actions::
tasks:
- - shell: some tasks go here
- - meta: flush_handlers
- - shell: some other tasks
+ - shell: some tasks go here
+ - meta: flush_handlers
+ - shell: some other tasks
The ``meta: flush_handlers`` task triggers any handlers that have been notified at that point in the play.
@@ -191,21 +191,21 @@ Instead, place variables in the task parameters of your handler. You can load th
Handlers can also "listen" to generic topics, and tasks can notify those topics as follows::
handlers:
- - name: restart memcached
- service:
- name: memcached
- state: restarted
- listen: "restart web services"
- - name: restart apache
- service:
- name: apache
- state: restarted
- listen: "restart web services"
+ - name: restart memcached
+ service:
+ name: memcached
+ state: restarted
+ listen: "restart web services"
+ - name: restart apache
+ service:
+ name: apache
+ state: restarted
+ listen: "restart web services"
tasks:
- - name: restart everything
- command: echo "this task will restart the web services"
- notify: "restart web services"
+ - name: restart everything
+ command: echo "this task will restart the web services"
+ notify: "restart web services"
This use makes it much easier to trigger multiple handlers. It also decouples handlers from their names,
making it easier to share handlers among playbooks and roles (especially when using 3rd party roles from