Skip to content

Instantly share code, notes, and snippets.

@larsks
Created January 14, 2019 16:15
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 larsks/f6a5f546868d1f6de9283a4abd21cc56 to your computer and use it in GitHub Desktop.
Save larsks/f6a5f546868d1f6de9283a4abd21cc56 to your computer and use it in GitHub Desktop.
{
"fa": {
"ansible_purefa_facts": {
"volumes": {
"PoC-VM_Volumes": {
"bandwidth": null,
"hosts": [
[
"VM-003-IOM",
1
]
],
"serial": "1079E7C9294245FA000117CF",
"size": 1099511627776,
"source": null
},
"test1": {
"bandwidth": null,
"hosts": [
[
"VM-003-IOM",
11
]
],
"serial": "1079E7C9294245FA000117E0",
"size": 1073741824,
"source": null
}
}
},
"changed": false,
"invocation": {
"module_args": {
"gather_subset": [
"volumes"
]
}
}
}
}
---
- hosts: localhost
gather_facts: false
vars_files:
- facts.json
tasks:
- debug:
msg: "{{ item.value.serial }}"
when: item.key == "test1"
with_dict: "{{ fa.ansible_purefa_facts.volumes }}"
loop_control:
label: "{{ item.key }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment