我正在使用ansible来使用azure_rm_deployment模块部署azure模板。模板可以内联提供,也可以通过template_link参数提供。我想提供模板作为指向bitbucket accoount中的文件的链接。
这就是我所拥有的:
- name: Install everything
hosts: localhost
vars_files: [my-vars.yaml]
tasks:
- name: Deploy the installation template
azure_rm_deployment:
state: present
subscription_id: "{{subscription_id}}"
tenant: "{{tenant}}"
client_id: "{{client_id}}"
secret: "{{secret}}"
resource_group_name: "{{rg}}"
location: "{{location}}"
template_link: "{{template_link}}"
如何验证https链接?如果我将用户名和密码放在URL中:
template_link: "https://azuremanager%40mycompany.com:mypassword@bitbucket.org/azuremanager/ansible/downloads/install-all.txt"
我从ansible收到错误:
"Deployment failed with status code: 400 and message: Deployment template parse failed: 'Unexpected character encountered while parsing value: <. Path '', line 0, position 0.'."
这是因为我被重定向到登录页面,而ansible正在接收该HTML而不是预期的json。如何提供安全的template_links?有没有办法让ansible跟随重定向?或者只是为模板使用一个模糊的URL?