I have a scenario where I have the following encrypted variable in my inventory.yml
vars:
username: admin
password: !vault |
$ANSIBLE_VAULT;1.2;AES256;dev
30613233633461343837653833666333643061636561303338373661313838333565653635353162
3263363434623733343538653462613064333634333464660a663633623939393439316636633863
61636237636537333938306331383339353265363239643939666639386530626330633337633833
6664656334373166630a363736393262666465663432613932613036303963343263623137386239
6330
And in my role tasks main.yml
- name: Create a JIRA issue
uri:
url: https://your.jira.example.com/rest/api/2/issue/
user: "{{ username }}"
password: "{{ password }}"
method: POST
body: "{{ lookup('file','issue.json') }}"
force_basic_auth: yes
status_code: 201
body_format: json
However, the URI module doesn't decrypt the vault variable. Is there a way we can decrypt a specific variable from within a file?
I am using Ansible version 2.8
.