美文网首页
ansible配置文件解析

ansible配置文件解析

作者: carey_ff72 | 来源:发表于2017-06-02 15:57 被阅读0次

    文章来自于:ansible配置文件解析

    ansible配置文件只有一个,即ansible.cfg
    ansible.cfg配置文件可以存在于多个地方,ansible读取配置文件的顺序依次是当前命令执行目录 -> 用户家目录下的.ansible.cfg -> /etc/ansible/ansible.cfg

    defaults

    [defaults]
    
    #inventory      = /etc/ansible/hosts   //定义Inventory
    #library        = /usr/share/my_modules/  //自定义lib库存放目录 
    #remote_tmp     = ~/.ansible/tmp       //零时文件远程主机存放目录
    #local_tmp      = ~/.ansible/tmp       //零时文件本地存放目录
    #forks          = 5                    //默认开启的并发数
    #poll_interval  = 15                   //默认轮询时间间隔
    #sudo_user      = root                 //默认sudo用户
    #ask_sudo_pass = True                  //是否需要sudo密码
    #ask_pass      = True                  //是否需要密码
    #host_key_checking = False             //首次连接是否检查key认证
    #roles_path    = /etc/ansible/roles    //默认下载的Roles存放的目录
    #log_path = /var/log/ansible.log       //执行日志存放目录
    #module_name = command                 //默认执行的模块
    #action_plugins     = /usr/share/ansible/plugins/action //action插件存放目录
    #callback_plugins   = /usr/share/ansible/plugins/callback //callback插件存放目录
    #connection_plugins = /usr/share/ansible/plugins/connection  //connection插件存放目录
    #lookup_plugins     = /usr/share/ansible/plugins/lookup //lookup插件存放目录
    #vars_plugins       = /usr/share/ansible/plugins/vars //vars插件存放目录
    #filter_plugins     = /usr/share/ansible/plugins/filter //filter插件存放目录
    #test_plugins       = /usr/share/ansible/plugins/test //test插件存放目录
    #strategy_plugins   = /usr/share/ansible/plugins/strategy //strategy插件存放目录
    #fact_caching = memory                 //getfact缓存的主机信息存放方式
    #retry_files_enabled = False              
    #retry_files_save_path = ~/.ansible-retry  //错误重启文件存放目录
    

    privilege_escalation

    [privilege_escalation]
    #become=True            //是否sudo
    #become_method=sudo     //sudo方式
    #become_user=root       //sudo后变为root用户
    #become_ask_pass=False  //sudo后是否验证密码
    

    paramiko_connection

    [paramiko_connection]
    #record_host_keys=False //不记录新主机的key以提升效率
    #pty=False              //禁用sudo功能
    

    ssh_connection

    [ssh_connection]
    #pipelining = False   //管道加速功能,需配和requiretty使用方可生效
    

    selinux

    [selinux]
    #libvirt_lxc_noseclabel = yes  //selinux配置
    

    colors

    [colors]
    #highlight = white
    #verbose = blue
    #warn = bright purple
    #error = red
    #debug = dark gray
    #deprecate = purple
    #skip = cyan
    #unreachable = red
    #ok = green
    #changed = yellow
    #diff_add = green
    #diff_remove = red
    #diff_lines = cyan
    

    文章来自于 carey的博客 :ansible配置文件解析

    相关文章

      网友评论

          本文标题:ansible配置文件解析

          本文链接:https://www.haomeiwen.com/subject/nnsufxtx.html