Add personal gpg key configuration

This commit is contained in:
2021-10-02 12:02:24 +02:00
parent 05a00fad3a
commit 8011c1827a
6 changed files with 138 additions and 7 deletions

View File

@@ -568,3 +568,19 @@
tags:
- autostart
- block:
- name: import gpg key
command: gpg --import ./gpgkeys/{{ user.gpg_key.email }}.gpg.asc
register: gpg_import_output
changed_when: not ("unchanged" in gpg_import_output.stderr)
- name: trust gpg key
shell: "gpg --import-ownertrust <<< {{ user.gpg_key.fingerprint }}:6"
args:
executable: /bin/bash # required for <<<
register: gpg_trust_output
changed_when: gpg_trust_output.stderr_lines|length > 0
when: user.gpg_key is defined
tags: [gpg]