--- - name: validate-installation | Get all users from the installed system getent: database: passwd - name: validate-installation | Assert that all users have an UID smaller or equal than 1000 fail: msg: "User {{ item }} has the UID {{ getent_passwd[item].1 }} > 1000!" when: ((getent_passwd[item].1 | int) > 1000) and (item != "nobody") with_items: - "{{ getent_passwd.keys() | list }}" - name: validate-installation | Get all groups from the installed system getent: database: group - name: validate-installation | Assert that all groups have a GID smaller or equal than 1000 fail: msg: "Group {{ item }} has the GID {{ getent_group[item].1 }} > 1000!" when: ((getent_group[item].1 | int) > 1000) and (item != "nogroup") with_items: - "{{ getent_group.keys() | list }}"