znerol.gpg_export

Ansible Role: GPG Export

Build Status

This role provides a tool to find GPG public keys.

Requirements

You need to have GnuPG installed on the control machine.

Optional Lookup Parameters

  • executable: This is the full path to the gpg program. By default, it is set to /usr/bin/gpg (for Ansible versions less than 2.7) or will be found automatically in the PATH variable (for Ansible version 2.7 and above).
  • homedir: Path to the GnuPG home directory (refer to man 1 gpg). By default, it uses GnuPG's standard directory (~/.gnupg).
  • armor: If set to produce ASCII armored output (refer to man 1 gpg). Default is True.
  • export_options: A list of settings for the exported keys (refer to man 1 gpg).
  • match: Determines how keys are matched to the specified UIDs. Options include default, exact_uid, exact_email, and partial_email. (refer to man 1 gpg)

Dependencies

None

Example Playbook

Here’s how to use the 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"

Check test/test.yml for examples of input and output.

License

MIT

Informazioni sul progetto

GnuPG public key lookup plugin

Installa
ansible-galaxy install znerol.gpg_export
Licenza
mit
Download
452
Proprietario