Created
May 31, 2015 05:12
-
-
Save omgjlk/cd0486f317441d351874 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| --- | |
| - name: thing | |
| hosts: localhost | |
| gather_facts: false | |
| vars: | |
| foo: | |
| keys: | |
| - 1 | |
| - 2 | |
| - 3 | |
| tasks: | |
| - name: thing | |
| debug: | |
| var: foo.keys | |
| - name: thing2 | |
| debug: | |
| var: foo['keys'] | |
| > ansible-playbook -i mastery-hosts keys.yaml -vv | |
| PLAY [thing] ****************************************************************** | |
| TASK: [thing] ***************************************************************** | |
| ok: [localhost] => { | |
| "var": { | |
| "foo.keys": "<built-in method keys of dict object at 0x7f9dc29ea360>" | |
| } | |
| } | |
| TASK: [thing2] **************************************************************** | |
| ok: [localhost] => { | |
| "var": { | |
| "foo['keys']": [ | |
| 1, | |
| 2, | |
| 3 | |
| ] | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment