community.general.keyring (8.5.0) — lookup

grab secrets from the OS keyring

Authors: Samuel Boucher (!UNKNOWN) <boucher.samuel.c@gmail.com>

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

Allows you to access data stored in the OS provided keyring/keychain.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: output secrets to screen (BAD IDEA)
  ansible.builtin.debug:
    msg: "Password: {{item}}"
  with_community.general.keyring:
    - 'servicename username'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: access mysql with password from keyring
  community.mysql.mysql_db:
    login_password: "{{ lookup('community.general.keyring', 'mysql joe') }}"
    login_user: joe

Outputs

_raw:
  description: Secrets stored.
  elements: str
  type: list