ansible / ansible.builtin / v2.6.2 / lookup / passwordstore manage passwords with passwordstore.org's pass utility | "added in version" 2.3 of ansible.builtin" Authors: Patrick Deelman <patrick@patrickdeelman.nl>ansible.builtin.passwordstore (v2.6.2) — lookup
pip
Install with pip install ansible==2.6.2
Enables Ansible to retrieve, create or update passwords from the passwordstore.org pass utility. It also retrieves YAML style keys stored as multilines in the passwordfile.
# Debug is used for examples, BAD IDEA to show passwords on screen - name: Basic lookup. Fails if example/test doesn't exist debug: msg="{{ lookup('passwordstore', 'example/test')}}"
- name: Create pass with random 16 character password. If password exists just give the password debug: var=mypassword vars: mypassword: "{{ lookup('passwordstore', 'example/test create=true')}}"
- name: Different size password debug: msg="{{ lookup('passwordstore', 'example/test create=true length=42')}}"
- name: Create password and overwrite the password if it exists. As a bonus, this module includes the old password inside the pass file debug: msg="{{ lookup('passwordstore', 'example/test create=true overwrite=true')}}"
- name: Return the value for user in the KV pair user, username debug: msg="{{ lookup('passwordstore', 'example/test subkey=user')}}"
- name: Return the entire password file content set_fact: passfilecontent="{{ lookup('passwordstore', 'example/test returnall=true')}}"
_terms: description: query key required: true create: default: 'no' description: flag to create the password type: bool length: default: 16 description: password length type: integer subkey: default: password description: subkey to return userpass: description: user password directory: description: directory of the password store env: - name: PASSWORD_STORE_DIR overwrite: default: 'no' description: flag to overwrite the password type: bool returnall: default: 'no' description: flag to return all the contents of the password store type: bool passwordstore: default: ~/.password-store description: location of the password store
_raw: description: - a password