ansible执行慢排查

一般出现这种情况是刚部署完ansible,发现执行时间较长。可能原因:

  1. 搜集参数未关闭
# implicit - gather by default, turn off with gather_facts: False
# explicit - do not gather by default, must say gather_facts: True
#gathering = implicit
#下面关闭搜集参数
gathering = explicit
  1. ansible临时目录是默认,为了避免没有权限、时间超时等,可以改为/tmp
#默认是remote_tmp     =  ~/.ansible/tmp
remote_tmp     =  /tmp/.ansible/

转载于:https://my.oschina.net/u/3746745/blog/3068240

你可能感兴趣的:(python,shell)