ansible.builtin.hashi_vault (v2.4.3.0-1) — lookup

retrieve secrets from HasihCorp's vault

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

Authors: Jonathan Davila <jdavila(at)ansible.com>

Install Ansible via pip

Install with pip install ansible==2.4.3.0.post1

Description

retrieve secrets from HasihCorp's vault


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- debug:
    msg: "{{ lookup('hashi_vault', 'secret=secret/hello:value token=c975b780-d1be-8016-866b-01d0f9b688a5 url=http://myvault:8200')}}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Return all secrets from a path
  debug:
    msg: "{{ lookup('hashi_vault', 'secret=secret/hello token=c975b780-d1be-8016-866b-01d0f9b688a5 url=http://myvault:8200')}}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Vault that requires authentication via LDAP
  debug:
      msg: "{{ lookup('hashi_vault', 'secret=secret/hello:value auth_method=ldap mount_point=ldap username=myuser password=mypas url=http://myvault:8200')}}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Using an ssl vault
  debug:
      msg: "{{ lookup('hashi_vault', 'secret=secret/hola:value token=c975b780-d1be-8016-866b-01d0f9b688a5 url=https://myvault:8200 validate_certs=False')}}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: using certificate auth
  debug:
      msg: "{{ lookup('hashi_vault', 'secret=secret/hi:value token=xxxx-xxx-xxx url=https://myvault:8200 validate_certs=True cacert=/cacert/path/ca.pem')}}"

Inputs

    
url:
    default: http://127.0.0.1:8200
    description: url to vault service
    env:
    - name: VAULT_ADDR

token:
    description: vault token
    env:
    - name: VAULT_TOKEN

cacert:
    description: path to certificate to use for authentication

secret:
    description: query you are making
    required: true

password:
    description: authentication password

username:
    description: authentication user name

auth_method:
    description: authentication method used

mount_point:
    default: ldap
    description: vault mount point, only required if you have a custom mount point

validate_certs:
    default: true
    description: controls verification and validation of SSL certificates, mostly you
      only want to turn off with self signed ones.
    type: boolean

Outputs

_raw:
  description:
  - secrets(s) requested