Simplify the "Import GPG keys" loop
This commit is contained in:
parent
2354a8fb8c
commit
ac412f16ef
@ -3,8 +3,8 @@ allow_reboot: false
|
|||||||
manage_network: false
|
manage_network: false
|
||||||
|
|
||||||
root_gpgkeys:
|
root_gpgkeys:
|
||||||
# kris@lamoureux.io
|
- name: kris@lamoureux.io
|
||||||
- id: FBF673CEEC030F8AECA814E73EDA9C3441EDA925
|
id: FBF673CEEC030F8AECA814E73EDA9C3441EDA925
|
||||||
|
|
||||||
# docker
|
# docker
|
||||||
docker_users:
|
docker_users:
|
||||||
|
@ -18,19 +18,19 @@
|
|||||||
when: root_gpgkeys is defined
|
when: root_gpgkeys is defined
|
||||||
|
|
||||||
- name: Import GPG keys
|
- name: Import GPG keys
|
||||||
command: "gpg --keyserver {{ item.0.server | default('keys.openpgp.org') }} --recv-key {{ item.0.id }}"
|
command: "gpg --keyserver {{ item.item.server | default('keys.openpgp.org') }} --recv-key {{ item.item.id }}"
|
||||||
register: gpg_check_import
|
register: gpg_check_import
|
||||||
loop: "{{ root_gpgkeys | zip(gpg_check.results) | list }}"
|
loop: "{{ gpg_check.results }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item.0.id }}"
|
label: "{{ item.item.name }}"
|
||||||
when: root_gpgkeys is defined and item.1.rc != 0
|
when: root_gpgkeys is defined and item.rc != 0
|
||||||
|
|
||||||
- name: Check GPG key imports
|
- name: Check GPG key imports
|
||||||
fail:
|
fail:
|
||||||
msg: "{{ item.stderr }}"
|
msg: "{{ item.stderr }}"
|
||||||
loop: "{{ gpg_check_import.results }}"
|
loop: "{{ gpg_check_import.results }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item.item.0.id }}"
|
label: "{{ item.item.item.id }}"
|
||||||
when: (item.skipped | default(false) == false) and ('imported' not in item.stderr)
|
when: (item.skipped | default(false) == false) and ('imported' not in item.stderr)
|
||||||
|
|
||||||
- name: Install NTPsec
|
- name: Install NTPsec
|
||||||
|
Loading…
Reference in New Issue
Block a user