blob: aef9dcfe64900ff840326c62652b8a29016749fd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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
|