Created
March 25, 2022 11:37
-
-
Save dgibbs64/c649f9090a1141e884e0632a4a7c7d5c to your computer and use it in GitHub Desktop.
Ansible Simple Conditional Demo
This file contains 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
- name: Conditional test | |
hosts: localhost | |
connection: local | |
gather_facts: no | |
vars: | |
variable: true | |
tasks: | |
- name: true test | |
debug: | |
msg: "variable is true" | |
when: variable | |
- name: false test | |
debug: | |
msg: "variable is false" | |
when: not variable |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment