Fix aur install + cleanup

This commit is contained in:
2026-02-04 17:59:49 +01:00
parent e6443749b5
commit 433dfcd0c1

View File

@@ -48,22 +48,6 @@
state: present
update_cache: true
# Install rustup and cargo to build paru
- name: Check if rustup default toolchain is installed
ansible.builtin.command: rustup toolchain list
register: rustup_toolchains
changed_when: false
failed_when: false
become: false
- name: Install stable Rust toolchain via rustup
ansible.builtin.command:
cmd: rustup default stable
become: false
when: "'stable' not in rustup_toolchains.stdout"
register: result
changed_when: result.rc == 0
- name: Check which AUR packages are already installed
ansible.builtin.command: >
pacman -Q {{ aur_packages | join(' ') }}
@@ -75,7 +59,9 @@
ansible.builtin.set_fact:
aur_install_needed: "{{ aur_check.rc != 0 }}"
- block:
- name: Aur installs
when: aur_install_needed
block:
- name: Create temporary AUR builder user
ansible.builtin.user:
name: "{{ aur_builder }}"
@@ -89,6 +75,24 @@
mode: "0440"
validate: "visudo -cf %s"
# Install rustup and cargo to build paru
- name: Check if rustup default toolchain is installed
ansible.builtin.command: rustup toolchain list
register: rustup_toolchains
changed_when: false
failed_when: false
become: true
become_user: "{{ aur_builder }}"
- name: Install stable Rust toolchain via rustup
ansible.builtin.command:
cmd: rustup default stable
become: true
become_user: "{{ aur_builder }}"
when: "'stable' not in rustup_toolchains.stdout"
register: result
changed_when: result.rc == 0
- name: Install AUR packages
become: true
become_user: "{{ aur_builder }}"
@@ -107,7 +111,6 @@
name: "{{ aur_builder }}"
state: absent
remove: true
when: aur_install_needed
## Post install config
- name: Ensure groups exist
@@ -153,11 +156,11 @@
- name: Ensure systemd user wants dir exists
ansible.builtin.file:
path: "{{ wants_dir }}"
state: directory
mode: "0755"
owner: "{{ ansible_facts['user_id'] }}"
group: "{{ ansible_facts['user_id'] }}"
path: "{{ wants_dir }}"
state: directory
mode: "0755"
owner: "{{ ansible_facts['user_id'] }}"
group: "{{ ansible_facts['user_id'] }}"
- name: Enable pipewire-pulse user units
ansible.builtin.file:
@@ -170,6 +173,7 @@
- pipewire-pulse.socket
- name: Ensure SSH config entry for git.jika.li
become: false
ansible.builtin.blockinfile:
path: "/home/{{ ansible_facts['user_id'] }}/.ssh/config"
create: true
@@ -178,5 +182,5 @@
mode: '0600'
marker: "# {mark} ANSIBLE "
block: |
Host git.jika.li
Host git.jika.li
Port 2233