Skip to content

Instantly share code, notes, and snippets.

@jugglinmike
Last active November 14, 2016 16:15
Show Gist options
  • Save jugglinmike/799276c37dd699218ceb81e967008e42 to your computer and use it in GitHub Desktop.
Save jugglinmike/799276c37dd699218ceb81e967008e42 to your computer and use it in GitHub Desktop.
Ansible: references to `environment` object
---
- debug: var=environment

Question Why is the following a list of dicts, rather than a dict?

ok: [default] => {
    "environment": [
        {
            "foo": "bar"
        }
    ]
}

Answer (From #ansible on freenode.irc.net)

(10:56:14 AM) lanky: jugglinmike: because that's how environment variables appear to be stored - converted to a list of dict, allows task and role environments to inherit playbook environments.

---
- hosts: all
roles:
- example-task
environment:
foo: bar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment