Use paru instead of paru-bin and run the paru role only if it's necessary
This commit is contained in:
@@ -1,3 +1,14 @@
|
|||||||
|
- name: Check if paru is already installed
|
||||||
|
ansible.builtin.pacman:
|
||||||
|
name: paru
|
||||||
|
state: present
|
||||||
|
check_mode: true
|
||||||
|
register: is_paru_installed
|
||||||
|
|
||||||
|
- name: Stop the role if paru is already installed
|
||||||
|
when: not is_paru_installed.changed
|
||||||
|
ansible.builtin.meta: end_role
|
||||||
|
|
||||||
- name: Ensure build prerequisites are present
|
- name: Ensure build prerequisites are present
|
||||||
become: true
|
become: true
|
||||||
ansible.builtin.pacman:
|
ansible.builtin.pacman:
|
||||||
@@ -13,25 +24,25 @@
|
|||||||
|
|
||||||
- name: Download the AUR snapshot
|
- name: Download the AUR snapshot
|
||||||
ansible.builtin.get_url:
|
ansible.builtin.get_url:
|
||||||
url: "https://aur.archlinux.org/cgit/aur.git/snapshot/paru-bin.tar.gz"
|
url: "https://aur.archlinux.org/cgit/aur.git/snapshot/paru.tar.gz"
|
||||||
dest: "{{ paru_tmp.path }}/paru-bin.tar.gz"
|
dest: "{{ paru_tmp.path }}/paru.tar.gz"
|
||||||
|
|
||||||
- name: Extract the snapshot
|
- name: Extract the snapshot
|
||||||
ansible.builtin.unarchive:
|
ansible.builtin.unarchive:
|
||||||
src: "{{ paru_tmp.path }}/paru-bin.tar.gz"
|
src: "{{ paru_tmp.path }}/paru.tar.gz"
|
||||||
dest: "{{ paru_tmp.path }}"
|
dest: "{{ paru_tmp.path }}"
|
||||||
remote_src: true
|
remote_src: true
|
||||||
|
|
||||||
- name: Build the package (no install)
|
- name: Build the package (no install)
|
||||||
ansible.builtin.command:
|
ansible.builtin.command:
|
||||||
cmd: makepkg --syncdeps --noconfirm
|
cmd: makepkg --syncdeps --noconfirm
|
||||||
chdir: "{{ paru_tmp.path }}/paru-bin"
|
chdir: "{{ paru_tmp.path }}/paru"
|
||||||
environment:
|
environment:
|
||||||
PKGDEST: "{{ paru_tmp.path }}/paru-bin"
|
PKGDEST: "{{ paru_tmp.path }}/paru"
|
||||||
|
|
||||||
- name: Locate built package(s)
|
- name: Locate built package(s)
|
||||||
ansible.builtin.find:
|
ansible.builtin.find:
|
||||||
paths: "{{ paru_tmp.path }}/paru-bin"
|
paths: "{{ paru_tmp.path }}/paru"
|
||||||
patterns: "*.pkg.tar.zst"
|
patterns: "*.pkg.tar.zst"
|
||||||
file_type: file
|
file_type: file
|
||||||
register: built_pkgs
|
register: built_pkgs
|
||||||
|
|||||||
Reference in New Issue
Block a user