znerol.wkd_gpg
Ansible Role: WKD
This role helps export GPG keys into a Web Key Directory structure.
Requirements
You need Python 3 on the machine that runs Ansible.
Required Role Variables
wkd_gpg_uids
: A list of GPG uids that you want to export. The playbook will go through this list using the variablewkd_gpg_uid
.wkd_basedir
: The directory where the keys will be exported. Usually, this should be set to the document root of your web server.
Optional Role Variables
wkd_method
: Can bedirect
oradvanced
(refer to the Key Discovery section in the draft standard). The default value isadvanced
.wkd_gpg_export_dest
: The path where the GPG keys will be exported. By default, this is a templated string, which you can find in defaults/main.yml.wkd_gpg_export_params
: Extra parameters that will be sent to the znerol.gpg_export lookup plugin. Thehomedir
parameter is particularly useful to set the gnupg home to a directory with a version-controlled public keyring and no private keys.
Dependencies
Example Playbook
Here’s how to use the znerol.wkd_gpg
role:
- hosts: localhost
vars:
wkd_gpg_uids:
- "[email protected]"
- "[email protected]"
- "[email protected]"
- "[email protected]"
- "äëöüï@example.org"
- "[email protected]"
wkd_basedir: "/var/www"
tasks:
- name: Import the role znerol.wkd_gpg
import_role:
name: znerol.wkd_gpg
License
MIT