From c00c75d310e2afea3b521e8a4b90e800ab4f9ff2 Mon Sep 17 00:00:00 2001 From: heqnx Date: Thu, 2 Oct 2025 13:08:58 +0300 Subject: initial commit --- tasks/preflight.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 tasks/preflight.yaml (limited to 'tasks/preflight.yaml') diff --git a/tasks/preflight.yaml b/tasks/preflight.yaml new file mode 100644 index 0000000..3358d46 --- /dev/null +++ b/tasks/preflight.yaml @@ -0,0 +1,16 @@ +- name: ensure script is run as root + assert: + that: + - ansible_effective_user_id == 0 + fail_msg: "this playbook must be run as root" + +- name: check if system is debian-based + command: dpkg -l + register: dpkg_check + changed_when: false + failed_when: false + +- name: fail if not debian-based + fail: + msg: "distribution not Debian-based" + when: dpkg_check.rc != 0 -- cgit v1.2.3