aur repo wip
This commit is contained in:
5
ansible/roles/aur_repo_client/handlers/main.yaml
Normal file
5
ansible/roles/aur_repo_client/handlers/main.yaml
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
|
||||
- name: Update pacman
|
||||
community.general.pacman:
|
||||
update_cache: true
|
45
ansible/roles/aur_repo_client/tasks/main.yaml
Normal file
45
ansible/roles/aur_repo_client/tasks/main.yaml
Normal file
@ -0,0 +1,45 @@
|
||||
---
|
||||
|
||||
- name: Check if repo public key is in pacman keyring
|
||||
ansible.builtin.command:
|
||||
argv:
|
||||
- pacman-key
|
||||
- --list-keys
|
||||
- "{{ aur_repo_client_repo_name }}"
|
||||
register: repo_key_check
|
||||
failed_when: repo_key_check.rc not in [0, 2]
|
||||
changed_when: false
|
||||
|
||||
- name: Add repo public key to pacman keyring
|
||||
when: repo_key_check.rc == 2
|
||||
block:
|
||||
|
||||
- name: Import the repo public key
|
||||
ansible.builtin.command:
|
||||
argv:
|
||||
- pacman-key
|
||||
- --recv-keys
|
||||
- "{{ aur_repo_client_public_key_fingerprint }}"
|
||||
- --keyserver
|
||||
- "{{ aur_repo_client_keyserver }}"
|
||||
changed_when: true
|
||||
|
||||
- name: Trust the repo public key
|
||||
ansible.builtin.command:
|
||||
argv:
|
||||
- pacman-key
|
||||
- --lsign-key
|
||||
- "{{ aur_repo_client_public_key }}"
|
||||
changed_when: true
|
||||
|
||||
- name: Add home repo block to pacman.conf
|
||||
ansible.builtin.blockinfile:
|
||||
path: /etc/pacman.conf
|
||||
block: |
|
||||
[{{ aur_repo_client_repo_name }}]
|
||||
SigLevel = Required TrustedOnly
|
||||
Server = {{ aur_repo_client_repo_address }}
|
||||
create: false
|
||||
state: present
|
||||
insertafter: EOF
|
||||
notify: Update pacman
|
4
ansible/roles/aur_repo_client/vars/main.yaml
Normal file
4
ansible/roles/aur_repo_client/vars/main.yaml
Normal file
@ -0,0 +1,4 @@
|
||||
aur_repo_client_repo_name: "home"
|
||||
aur_repo_client_repo_address: "https://repo.balsillie.house"
|
||||
aur_repo_client_public_key: DB529158B99DD8311D78CA2FBE6003C744F56EE2
|
||||
aur_repo_client_keyserver: hkps://keyserver.ubuntu.com
|
Reference in New Issue
Block a user