aboutsummaryrefslogtreecommitdiff
path: root/tasks/preflight.yaml
diff options
context:
space:
mode:
authorheqnx <root@heqnx.com>2025-06-22 21:37:01 +0300
committerheqnx <root@heqnx.com>2025-06-22 21:37:01 +0300
commita75493e62c8bd5f1daee90e7ee55bcd67b4b95b8 (patch)
tree3f0f0568529f22a9e429359035dc7f4ecdb92bc4 /tasks/preflight.yaml
parenta6ec8f8947e1d6e56d1c0af6b67af2e7468ef98f (diff)
downloadansible-pve-host-a75493e62c8bd5f1daee90e7ee55bcd67b4b95b8.tar.gz
ansible-pve-host-a75493e62c8bd5f1daee90e7ee55bcd67b4b95b8.zip
added preflight, renamed tasks, added local non-pam user
Diffstat (limited to 'tasks/preflight.yaml')
-rw-r--r--tasks/preflight.yaml17
1 files changed, 17 insertions, 0 deletions
diff --git a/tasks/preflight.yaml b/tasks/preflight.yaml
new file mode 100644
index 0000000..aef9dcf
--- /dev/null
+++ b/tasks/preflight.yaml
@@ -0,0 +1,17 @@
+- name: ensure script is run as root
+ ansible.builtin.assert:
+ that:
+ - ansible_effective_user_id == 0
+ fail_msg: "this playbook must be run as root"
+
+- name: check if system is debian-based
+ ansible.builtin.command: dpkg -l
+ register: dpkg_check
+ changed_when: false
+ failed_when: false
+
+- name: fail if not debian-based
+ ansible.builtin.fail:
+ msg: "distribution not Debian-based"
+ when: dpkg_check.rc != 0
+