Skip to content

Check variables used in 'When' clause is not changed in the tasks in a block #140

Open
@Tomorrow9

Description

@Tomorrow9

Take a look at the playbooks to avoid below situation.

- set_fact:
      test: true
- block:
      - debug: var=test
      - set_fact:
            test: false
      - debug: var=test
   when: test
- debug:
       msg: "The above second debug will not run."
   when: not test

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions