Add keys to local GPG keyring for use with signature validation

This commit is contained in:
Jake Howard 2019-05-26 19:00:27 +01:00
parent 5194afec24
commit 07a37c5ef4
Signed by: jake
GPG key ID: 57AFB45680EDD477

View file

@ -9,6 +9,12 @@
shell: "pacman-key --list-keys" shell: "pacman-key --list-keys"
register: pacman_keys register: pacman_keys
- name: "Get known GPG keys"
shell: "gpg --list-keys"
become: true
become_user: "{{ user }}"
register: known_gpg_keys
- name: "Add keys to pacman" - name: "Add keys to pacman"
shell: "pacman-key -r {{ item }}" shell: "pacman-key -r {{ item }}"
when: "item not in pacman_keys.stdout" when: "item not in pacman_keys.stdout"
@ -19,6 +25,13 @@
when: "item not in pacman_keys.stdout" when: "item not in pacman_keys.stdout"
with_items: "{{ keys }}" with_items: "{{ keys }}"
- name: "Add keys to local keyring"
shell: "gpg --recv-keys {{ item }}"
become: true
become_user: "{{ user }}"
when: "item not in known_gpg_keys.stdout"
with_items: "{{ keys }}"
- name: Install pacman config - name: Install pacman config
copy: copy:
src: ./files/pacman.conf src: ./files/pacman.conf