added gpg role
This commit is contained in:
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
galaxy_info:
|
||||||
|
author: cjr
|
||||||
|
description: Import GPG keys from private git repo
|
||||||
|
license: BSD-3-Clause
|
||||||
|
min_ansible_version: "2.1"
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
---
|
||||||
|
- name: Clone GPG keys repo
|
||||||
|
ansible.builtin.git:
|
||||||
|
repo: cjr@git:/home/cjr/git/keys
|
||||||
|
dest: "{{ ansible_facts['user_dir'] }}/.gpg-keys"
|
||||||
|
update: true
|
||||||
|
version: main
|
||||||
|
|
||||||
|
- name: Import GPG public key
|
||||||
|
ansible.builtin.command:
|
||||||
|
cmd: gpg --import {{ ansible_facts['user_dir'] }}/.gpg-keys/public-key.asc
|
||||||
|
register: gpg_import_public
|
||||||
|
changed_when: "'imported' in gpg_import_public.stderr"
|
||||||
|
|
||||||
|
- name: Import GPG secret key
|
||||||
|
ansible.builtin.command:
|
||||||
|
cmd: gpg --import {{ ansible_facts['user_dir'] }}/.gpg-keys/secret-key.asc
|
||||||
|
register: gpg_import_secret
|
||||||
|
changed_when: "'imported' in gpg_import_secret.stderr"
|
||||||
|
no_log: true
|
||||||
|
|
||||||
|
- name: Remove cloned GPG keys
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: "{{ ansible_facts['user_dir'] }}/.gpg-keys"
|
||||||
|
state: absent
|
||||||
Reference in New Issue
Block a user