ansible.builtin.rpm_key (v2.8.20) — module

Adds or removes a gpg key from the rpm db

| "added in version" 1.3 of ansible.builtin"

Authors: Hector Acosta (@hacosta) <hector.acosta@gazzang.com>

preview | supported by core

Install Ansible via pip

Install with pip install ansible==2.8.20

Description

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

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Example action to import a key from a url
- rpm_key:
    state: present
    key: http://apt.sw.be/RPM-GPG-KEY.dag.txt
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Example action to import a key from a file
- rpm_key:
    state: present
    key: /path/to/key.gpg
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Example action to ensure a key is not present in the db
- rpm_key:
    state: absent
    key: DEADB33F

Inputs

    
key:
    description:
    - Key that will be modified. Can be a url, a file, or a keyid if the key already exists
      in the database.
    required: true

state:
    choices:
    - absent
    - present
    default: present
    description:
    - If the key will be imported or removed from the rpm db.

validate_certs:
    default: 'yes'
    description:
    - If C(no) and the C(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.
    type: bool