企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
用途: 用于将文件或软件从http、https或ftp下载到本地节点上 常用参数: dest: 指定将文件下载的绝对路径---必须 url: 文件的下载地址(网址)---必须 url_username: 用于http基本认证的用户名 url_password: 用于http基本认证的密码 validate_certs: 如果否,SSL证书将不会验证。这只应在使用自签名证书的个人控制站点上使用 owner: 指定属主 group: 指定属组 mode: 指定权限 案例: ~~~ [admin@node1 ~]$ ansible NFS -m get_url -a "url=http://nginx.org/download/nginx-1.12.2.tar.gz dest=/tmp/" 192.168.20.136 | SUCCESS => { "changed": true, "checksum_dest": null, "checksum_src": "6b41d63befa4f52b0724b533e6292a6671b71fdc", "dest": "/tmp/nginx-1.12.2.tar.gz", "gid": 1010, "group": "admin", "md5sum": "4d2fc76211435f029271f1cf6d7eeae3", "mode": "0664", "msg": "OK (981687 bytes)", "owner": "admin", "secontext": "unconfined_u:object_r:user_tmp_t:s0", "size": 981687, "src": "/tmp/tmpk78fBY", "state": "file", "status_code": 200, "uid": 1010, "url": "http://nginx.org/download/nginx-1.12.2.tar.gz" } ~~~ 案例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 ~~~