ansible 调优


1.设置ssh长链接
ssh_args = -C -o ControlMaster=auto -o ControlPersist=5d

2.开启pipelining
开启pipelining 需要被控制机器/etc/sudoers文件编辑当前ansible SSH用户的配置为 requiretty。否则在执行ansible的时候会提示sudo: you must have a tty to run sudo

pipelining = True

3. 开启accelerate 模式
注意: 开启accelerate模式,需要在ansible中控机与远端机器都安装python-keyczar 软件包。

[accelerate]
accelerate_port = 5099
accelerate_timeout = 30
accelerate_connect_timeout = 5.0

4.设置facts缓存

[defaults]
gathering = smart
fact_caching = jsonfile
fact_caching_connection = /path/to/cachedir
fact_caching_timeout = 86400

猜你喜欢

转载自www.cnblogs.com/heaven-xi/p/10418257.html
今日推荐