diff --git a/playbooks/bootstrap.yml b/playbooks/bootstrap.yml index de48b00..cb42874 100644 --- a/playbooks/bootstrap.yml +++ b/playbooks/bootstrap.yml @@ -49,6 +49,10 @@ - role: user/ssh tags: ssh + # Set up GPG + - role: user/gpg + tags: gpg + # Configure Alacritty terminal - role: user/terminals/alacritty tags: alacritty diff --git a/roles/user/gpg/tasks/main.yml b/roles/user/gpg/tasks/main.yml new file mode 100644 index 0000000..cae943a --- /dev/null +++ b/roles/user/gpg/tasks/main.yml @@ -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"