rpm_key - Adds or removes a gpg key from the rpm db

New in version 1.3.

Synopsis

  • Adds or removes (rpm –import) a gpg key to your rpm database.

Options

parameter required default choices comments
key
yes
Key that will be modified. Can be a url, a file, or a keyid if the key already exists in the database.
state
no present
  • present
  • absent
If the key will be imported or removed from the rpm db.
validate_certs
no yes
  • yes
  • no
If no and the key is a url starting with https, SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates.

Examples

# Example action to import a key from a url
- rpm_key:
    state: present
    key: http://apt.sw.be/RPM-GPG-KEY.dag.txt

# Example action to import a key from a file
- rpm_key:
    state: present
    key: /path/to/key.gpg

# Example action to ensure a key is not present in the db
- rpm_key:
    state: absent
    key: DEADB33F

Status

This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.

Maintenance Info

For more information about Red Hat’s this support of this module, please refer to this knowledge base article<https://access.redhat.com/articles/rhel-top-support-policies>

For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Testing Ansible and Developing Modules.

© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.4/rpm_key_module.html