Ansible Plugin - secret fetch via playbook using Ansible-playbook cli


pip install hvac

Create Playbook

In the below example the name of the secret is test.

# This playbook fetches a secret from Akeyless Vault
- name: Echo
  hosts: all
   - name: Fetching a secret named test from Akeyless Vault
      msg: "{{ lookup('hashi_vault', 'secret=secret/data/test:data') }}"

Set you Akeyless token in ~/.vault-token within your Ansible machine

Setting up Akeyless Vault:

export VAULT_ADDR=

Run Playbook

ansible-playbook -i <hostname>, -u ubuntu secret_fetch.yml

Did this page help you?