Created
January 17, 2014 19:17
-
-
Save Pablohn26/8479624 to your computer and use it in GitHub Desktop.
This file contains 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
with the next structure: | |
- vmHash: { vcpu: 1, | |
ram: 1024, | |
storage: 10, | |
vms: [{name: storage1-dev02,ip: 10.199.3.87}, | |
{name: storage2-dev02,ip: 10.199.3.88}, | |
{name: storage3-dev02,ip: 10.199.3.89}] | |
} | |
and the next debug: | |
- debug: msg="{{ vmHash.vms }}" | |
- debug: msg="{{ vmHash.vms.ip }}" | |
output: | |
TASK: [vc.storage | debug msg="[{'ip': '10.199.3.87', 'name': 'storage1-dev02'}, {'ip': '10.199.3.88', 'name': 'storage2-dev02'}, {'ip': '10.199.3.89', 'name': 'storage3-dev02'}]"] *** | |
ok: [s04.lab] => { | |
"item": "", | |
"msg": "[{'ip': '10.199.3.87', 'name': 'storage1-dev02'}, {'ip': '10.199.3.88', 'name': 'storage2-dev02'}, {'ip': '10.199.3.89', 'name': 'storage3-dev02'}]" | |
} | |
TASK: [vc.storage | debug msg="{{vmHash.vms.ip}}"] **************************** | |
fatal: [s04.lab] => One or more undefined variables: 'list object' has no attribute 'ip' | |
FATAL: all hosts have already failed -- aborting |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment