I'd recommend any time you need to use escape characters, that you use
single quotes around the value, instead of double quotes.  It will resolve
many of the issues with how pyyaml does it's parsing

On Thu, Mar 21, 2019 at 12:04 PM John Harmon <jharmon.ansi...@gmail.com>
wrote:

>
> Sorry, last error message is slightly innaccurate.... I was testing a
> change in that one (difference is brackets [ ]):
>
> TASK [dns_update : include_tasks]
> ********************************************************************************************************************************************************************************************************
> fatal: [ansible-ub18]: FAILED! => {"reason": "Syntax Error while loading
> YAML.\n  found unknown escape character\n\nThe error appears to have been
> in '/etc/ansible/role/dns_update/tasks/Ubuntu18.yml': line 7, column 15,
> but may\nbe elsewhere in the file depending on the exact syntax
> problem.\n\nThe offending line appears to be:\n\n    regexp:
> \".*nameservers.*$\\n.*addresses:(.*$)\"\n    replace: \"\\1 {{ dns1 }}, {{
> dns 2}}\"\n              ^ here\nWe could be wrong, but this one looks like
> it might be an issue with\nmissing quotes.  Always quote template
> expression brackets when they\nstart a value. For instance:\n\n
>  with_items:\n      - {{ foo }}\n\nShould be written as:\n\n
>  with_items:\n      - \"{{ foo }}\"\n"}
>
>
> --
> 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 ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/85332d11-9309-4182-8d94-c47a1c1cc6a9%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/85332d11-9309-4182-8d94-c47a1c1cc6a9%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Matt Martz
@sivel
sivel.net

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAD8N0v-GBSyFBAcsv2SnVtY69eghYpeXc5e5A2v%3Deu7MZ62Rvg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to