community.general.keyring (8.5.0) — module

Set or delete a passphrase using the Operating System's native keyring

| "added in version" 5.2.0 of community.general"

Authors: Alexander Hussey (@ahussey-redhat)

Install collection

Install with ansible-galaxy collection install community.general:==8.5.0


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

Description

This module uses the L(keyring Python library, https://pypi.org/project/keyring/) to set or delete passphrases for a given service and username from the OS' native keyring.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Set a password for test/test1
  community.general.keyring:
    service: test
    username: test1
    user_password: "{{ user_password }}"
    keyring_password: "{{ keyring_password }}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete the password for test/test1
  community.general.keyring:
    service: test
    username: test1
    user_password: "{{ user_password }}"
    keyring_password: "{{ keyring_password }}"
    state: absent

Inputs

    
state:
    choices:
    - present
    - absent
    default: present
    description: Whether the password should exist.
    required: false
    type: str

service:
    description: The name of the service.
    required: true
    type: str

username:
    description: The user belonging to the service.
    required: true
    type: str

user_password:
    aliases:
    - password
    description: The password to set.
    required: false
    type: str

keyring_password:
    description: Password to unlock keyring.
    required: true
    type: str