Skip to content

Instantly share code, notes, and snippets.

@ahamilton55
Created June 24, 2015 22:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ahamilton55/35c5db0f189abcea4b6a to your computer and use it in GitHub Desktop.
Save ahamilton55/35c5db0f189abcea4b6a to your computer and use it in GitHub Desktop.
Templating vars
$ ansible-playbook -i deploy_conf/localhost -vvv -e group=test test.yml
1 plays in test.yml
PLAY: ***************************************************************************
TASK [debug msg={{ my_var }}] ***************************************************
fatal: [localhost]: FAILED! => {"msg": "ERROR! the field 'args' has an invalid value, which appears to include a variable that is undefined. The error was: 'my_var' is undefined", "failed": true}
NO MORE HOSTS LEFT **************************************************************
PLAY RECAP **********************************************************************
localhost : ok=0 changed=0 unreachable=0 failed=1
---
my_var: "Testing 123"
---
- hosts: localhost
connection: local
gather_facts: false
vars_files:
- group_vars/{{ group }}
tasks:
- debug: msg="{{ my_var }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment