我想从ansible.cfg配置文件禁用 SSL 验证。
get_url模块中存在类似的东西,但来自 Ansible 配置文件。
parameter : validate_certs: no
Run Code Online (Sandbox Code Playgroud)
例子:
- name: Download JBoss without proxy
get_url:
url: "{{jboss_eap_7_3_4_download_url}}"
url_username: "{{repo_user}}"
url_password: "{{repo_token}}"
dest: "{{jboss_archive}}"
validate_certs: no
# ^-- something similar to this parameter
when: proxy is not defined or proxy == None
Run Code Online (Sandbox Code Playgroud)
小智 5
您无法对 ansible.cfg 中的所有任务禁用认证验证。这是因为 ansible.cfg 用于配置 Ansible,每个模块都有自己的建立 HTTP 连接的方式。
但是,您可以使用module_defaults应用于validate_certs: false所有get_url任务。