| 123456789101112131415161718 |
- ---
- - name: "Gather ansible_facts"
- hosts: ***CONTENTS REDACTED***.TLD
- gather_facts: yes
- become: true
- vars:
- user_list: "{{ getent_passwd | dict2items | selectattr('value') | map(attribute='key') }}"
- tasks:
- - getent:
- database: passwd
- - name: loop through users
- debug:
- msg: "{{ item }}:{{getent_passwd[item.username]|join(':')}}"
- loop: "{{ user_list }}"
- register: keys
- ignore_errors: true
|