Hi Stephen,

On Wed, 23 Oct 2019 01:51:26 -0700 (PDT)
Stephen Feyrer <[email protected]> wrote:

>     - name: my-script
>       script: My-Script.ps1 -svc_password '{{ vault_password }}'
> 
> and
>     - name: my-script
>       script: My-Script.ps1 -svc_password "{{ vault_password }}"

Quoting from *Gotchas*: "If your value starts with a quote the entire value
must be quoted, not just part of it..."
https://docs.ansible.com/ansible/latest/reference_appendices/YAMLSyntax.html#gotchas

Correct syntax is

    - name: my-script
      script: 'My-Script.ps1 -svc_password {{ vault_password }}'

and
    - name: my-script
      script: "My-Script.ps1 -svc_password {{ vault_password }}"

>     - name: my-script
>       script: My-Script.ps1 -svc_password {{ 'vault_password' }}
> 
> This worked, I'll admit, I'm a little surprised...

I'm surprised too. In my case

    - script: my-script.sh {{ 'vault_password' }}
      register: result

the result was

    ok: [localhost] => {
    "result.stdout": "vault_password\n"
    }

Cheers,

        -vlado

-- 
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/20191023113206.5c4eb60d%40gmail.com.

Attachment: pgpU7QUoosMXz.pgp
Description: OpenPGP digital signature

Reply via email to