Skip to content

Commit

Permalink
Moved when condition after task name for block example (#1961)
Browse files Browse the repository at this point in the history
when condition should come after name in blocks
See: https://ansible.readthedocs.io/projects/lint/rules/key-order/

(cherry picked from commit e6f2cc9)
  • Loading branch information
dancorrigan1 authored and patchback[bot] committed Oct 2, 2024
1 parent 9410b44 commit 83d5cae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/docsite/rst/playbook_guide/playbooks_blocks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down

0 comments on commit 83d5cae

Please sign in to comment.