Skip to content

Commit 5a7f3da

Browse files
Moved when condition after task name for block example (#1961) (#1968)
when condition should come after name in blocks See: https://ansible.readthedocs.io/projects/lint/rules/key-order/ (cherry picked from commit e6f2cc9) Co-authored-by: dancorrigan1 <[email protected]>
1 parent 8ca3ec0 commit 5a7f3da

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/docsite/rst/playbook_guide/playbooks_blocks.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ All tasks in a block inherit directives applied at the block level. Most of what
2020
2121
tasks:
2222
- name: Install, configure, and start Apache
23+
when: ansible_facts['distribution'] == 'CentOS'
2324
block:
2425
- name: Install httpd and memcached
2526
ansible.builtin.yum:
@@ -38,7 +39,6 @@ All tasks in a block inherit directives applied at the block level. Most of what
3839
name: bar
3940
state: started
4041
enabled: True
41-
when: ansible_facts['distribution'] == 'CentOS'
4242
become: true
4343
become_user: root
4444
ignore_errors: true

0 commit comments

Comments
 (0)