dotfiles/tasks/packages.yml
2021-02-23 17:50:37 +00:00

81 lines
1.7 KiB
YAML

- name: Get repository keys
shell: pacman-key --list-sigs
become: true
register: repo_keys
changed_when: false
- name: Install custom repo keys
shell:
cmd: pacman-key -r {{ item }} && pacman-key --lsign-key {{ item }}
become: true
register: added_repo_keys
loop:
- 8A8F901A # Sublime Text
- 9D5F1C051D146843CDA4858BDE64825E7CBC0D51 # ArchStrike
- DDF7DB817396A49B2A2723F7403BD972F75D9D76 # archzfs
when: item not in repo_keys.stdout
- name: Install pacman config
template:
src: ./files/pacman.conf
dest: /etc/pacman.conf
mode: 0644
register: pacman_conf
- name: Create aur_builder user
user:
name: aur_builder
group: wheel
password_lock: true
shell: /usr/bin/nologin
changed_when: false
- name: Allow aur_builder user to run pacman as root
lineinfile:
path: /etc/sudoers.d/11-install-aur_builder
line: "aur_builder ALL=(ALL) NOPASSWD: /usr/bin/pacman"
create: true
validate: visudo -cf %s
mode: 0644
changed_when: false
- name: Install yay
aur:
name: yay-bin
become: true
become_user: aur_builder
- name: Update package repositories
pacman:
update_cache: yes
become: true
when: added_repo_keys.changed or pacman_conf.changed
- name: Install additional repo keyrings
aur:
name: "{{ item }}"
become: true
become_user: aur_builder
loop:
- archstrike-keyring
- name: Install ccache
aur:
name: ccache
become: true
become_user: aur_builder
- name: Install makepkg tools
aur:
name: "{{ item }}"
become: true
become_user: aur_builder
loop:
- pbzip2
- zstd
- name: Install makepkg config
template:
src: ./files/makepkg.conf
dest: /etc/makepkg.conf
mode: 0644