Created
November 4, 2022 11:22
-
-
Save krdlab/5268a36508c6ebab9c59bae36eaf82ff to your computer and use it in GitHub Desktop.
Ansible の when で not と default の組み合わせ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- hosts: localhost | |
connection: local | |
gather_facts: no | |
vars: | |
enabled: yes | |
tasks: | |
- debug: | |
msg: enabled! | |
when: | |
- "{{ enabled | default(false) }}" | |
- debug: | |
msg: not enabled! | |
when: | |
- "{{ not(enabled | default(false)) }}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment