gpg_export
Ansible Role: GPG Export
Provides GPG public key lookup plugin.
Requirements
GnuPG installed on controller machine.
Optional Lookup Parameters
executable
: Full path to the gpg binary. Defaults to/usr/bin/gpg
(Ansible < 2.7) or located automatically inPATH
environment variable (Ansible >= 2.7).homedir
: Path to the gnupg home directory (see man 1 gpg). Defaults to GnuPG default (~/.gnupg
).armor
: Produce ASCII armored output (see man 1 gpg). Defaults toTrue
.export_options
: List of options for the exported keys (see man 1 gpg).match
: One ofdefault
,exact_uid
,exact_email
,partial_email
, specifying how keys are matched to the given uids. (see man 1 gpg)
Dependencies
None
Example Playbook
Usage of gpg_export
lookup:
- hosts: webservers
tasks:
- import_role:
name: znerol.gpg_export
- name: Publish GPG keys on webserver
loop:
- "[email protected]"
- "[email protected]"
- "[email protected]"
- "[email protected]"
- "äëöüï@example.org"
- "[email protected]"
copy:
content: "{{ lookup('gpg_export', item, armor=True, match='exact_uid') }}"
dest: "/var/www/{{ item }}.asc"
See test/test.yml for sample input/output.
License
MIT