ansible 命令需要很长时间才能执行

ansible 命令需要很长时间才能执行

我在 python 3.6.8 虚拟环境中使用 pip 安装了 ansible,一切正常,但偶尔所有 ansible 命令都需要很长时间才能执行,但随后相同命令的连续执行是即时的,但需要一段时间后才能再次看到

我在终端上没有看到任何错误,或者 /var/log/messages 系统负载也可以忽略不计,我在这里遗漏了什么?

(env1) [centos@linux1 ~]$ time ansible --version
ansible 2.8.0
  config file = /home/centos/ansible/ansible.cfg
  configured module search path = ['/home/centos/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/centos/env1/lib64/python3.6/site-packages/ansible
  executable location = /home/centos/env1/bin/ansible
  python version = 3.6.8 (default, Apr 25 2019, 21:02:35) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]

real    7m37.920s
user    0m1.719s
sys     0m0.088s


(env1) [centos@linux1 ~]$ time ansible --version
ansible 2.8.0
  config file = /home/centos/ansible/ansible.cfg
  configured module search path = ['/home/centos/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/centos/env1/lib64/python3.6/site-packages/ansible
  executable location = /home/centos/env1/bin/ansible
  python version = 3.6.8 (default, Apr 25 2019, 21:02:35) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]

real    0m1.660s
user    0m1.564s
sys     0m0.097s

是的,整整花了7分钟!!

这是我的设置细节

(env1) [centos@linux1 ~]$ python -V
Python 3.6.8
(env1) [centos@linux1 ~]$ pip list
Package      Version
------------ -------
ansible      2.8.0
asn1crypto   0.24.0
cffi         1.12.3
cryptography 2.6.1
Jinja2       2.10.1
MarkupSafe   1.1.1
pip          19.1.1
pycparser    2.19
PyYAML       5.1
setuptools   40.6.2
six          1.12.0
(env1) [centos@linux1 ~]$ which  ansible
~/env1/bin/ansible

任何指示都会有很大帮助,谢谢

相关内容