summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorPreston Carman <prestonc@apache.org>2022-02-14 12:08:52 -0800
committerGitHub <noreply@github.com>2022-02-14 15:08:52 -0500
commitf82b1ba67c5b65ee755d641e7a493ae508c22bb7 (patch)
tree9b516f07390bebdb23de2aeb5bafdcd39e6e2102 /docs
parent3779c1f278685c5a8d7f78942ce649f6805a5775 (diff)
downloadansible-f82b1ba67c5b65ee755d641e7a493ae508c22bb7.tar.gz
Update indentation for example in playbooks_handlers.rst (#75348)
Diffstat (limited to 'docs')
-rw-r--r--docs/docsite/rst/user_guide/playbooks_handlers.rst51
1 files changed, 26 insertions, 25 deletions
diff --git a/docs/docsite/rst/user_guide/playbooks_handlers.rst b/docs/docsite/rst/user_guide/playbooks_handlers.rst
index dfbb5e4a4f..082c8dd07a 100644
--- a/docs/docsite/rst/user_guide/playbooks_handlers.rst
+++ b/docs/docsite/rst/user_guide/playbooks_handlers.rst
@@ -23,22 +23,22 @@ This playbook, ``verify-apache.yml``, contains a single play with a handler.
max_clients: 200
remote_user: root
tasks:
- - name: Ensure apache is at the latest version
- ansible.builtin.yum:
- name: httpd
- state: latest
-
- - name: Write the apache config file
- ansible.builtin.template:
- src: /srv/httpd.j2
- dest: /etc/httpd.conf
- notify:
- - Restart apache
+ - name: Ensure apache is at the latest version
+ ansible.builtin.yum:
+ name: httpd
+ state: latest
- - name: Ensure apache is running
- ansible.builtin.service:
- name: httpd
- state: started
+ - name: Write the apache config file
+ ansible.builtin.template:
+ src: /srv/httpd.j2
+ dest: /etc/httpd.conf
+ notify:
+ - Restart apache
+
+ - name: Ensure apache is running
+ ansible.builtin.service:
+ name: httpd
+ state: started
handlers:
- name: Restart apache
@@ -46,7 +46,7 @@ This playbook, ``verify-apache.yml``, contains a single play with a handler.
name: httpd
state: restarted
-In this example playbook, the second task notifies the handler. A single task can notify more than one handler.
+In this example playbook, the second task notifies the handler. A single task can notify more than one handler:
.. code-block:: yaml
@@ -59,16 +59,16 @@ In this example playbook, the second task notifies the handler. A single task ca
- Restart memcached
- Restart apache
- handlers:
- - name: Restart memcached
- ansible.builtin.service:
- name: memcached
- state: restarted
+ handlers:
+ - name: Restart memcached
+ ansible.builtin.service:
+ name: memcached
+ state: restarted
- - name: Restart apache
- ansible.builtin.service:
- name: apache
- state: restarted
+ - name: Restart apache
+ ansible.builtin.service:
+ name: apache
+ state: restarted
Controlling when handlers run
-----------------------------
@@ -120,6 +120,7 @@ Handlers can also "listen" to generic topics, and tasks can notify those topics
.. code-block:: yaml
+
handlers:
- name: Restart memcached
ansible.builtin.service: