From 433dfcd0c1e7ab1a4454e2505a6e4165eea71fb7 Mon Sep 17 00:00:00 2001 From: Jika Date: Wed, 4 Feb 2026 17:59:49 +0100 Subject: [PATCH] Fix aur install + cleanup --- ansible/base_install.yml | 52 +++++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/ansible/base_install.yml b/ansible/base_install.yml index 74c0de7..ae4ff5c 100644 --- a/ansible/base_install.yml +++ b/ansible/base_install.yml @@ -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