feat(user/gpg): create a GPG role

Signed-off-by: Matej Focko <mfocko@redhat.com>
This commit is contained in:
Matej Focko 2023-09-16 23:08:02 +02:00
parent 7505e307fb
commit 47f0553dd4
Signed by: mfocko
GPG key ID: 7C47D46246790496
2 changed files with 17 additions and 0 deletions

View file

@ -49,6 +49,10 @@
- role: user/ssh - role: user/ssh
tags: ssh tags: ssh
# Set up GPG
- role: user/gpg
tags: gpg
# Configure Alacritty terminal # Configure Alacritty terminal
- role: user/terminals/alacritty - role: user/terminals/alacritty
tags: alacritty tags: alacritty

View file

@ -0,0 +1,13 @@
---
- name: Download the public GPG key
ansible.builtin.get_url:
url: "https://gitlab.com/{{ gitlab_login }}.gpg"
dest: /tmp/public.gpg
mode: 0600
- name: Import the public GPG key
ansible.builtin.command:
cmd: gpg --import /tmp/public.gpg
register: gpg_import_result
failed_when: gpg_import_result.rc != 0
changed_when: "'imported: 1' in gpg_import_result.stdout"