Skip to content

Instantly share code, notes, and snippets.

@srgvg
Created August 14, 2014 15:24
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 srgvg/f29f9ec5d1ab37d89f27 to your computer and use it in GitHub Desktop.
Save srgvg/f29f9ec5d1ab37d89f27 to your computer and use it in GitHub Desktop.
Example playbook for ansible issue #8617
- hosts: localhost
gather_facts: false
vars:
myvar: test
tasks:
- debug: msg={{myvar}}
---
- include: logging.yml
$ ansible-playbook logging.yml
PLAY [localhost] **************************************************************
TASK: [debug msg=test] ********************************************************
ok: [localhost] => {
"msg": "test"
}
PLAY RECAP ********************************************************************
localhost : ok=1 changed=0 unreachable=0 failed=0
$ ansible-playbook main.yml
PLAY [localhost] **************************************************************
TASK: [debug msg={{myvar}}] ***************************************************
fatal: [localhost] => One or more undefined variables: 'myvar' is undefined
FATAL: all hosts have already failed -- aborting
PLAY RECAP ********************************************************************
to retry, use: --limit @/home/serge/main.retry
localhost : ok=0 changed=0 unreachable=1 failed=0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment