【Ansible】使用get_url时报错(urlopen error [Errno -2] )

问题遇到的现象和发生背景
Jenkins的docker容器里安装了ansible。实验用get_url模块下载一个文件放到指定文件夹。
URL是https的时候,可以下载到文件。可是http的时候,报错。是不可以用http吗?如果想用http的时候应该怎么办?


报错的playbook.yml文件内容

运行结果

[root@01c75ce9d4b0 ansibleTest]# ansible-playbook playbook.yml
[DEPRECATION WARNING]: Ansible will require Python 3.8 or newer on the controller starting with Ansible 2.12. Current version: 3.6.8 (default, Nov 16 2020, 16:55:22) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)]. This
feature will be removed from ansible-core in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
/usr/local/lib/python3.6/site-packages/ansible/parsing/vault/init.py:44: CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography and will be removed in a future release.
from cryptography.exceptions import InvalidSignature
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'
PLAY [localhost]
TASK [Gathering Facts]
ok: [localhost]
TASK [download bind]
fatal: [localhost]: FAILED! => {"changed": false, "dest": "/var/jenkins_home/workspace/ansibleTest/copyTo/", "elapsed": 10, "gid": 0, "group": "root", "mode": "0777", "msg": "Request failed: <urlopen error [Errno -2] Name or service not known>", "owner": "root", "size": 4096, "state": "directory", "uid": 0, "url": "http://ja.wordpress.org/wordpress-3.5.2-ja.zip%22}
PLAY RECAP
localhost : ok=1 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0


正常的playbook.yml文件内容

**运行结果 **

TASK [download bind]
changed: [localhost]