On 23.07.2019 11:25, MKPhil wrote:
I've got a Playbook that uses a lookup plugin to retrieve a value but I
seem to have a string templating issue.

This is my playbook:

---
- name: retrieve password
  hosts: localhost
  gather_facts: no

  vars:
    vmware_user: "SOMEUSER"

    # This Doesn't work:
vmware_password: "{{ lookup('cyberarkpassword', AppID='myapp', Query='address=mydomain.corp;username={{ vmware_user }}', Output='Password').password }}"

You are already in template mode so you can't use {{ }} inside {{ }}.
You need to use string concatenation with tilde, so I think this should work.

vmware_password: "{{ lookup('cyberarkpassword', AppID='myapp', Query='address=mydomain.corp;username=' ~ vmware_user, Output='Password').password }}"


--
Kai Stian Olstad

--
You received this message because you are subscribed to the Google Groups "Ansible 
Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/308e9aad3096c9f5c3632629d340e584%40olstad.com.

Reply via email to