2022-02-01 17:05:06 -06:00
|
|
|
- name: AUR | get package metadata for {{ pkg_name }}
|
|
|
|
connection: local
|
|
|
|
become: no
|
|
|
|
uri: >
|
2022-02-06 15:52:03 -06:00
|
|
|
url=https://aur.archlinux.org/rpc?v=5&type=info&arg={{ pkg_name | mandatory }}
|
2022-02-01 17:05:06 -06:00
|
|
|
return_content=yes
|
|
|
|
timeout=6
|
|
|
|
register: api_info
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- api_info.status == 200
|
|
|
|
- api_info.json is defined
|
2022-02-06 15:52:03 -06:00
|
|
|
- api_info.json.type == 'multiinfo'
|
2022-02-01 17:05:06 -06:00
|
|
|
- api_info.json.resultcount == 1
|
|
|
|
- api_info.json.results is defined
|
|
|
|
|
|
|
|
- name: AUR | download tarball for package {{ pkg_name }}
|
|
|
|
become: no
|
|
|
|
connection: local
|
|
|
|
get_url: >
|
2022-02-06 15:52:03 -06:00
|
|
|
url='https://aur.archlinux.org{{ api_info.json.results[0].URLPath }}'
|
2022-02-01 17:05:06 -06:00
|
|
|
dest='/tmp/'
|
|
|
|
register: aur_tarball
|
|
|
|
|
2022-02-06 15:52:03 -06:00
|
|
|
- name: AUR | cleanup old {{ pkg_name }} builds
|
|
|
|
ansible.builtin.file:
|
|
|
|
path: /tmp/{{ pkg_name }}
|
|
|
|
state: absent
|
|
|
|
|
2022-02-01 17:05:06 -06:00
|
|
|
- name: AUR | upload and extract package {{ pkg_name }} tarball to host
|
|
|
|
become: yes
|
|
|
|
become_user: '{{ makepkg_nonroot_user }}'
|
|
|
|
unarchive: >
|
|
|
|
src={{ aur_tarball.dest }}
|
|
|
|
dest=/tmp/
|
|
|
|
register: extracted_pkg
|
|
|
|
|
|
|
|
- name: AUR | get dependencies and build package {{ pkg_name }}
|
|
|
|
when: extracted_pkg.changed
|
|
|
|
become: yes
|
|
|
|
become_user: '{{ makepkg_nonroot_user }}'
|
|
|
|
command: >
|
|
|
|
makepkg --noconfirm --noprogressbar -mfs
|
|
|
|
chdir=/tmp/{{ pkg_name }}
|
|
|
|
register: aur_makepkg_result
|
|
|
|
|
|
|
|
- shell: 'ls -1 /tmp/{{ pkg_name | quote }} | grep pkg.tar'
|
|
|
|
register: compiled_package_name
|
|
|
|
|
|
|
|
- name: AUR | install {{ pkg_name }} with pacman
|
|
|
|
when: aur_makepkg_result.changed
|
|
|
|
become: yes
|
|
|
|
shell: >
|
|
|
|
pacman --noconfirm --noprogressbar --needed -U {{ compiled_package_name.stdout | quote }}
|
|
|
|
chdir=/tmp/{{ pkg_name }}
|
|
|
|
register: pacman_install_result
|
|
|
|
changed_when: pacman_install_result.stdout is defined and pacman_install_result.stdout.find('there is nothing to do') == -1
|