summaryrefslogtreecommitdiffstats
path: root/validate-installation/tasks/main.yml
blob: 44d17204657660919773b8de5fd4c4efda2ec4da (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
---
- 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 }}"