community.general.keyring – grab secrets from the OS keyring
From Get docs
Ansible/docs/2.11/collections/community/general/keyring lookup
community.general.keyring – grab secrets from the OS keyring
Note
This plugin is part of the community.general collection (version 2.0.1).
To install it use: ansible-galaxy collection install community.general
.
To use it in a playbook, specify: community.general.keyring
.
Synopsis
- Allows you to access data stored in the OS provided keyring/keychain.
Requirements
The below requirements are needed on the local controller node that executes this lookup.
- keyring (python library)
Examples
- name : output secrets to screen (BAD IDEA)
ansible.builtin.debug:
msg: "Password: {{item}}"
with_community.general.keyring:
- 'servicename username'
- name: access mysql with password from keyring
mysql_db: login_password={{lookup('community.general.keyring','mysql joe')}} login_user=joe
Return Values
Common return values are documented here, the following are the fields unique to this lookup:
Key | Returned | Description |
---|---|---|
_raw list / elements=string |
success |
Secrets stored.
|
Authors
- Samuel Boucher (!UNKNOWN) <[email protected]>
© 2012–2018 Michael DeHaan
© 2018–2021 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.11/collections/community/general/keyring_lookup.html