escaping a backslash in a playbook

799 views
Skip to first unread message

Ter Alexander

unread,
Feb 15, 2016, 10:31:31 AM2/15/16
to Ansible Project
I have a playbook that calls get_url to download a file BUT the URL contains a backslash

I have tried double quotes, single quotes, \ escape sequences, etc. Have tried the many things found in Jinja2 and YAML escaping documents and nothing works. When I feed the URL through an ad hoc command, it downloads the file just fine.

Each time the playbook runs, the url contains a double backslash. How does one properly escape this?

Update: Below is the yml playbook file.

    ---
    - hosts: jboss
      remote_user: jboss
    tasks:
      - name: Get Ear file

Matt Martz

unread,
Feb 15, 2016, 10:37:19 AM2/15/16
to ansible...@googlegroups.com
I think you probably want to url encode that instead of just trying to escape those characters.


--
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-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/c4750744-60f1-4c2c-af94-bc1f0d1a778d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Matt Martz
@sivel
sivel.net

Ter Alexander

unread,
Feb 15, 2016, 11:31:33 AM2/15/16
to Ansible Project
Thank you. I am still getting 404's on that URL when fed through the playbook. Was trying to exhaust all options before submitting a bug request. Any other ideas?

Christian Thiemann

unread,
Feb 19, 2016, 3:30:03 PM2/19/16
to Ansible Project
Are you using Ansible 2.0? If so, it might be related to this: https://github.com/ansible/ansible/issues/14172
Reply all
Reply to author
Forward
0 new messages