all repos — proxmox-ansible @ e07888e9846d99b7aeb1fed39fea0756b23cd1b3

tasks/essential.yml (view raw)

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