aboutsummaryrefslogtreecommitdiff
path: root/tasks/preflight.yaml
blob: 6c67ae7341855edd84087c3e06964d9efc346a43 (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
  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