When you use a loop in an ansible task, e.g. with_items or with_dict, a 
dump of the item is included in the output. Sometimes these items contain 
secure infomation which it is undesirable to have output on screen, for 
example:

---
- name: Test
  hosts: 127.0.0.1
  vars:
    dbs:
      prod:
        port: 3306
        password: secret
      dev:
        port: 3307
        password: notsosecret
  tasks:
    - command: echo {{ item.value.port }}
      with_dict: dbs


outputs:

[thom@ThomComp test]$ ansible-playbook ansible/test.yml


PLAY [Test] 
******************************************************************* 


GATHERING FACTS 
*************************************************************** 
ok: [127.0.0.1]


TASK: [command echo {{item.value.port}}] 
************************************** 
changed: [127.0.0.1] => (item={'value': {'password': 'secret', 'port': 3306
}, 'key': 'prod'})
changed: [127.0.0.1] => (item={'value': {'password': 'notsosecret', 'port': 
3307}, 'key': 'dev'})


PLAY RECAP 
******************************************************************** 
127.0.0.1                  : ok=2    changed=1    unreachable=0    failed=0
   

At best, I think there should be a way to choose what is output (in this 
case I would choose the dict.key), at least I think there should be a way 
to suppress this output.

Opinions/ideas?

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/66dfbfeb-ff76-4e5a-bfbe-7358c6d3b9a2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to