So I'm close. I am able to get the items from the returned list via the IPA API:
- name: Run user_find from IDM API using previously stored session cookie
uri:
url: "https://{{idmfqdn}}/ipa/session/json"
method: POST
headers:
Cookie: "{{ login.set_cookie }}"
Referer: "https://{{idmfqdn}}/ipa"
Content-Type: "application/json"
Accept: "application/json"
body_format: json
body: "{\"method\": \"user_find/1\",\"params\": [[],{\"version\": \"{{ api_vers }}\"}]}"
register: user_find
I can print them out and get the info I need:
- name: Print output
debug:
msg: "{{ item.uid[0] }}: {{ item.gidnumber[0] }}: {{ item.homedirectory[0] }}"
with_items: "{{ user_find.json.result.result| }}"
However, in my other thread about removing items from the list, I'm trying the suggestion as follows:
- name: Print output
debug:
msg: "{{ item.uid[0] }}: {{ item.gidnumber[0] }}: {{ item.homedirectory[0] }}"
loop: "{{ user_find.json.result.result|difference(deny) }}"
vars:
deny: ["/home/admin","/home/test"]
This gives me the following validation error:
ERROR! conflicting action statements: debug, deny
I won't be using debug in the final version of the playbook, so since I know that I can get the info I need, should I just move onto that? Or is there a way to get debug and deny to coexist to I can be SURE I'm getting what I need first?
Thanks,
Harry