Dave,
the double quotes should be around the full value of path. see
http://docs.ansible.com/ansible/latest/YAMLSyntax.html#gotchas

  - lineinfile:
        path: "/home/{{ new_user_acct_name }}/.ssh/authorized_keys"

regards, Zsolt

On Tue, Sep 19, 2017 at 6:12 PM, Dave Florek <dave.a.flo...@gmail.com>
wrote:

> Hi,
>
> I'm trying to see where I'm going wrong here:
>
> *Relevant code snippet:*
>
> - lineinfile:
>         path: /home/"{{ new_user }}"/.ssh/
>
>
> *Error message I get at execution:*
>
> ERROR! Syntax Error while loading YAML.
>
>
> The error appears to have been in 
> '/opt/ansible/setup_scripts/create_user.yml':
> line 20, column 1, but may
> be elsewhere in the file depending on the exact syntax problem.
>
>
> The offending line appears to be:
>
>
>   - lineinfile:
>         path: /home/"{{ new_user_acct_name }}"/.ssh/authorized_keys
> ^ here
> We could be wrong, but this one looks like it might be an issue with
> missing quotes.  Always quote template expression brackets when they
> start a value. For instance:
>
>
>     with_items:
>       - {{ foo }}
>
>
> Should be written as:
>
>
>     with_items:
>       - "{{ foo }}"
>
> Can someone point me in the right direction?
>
> Thanks,
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-devel+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to