我的剧本里有这样的内容:
- name: Add Glusterfs APT Repository
become: yes
become_method: sudo
environment:
http_proxy: http://192.168.42.250:3128/
https_proxy: http://192.168.42.250:3128/
apt_repository:
repo: ppa:gluster/glusterfs-7
state: present但我得到了:
fatal: [192.168.42.105]: FAILED! => {"changed": false, "msg": "failed to fetch PPA information, error was: Request failed: <urlopen error timed out>"}
fatal: [192.168.42.103]: FAILED! => {"changed": false, "msg": "failed to fetch PPA information, error was: Request failed: <urlopen error timed out>"}
fatal: [192.168.42.102]: FAILED! => {"changed": false, "msg": "failed to fetch PPA information, error was: Request failed: <urlopen error timed out>"}
fatal: [192.168.42.104]: FAILED! => {"changed": false, "msg": "failed to fetch PPA information, error was: Request failed: <urlopen error timed out>"}
fatal: [192.168.42.107]: FAILED! => {"changed": false, "msg": "failed to fetch PPA information, error was: Request failed: <urlopen error timed out>"}
fatal: [192.168.42.101]: FAILED! => {"changed": false, "msg": "failed to fetch PPA information, error was: Request failed: <urlopen error timed out>"}
fatal: [192.168.42.106]: FAILED! => {"changed": false, "msg": "failed to fetch PPA information, error was: Request failed: <urlopen error timed out>"}发生这种情况是因为代理需要很长时间才能响应。这是因为我无法更改通过公司组策略应用的DNS设置。
我能以某种方式增加超时时间吗?
后续工作-解决方法
我把它用来解决这个问题:
- name: Receive Glusterfs key
become: yes
become_method: sudo
environment:
http_proxy: http://192.168.42.250:3128/
https_proxy: http://192.168.42.250:3128/
command: apt-key adv --keyserver keyserver.ubuntu.com --keyserver-options http-proxy=http://192.168.42.250:3128/ --recv-keys f7c73fcc930ac9f83b387a5613e01b7b3fe869a9
- name: Add Glusterfs APT Repository
become: yes
become_method: sudo
apt_repository:
repo: deb http://ppa.launchpad.net/gluster/glusterfs-7/ubuntu xenial main
state: present
- name: Add Glusterfs APT Repository (source)
become: yes
become_method: sudo
apt_repository:
repo: deb-src http://ppa.launchpad.net/gluster/glusterfs-7/ubuntu xenial main
state: present不过,这看起来有点像一个肮脏的黑客技巧。这是我的具体问题的解决方案吗?
发布于 2019-11-20 04:53:10
只需添加until/retries/delay和at就足够了。
https://stackoverflow.com/questions/58930106
复制相似问题