我有一个调用get_url
来下载文件的剧本但该网址包含反斜杠
http://cijboss:8080/jenkins/job/prod/186/org.myorg\$ear/artifact/org.org/ear/3.0.0-SNAPSHOT/ear-3.0.0-SNAPSHOT.ear"
我尝试过双引号,单引号,\转义序列等。尝试过在Jinja2和YAML中找到的很多东西都可以转义文件而且没有任何作用。当我通过ad hoc命令提供URL时,它会正确下载文件。
ansible <server> -m get_url -u user -a "http://cijboss:8080/jenkins/job/prod/186/org.myorg\$ear/artifact/org.org/ear/3.0.0-SNAPSHOT/ear-3.0.0-SNAPSHOT.ear" dest=/home/user"
每次播放剧本时,网址都包含一个双反斜杠。如何正确地逃避这个?
更新:下面是yml playbook文件。
---
- hosts: jboss
remote_user: jboss
tasks:
- name: Get Ear file
get_url: url="http://cijboss:8080/jenkins/job/prod/186/org.myorg\$ear/artifact/org.org/ear/3.0.0-SNAPSHOT/ear-3.0.0-SNAPSHOT.ear" dest=/home/jboss mode=0755
答案 0 :(得分:0)
你试过percent encode吗? - &GT; %5C
http://example.com/jenkins/../../domain%5C$project/../app.ear