tasks/essential.yml (view raw)
1- name: Remove pacman db.lck
2 become: yes
3 ansible.builtin.file:
4 path: "/var/lib/pacman/db.lck"
5 state: absent
6
7- name: Update packages
8 community.general.pacman:
9 update_cache: true
10 upgrade: true
11
12- name: Install essential packages
13 package:
14 name: "{{ packages }}"
15 state: latest
16
17- name: Create the `aur_builder` user
18 become: yes
19 ansible.builtin.user:
20 name: aur_builder
21 create_home: yes
22 group: wheel
23
24- name: Allow the `aur_builder` user to run `sudo pacman` without a password
25 become: yes
26 ansible.builtin.lineinfile:
27 path: /etc/sudoers.d/11-install-aur_builder
28 line: 'aur_builder ALL=(ALL) NOPASSWD: /usr/bin/pacman'
29 create: yes
30 validate: 'visudo -cf %s'
31
32- name: Remove devel.json file
33 ansible.builtin.file:
34 path: "/home/{{ username }}/.cache/paru/devel.json"
35 state: absent
36
37- name: Upgrade the system using paru, only act on AUR packages.
38 become: no
39 kewlfft.aur.aur:
40 upgrade: yes
41 aur_only: yes
42
43- name: Enable passwordless sudo for {{ username }}
44 lineinfile:
45 dest: /etc/sudoers
46 regexp: "^%wheel"
47 line: "{{ username }} ALL=(ALL) NOPASSWD: ALL"
48 validate: "/usr/sbin/visudo -cf %s"