Ansible—— 20. get_url模块

用于将文件或软件从http、https或ftp下载到本地节点上

1. 参数

dest: 指定将文件下载的绝对路径—必须
url: 文件的下载地址(网址)—必须
url_username: 用于http基本认证的用户名
url_password: 用于http基本认证的密码
validate_certs: 如果否,SSL证书将不会验证。这只应在使用自签名证书的个人控制站点上使用
owner: 指定属主
group: 指定属组
mode: 指定权限

2. 示例

示例1

[admin@node1 ~]$ ansible NFS -m get_url -a "url=http://nginx.org/download/nginx-1.12.2.tar.gz dest=/tmp/"

示例2

- name: install_from_source | download php file
  get_url: url={{ php_file_url }} dest={{ software_files_path }} validate_certs=no
  when: not php_file_result.stat.exists

————Blueicex 2020/2/1 14:50 [email protected]

你可能感兴趣的:(Ansible,linux)