zoukankan      html  css  js  c++  java
  • ansible 优化相关

    [default]
    callback_whitelist = profile_tasks
    # The best way I’ve found to time the execution of Ansible playbooks is by enabling the profile_tasks callback. This callback is included with Ansible and all you need to do to enable it is add callback_whitelist = profile_tasks to the [defaults] section of your ansible.cfg:
    
    [ssh_connection] 
    ssh_args = -o ControlMaster=auto -o ControlPersist=60s
    #The first thing to check is whether SSH multiplexing is enabled and used. This gives a tremendous speed boost because Ansible can reuse opened SSH sessions instead of negotiating new one (actually more than one) for every task. Ansible has this setting turned on by default. It can be set in configuration file as follows:
    
    [ssh_connection]
    pipelining = True
    # You can enable pipelining by simply adding pipelining = True to the [ssh_connection]area of your ansible.cfg or by by using the ANSIBLE_PIPELINING and ANSIBLE_SSH_PIPELINING environment variables.
    
    [defaults]
    strategy_plugins = /path/to/mitogen-0.2.5/ansible_mitogen/plugins/strategy
    strategy = mitogen_linear
    # Enabling Mitogen for Ansible is as simple as downloading and extracting the plugin, then adding 2 lines to the [defaults] section of your ansible.cfg
    
    [ssh_connection]
    ssh_args = -o ControlMaster=auto -o ControlPersist=60s -o PreferredAuthentications=publickey
    #PreferredAuthentications  It is an SSH-client setting which informs server about preferred authentication methods. By default Ansible uses: -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey
    
    [defaults]
    forks = 20
    
    [defaults]
    internal_poll_interval = 0.001
    #When module is executed on remote host, Ansible starts to poll for its result. The lower is interval between poll attempts, the higher is CPU load on Ansible control host. But we want to have CPU available for greater forks number (see above). You can tweak poll interval in  ansible.cfg
    
    gathering = smart
    fact_caching_timeout = 86400
    fact_caching = jsonfile
    fact_caching_connection = /dev/shm/ansible_fact_cache
     

  • 相关阅读:
    postman环境和全局变量设置语句
    2016 GitHub章鱼猫观察报告之开源统计
    Multiload-ng
    忠告初学者学习Linux系统的8点建议
    真有用?Snap和Flatpak 通吃所有发行版的打包方式。
    教你如何在Kali Linux 环境下设置蜜罐?
    下一代GNU/Linux显示服务Wayland 1.12正式发布
    为 Github 创造 Integration
    简单易懂的crontab设置工具集
    爆料喽!!!开源日志库Logger的剖析分析
  • 原文地址:https://www.cnblogs.com/morse/p/13925028.html
Copyright © 2011-2022 走看看