Skip to content

Instantly share code, notes, and snippets.

@tgerla
Created July 9, 2014 00:13
Show Gist options
  • Save tgerla/beca6b8fd491c1758d77 to your computer and use it in GitHub Desktop.
Save tgerla/beca6b8fd491c1758d77 to your computer and use it in GitHub Desktop.
---
- hosts: all
connection: local
vars:
role: foo
descriptions:
foo: "this is the description for foo"
bar: "this is the description for bar"
tasks:
- debug: var=role
- debug: msg="{{ descriptions[role] }}"
PLAY [all] ********************************************************************
GATHERING FACTS ***************************************************************
ok: [localhost]
TASK: [debug var=role] ********************************************************
ok: [localhost] => {
"role": "foo"
}
TASK: [debug msg="this is the description for foo"] ***************************
ok: [localhost] => {
"msg": "this is the description for foo"
}
PLAY RECAP ********************************************************************
localhost : ok=3 changed=0 unreachable=0 failed=0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment