summaryrefslogtreecommitdiff
path: root/tasks/preflight.yaml
blob: 3358d46b335179dd8f5b4afcda1bb48560759c15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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