Ansible 如何从需要Anbile认证的网站获取数据?

Ansible 如何从需要Anbile认证的网站获取数据?,ansible,python-module,Ansible,Python Module,我一直在尝试登录一个网页,并从那里获取/下载一些特定数据,但未能成功。可能吗 如果您需要下载特定的文件,并且可以通过获取该文件,则可以使用get_url模块: - name: < Fetch file that requires authentication. get_url: url: http://example.com/path/file.conf dest: /etc/foo.conf url_username: bar url_password

我一直在尝试登录一个网页,并从那里获取/下载一些特定数据,但未能成功。可能吗

如果您需要下载特定的文件,并且可以通过获取该文件,则可以使用get_url模块:

- name: < Fetch file that requires authentication.
  get_url:
    url: http://example.com/path/file.conf
    dest: /etc/foo.conf
    url_username: bar
    url_password: '{{ mysecret }}'
-name:

如果您需要任意身份验证,为什么不用普通的python/bash编写并使用Ansible触发脚本,这样您就不会受到Ansible身份验证支持的限制


网站使用什么样的身份验证?Ansible支持几种不同的身份验证方法,包括基本身份验证