From 5cec0e2ebf20aea7745a3e221a2613f35c6dce94 Mon Sep 17 00:00:00 2001 From: dancorrigan1 Date: Wed, 2 Oct 2024 12:26:38 -0500 Subject: [PATCH] Moved when condition after task name for block example (#1961) when condition should come after name in blocks See: https://ansible.readthedocs.io/projects/lint/rules/key-order/ (cherry picked from commit e6f2cc9ffc318c8dee2368e573114a8b90a585f8) --- docs/docsite/rst/playbook_guide/playbooks_blocks.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docsite/rst/playbook_guide/playbooks_blocks.rst b/docs/docsite/rst/playbook_guide/playbooks_blocks.rst index c521ff7e3b..523928bc5b 100644 --- a/docs/docsite/rst/playbook_guide/playbooks_blocks.rst +++ b/docs/docsite/rst/playbook_guide/playbooks_blocks.rst @@ -20,6 +20,7 @@ All tasks in a block inherit directives applied at the block level. Most of what tasks: - name: Install, configure, and start Apache + when: ansible_facts['distribution'] == 'CentOS' block: - name: Install httpd and memcached ansible.builtin.yum: @@ -38,7 +39,6 @@ All tasks in a block inherit directives applied at the block level. Most of what name: bar state: started enabled: True - when: ansible_facts['distribution'] == 'CentOS' become: true become_user: root ignore_errors: true