https://github.com/znerol/ansible-role-gpg-export
GnuPG public key lookup plugin
https://github.com/znerol/ansible-role-gpg-export
Last synced: 17 days ago
JSON representation
GnuPG public key lookup plugin
- Host: GitHub
- URL: https://github.com/znerol/ansible-role-gpg-export
- Owner: znerol
- License: mit
- Created: 2019-03-07T09:03:55.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-03-08T17:32:06.000Z (about 7 years ago)
- Last Synced: 2025-03-22T05:43:48.144Z (about 1 year ago)
- Language: Python
- Size: 21.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Ansible Role: GPG Export
========================
[](https://travis-ci.org/znerol/ansible-role-gpg-export)
Provides GPG public key lookup plugin.
Requirements
------------
[GnuPG][1] 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 in `PATH` environment variable
(Ansible >= 2.7).
* `homedir`: Path to the gnupg home directory (see [man 1 gpg][2]). Defaults to
GnuPG default (`~/.gnupg`).
* `armor`: Produce ASCII armored output (see [man 1 gpg][2]). Defaults to `True`.
* `export_options`: List of options for the exported keys (see [man 1 gpg][2]).
* `match`: One of `default`, `exact_uid`, `exact_email`, `partial_email`,
specifying how keys are matched to the given uids. (see [man 1 gpg][2])
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:
- "Joe.Doe@Example.ORG"
- "joe.doe@Example.com"
- "test-wkd@example.org"
- "me@example.com"
- "äëöüï@example.org"
- "foo@example.com"
copy:
content: "{{ lookup('gpg_export', item, armor=True, match='exact_uid') }}"
dest: "/var/www/{{ item }}.asc"
See [test/test.yml](tests/test.yml) for sample input/output.
License
-------
MIT
[1]: https://www.gnupg.org/
[2]: https://www.gnupg.org/documentation/manpage.html