ctucx.git: ansible-configs

My personal ansible roles and playbooks [deprecated in favor of nixos]

1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 
13 
14 
15 
16 
17 
18 
19 
20 
21 
22 
23 
24 
25 
26 
27 
28 
29 
30 
31 
32 
33 
34 
35 
36 
37 
38 
39 
40 
41 
42 
43 
44 
45 
46 
47 
48 
49 
---

- name: "[Alpine] Install package: sudo" 
  apk:
    name: sudo 
    state: present
    update_cache: yes
  when: 
    - ansible_distribution == "Alpine"
    - system.enableSudo is true

- name: "[Archlinux] Install package: sudo" 
  pacman:
    name: sudo 
    state: present
    update_cache: yes
  when: 
    - ansible_distribution == "Archlinux"
    - system.enableSudo is true


- name: "Patch file: /etc/sudoers"
  patch:
    src: sudoers.patch
    dest: /etc/sudoers
  when: system.enableSudo is true


- name: "[Alpine] Remove package: sudo" 
  apk:
    name: sudo 
    state: absent
  when: 
    - ansible_distribution == "Alpine"
    - system.enableSudo is false

- name: "[Archlinux] Remove package: sudo" 
  pacman:
    name: sudo 
    state: absent
  when: 
    - ansible_distribution == "Archlinux"
    - system.enableSudo is false

- name: "Remove file: /etc/sudoers"
  file:
    path: /etc/sudoers
    mode: absent
  when: system.enableSudo is false