--- - name: "PRELIM | Parse /etc/passwd" tags: - always block: - name: "PRELIM | Parse /etc/passwd | Get /etc/password contents" ansible.builtin.command: cat /etc/passwd changed_when: false check_mode: false register: prelim_passwd_file_audit - name: "PRELIM | Parse /etc/passwd | Split passwd entries" ansible.builtin.set_fact: ubtu24cis_passwd: "{{ prelim_passwd_file_audit.stdout_lines | map('regex_replace', ld_passwd_regex, ld_passwd_yaml) | map('from_yaml') | list }}" vars: ld_passwd_regex: >- ^(?P[^:]*):(?P[^:]*):(?P[^:]*):(?P[^:]*):(?P[^:]*):(?P[^:]*):(?P[^:]*) ld_passwd_yaml: | # pragma: allowlist secret id: >-4 \g password: >-4 \g uid: \g gid: \g gecos: >-4 \g dir: >-4 \g shell: >-4 \g