5f75a2d004
Current usage of gpg keys involves a single role that adds, signs, and removes the key all in one. Some jobs may need the GPG key installed normally onto the remote host, then left in place, and later removed. This change facilitates that. Change-Id: I2f13f0c4de91808ba1bbdcc0fd20a547e43d602b
19 lines
471 B
YAML
19 lines
471 B
YAML
- name: Create GPG private key tempfile
|
|
tempfile:
|
|
state: file
|
|
register: gpg_private_key_tmp
|
|
|
|
- name: Stage GPG private key for importing
|
|
copy:
|
|
content: "{{ gpg_key.private }}"
|
|
dest: "{{ gpg_private_key_tmp.path }}"
|
|
mode: 0400
|
|
|
|
- name: Import GPG private key
|
|
command: "gpg --allow-secret-key-import --import {{ gpg_private_key_tmp.path }}"
|
|
|
|
- name: Delete staged GPG private key
|
|
file:
|
|
path: "{{ gpg_private_key_tmp.path }}"
|
|
state: absent
|