gpg_export

Ansible Role: GPG Export

Build Status

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 in PATH 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 to True.
  • export_options: List of options for the exported keys (see man 1 gpg).
  • match: One of default, 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

About

GnuPG public key lookup plugin

Install
ansible-galaxy install znerol/ansible-role-gpg-export
GitHub repository
License
mit
Downloads
440
Owner