summaryrefslogtreecommitdiffstats
path: root/validate-installation
diff options
context:
space:
mode:
Diffstat (limited to 'validate-installation')
-rw-r--r--validate-installation/tasks/main.yml22
1 files changed, 22 insertions, 0 deletions
diff --git a/validate-installation/tasks/main.yml b/validate-installation/tasks/main.yml
new file mode 100644
index 0000000..44d1720
--- /dev/null
+++ b/validate-installation/tasks/main.yml
@@ -0,0 +1,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 }}"