# Help with ansible local\_action with\_items and debug

**URL:** <https://forum.ansible.com/t/help-with-ansible-local-action-with-items-and-debug/29768>\
**Category:** Ansible Project\
**Created:** [February 25, 2019, 7:58pm UTC](https://forum.ansible.com/t/help-with-ansible-local-action-with-items-and-debug/29768 "2019-02-25T19:58:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rogerio\_Ceni\_Coelho](https://avatars.discourse-cdn.com/v4/letter/r/e9bcb4/32.png) [@Rogerio\_Ceni\_Coelho](https://forum.ansible.com/u/Rogerio_Ceni_Coelho)\
**Post date:** [February 25, 2019, 7:58pm UTC](https://forum.ansible.com/t/help-with-ansible-local-action-with-items-and-debug/29768/1 "2019-02-25T19:58:32Z")

</div>

Hi Ansible Jedi´s !!!

I need some help with this example running a local\_action.

This playbook returns only debug information for the last item on local\_action.

What are the right way to print debug for all items ???

[root@prd-rbs-ansible26-poa ansible]# cat playbooks/prd-rbs-ovirt42-storage-facts.yml

- hosts: localhost  
tasks:

- name: Retrieve facts about one or more oVirt/RHV storage domains - (ovirt\_storage\_domain\_facts)  
local\_action:  
module: ovirt\_storage\_domains\_facts  
auth:  
url: [https://prd-rbs-ovirt42-poa.rbs.com.br/ovirt-engine/api](https://prd-rbs-ovirt42-poa.rbs.com.br/ovirt-engine/api)  
username: admin@internal  
password: thisisthepassword  
pattern: name=“{{ item.storage\_domain\_name }}” and datacenter=“{{ item.storage\_domain\_datacenter\_name }}”  
with\_items:

- { storage\_domain\_name: ‘VNX55001\_PRD42\_DATA’, storage\_domain\_datacenter\_name: ‘Default’ }

- { storage\_domain\_name: ‘UNITY\_PRD42\_DATA\_DOMAIN’, storage\_domain\_datacenter\_name: ‘Default’ }

- { storage\_domain\_name: ‘NASUNITY\_PRD\_OVIRT42\_DATA\_DOMAIN’, storage\_domain\_datacenter\_name: ‘Default’ }

- { storage\_domain\_name: ‘ISO\_DOMAIN’, storage\_domain\_datacenter\_name: ‘Default’ }

- debug:  
var: ovirt\_storage\_domains  
[root@prd-rbs-ansible26-poa ansible]#

[root@prd-rbs-ansible26-poa ansible]# ansp playbooks/prd-rbs-ovirt42-storage-facts.yml

PLAY [localhost] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK [Gathering Facts] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [localhost]

TASK [Retrieve facts about one or more oVirt/RHV storage domains - (ovirt\_storage\_domain\_facts)] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [localhost → localhost] =\> (item={u’storage\_domain\_name’: u’VNX55001\_PRD42\_DATA’, u’storage\_domain\_datacenter\_name’: u’Default’})  
ok: [localhost → localhost] =\> (item={u’storage\_domain\_name’: u’UNITY\_PRD42\_DATA\_DOMAIN’, u’storage\_domain\_datacenter\_name’: u’Default’})  
ok: [localhost → localhost] =\> (item={u’storage\_domain\_name’: u’NASUNITY\_PRD\_OVIRT42\_DATA\_DOMAIN’, u’storage\_domain\_datacenter\_name’: u’Default’})  
ok: [localhost → localhost] =\> (item={u’storage\_domain\_name’: u’ISO\_DOMAIN’, u’storage\_domain\_datacenter\_name’: u’Default’})

TASK [debug] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [localhost] =\> {  
“ovirt\_storage\_domains”: [  
{  
“available”: 484257562624,  
“backup”: false,  
“comment”: “ISO\_DOMAIN”,  
“committed”: 0,  
“critical\_space\_action\_blocker”: 5,  
“data\_centers”: [  
{  
“href”: “/ovirt-engine/api/datacenters/cca34032-c685-11e8-b6e5-001dd8b72533”,  
“id”: “cca34032-c685-11e8-b6e5-001dd8b72533”  
}  
],  
“description”: “ISO\_DOMAIN”,  
“discard\_after\_delete”: false,  
“disk\_profiles”: ,  
“disk\_snapshots”: ,  
“external\_status”: “ok”,  
“files”: ,  
“href”: “/ovirt-engine/api/storagedomains/b684cd6c-3090-4ce5-9bdc-5fb099beab77”,  
“id”: “b684cd6c-3090-4ce5-9bdc-5fb099beab77”,  
“master”: false,  
“name”: “ISO\_DOMAIN”,  
“permissions”: ,  
“storage”: {  
“address”: “[spitzer.srv.srvr.rbs.net](http://spitzer.srv.srvr.rbs.net)”,  
“nfs\_version”: “auto”,  
“path”: “/u00/oVirt/PRD42/ISO\_DOMAIN”,  
“type”: “nfs”  
},  
“storage\_connections”: ,  
“storage\_format”: “v1”,  
“supports\_discard”: false,  
“supports\_discard\_zeroes\_data”: false,  
“type”: “iso”,  
“used”: 86973087744,  
“warning\_low\_space\_indicator”: 10,  
“wipe\_after\_delete”: false  
}  
]  
}

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
localhost : ok=3 changed=0 unreachable=0 failed=0

[root@prd-rbs-ansible26-poa ansible]#
