Last active
August 29, 2015 14:01
-
-
Save homburg/c790b11354d7eb480a3e to your computer and use it in GitHub Desktop.
Ansible command line booleans
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
--- | |
- hosts: all | |
vars: | |
docker: 0 | |
tasks: | |
- name: ensure bool variables work | |
debug: msg="docker {{ docker }}.." | |
# When: takes a jinja2 expression | |
# 0 evaluates to false | |
# >= 1 evaluates to true | |
# override the default value with | |
# $ ansible-playbook playbook-bool.yml -e docker=1 ... | |
when: docker | |
- name: ensure variables can be negated | |
debug: msg="not docker!" | |
when: not docker | |
- debug: msg="not not docker!" | |
when: not not docker |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment