mustaches don't stack!
you want:
"{{ lookup('file', 'public_ssh_keys/' + item + '.pub') }}"
On Fri, Oct 10, 2014 at 3:50 AM, Navid Paya <[email protected]> wrote:
> Hi all
> Not sure if this is even the right tile. So I have a set of SSH keys, I want
> to be used as authorized keys for users. I've put all of them in a directory
> and am trying to do the job but nothing happens. So I did some debugging.
> This is what I do when not using a variable:
>
> - name: Some debugging
> debug: msg="{{ lookup('file', 'public_ssh_keys/navid.pub') }}"
>
> And it returns what I expect. Now I try doing a loop:
>
> - name: Some debugging
> debug: msg="{{ lookup('file', 'public_ssh_keys/{{ item }}.pub') }}"
> with_items:
> - navid
>
> But this time it returns this:
>
> TASK: [base-ami | Some debugging]
> *********************************************
> ok: [default] => (item=navid) => {
> "item": "navid",
> "msg": ""
> }
>
> So how am I supposed to have it return what I expect? I think it's probably
> a matter of using the single and double quotes right but how?
>
> Regards
>
> Navid
>
> --
> 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 post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/733e3c63-80c1-4fba-bf72-e1ebca70e45b%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
--
Brian Coca
Stultorum infinitus est numerus
0110000101110010011001010110111000100111011101000010000001111001011011110111010100100000011100110110110101100001011100100111010000100001
Pedo mellon a minno
--
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/CADn%2BHsy8KTsp6xXUvAxu5p3nJGX2g-4qMQ2vDpY%2BBv%2B73q-19A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.