Skip to content

Commit

Permalink
Moved when condition after task name for block example
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/
  • Loading branch information
dancorrigan1 authored Oct 2, 2024
1 parent bf81c10 commit 1437739
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 1437739

Please sign in to comment.