Skip to content

Instantly share code, notes, and snippets.

@dgibbs64
Created March 25, 2022 11:37
Show Gist options
  • Save dgibbs64/c649f9090a1141e884e0632a4a7c7d5c to your computer and use it in GitHub Desktop.
Save dgibbs64/c649f9090a1141e884e0632a4a7c7d5c to your computer and use it in GitHub Desktop.
Ansible Simple Conditional Demo
- 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