设为首页 收藏本站
查看: 1077|回复: 0

[经验分享] 【Ansible 文档】【译文】配置文件

[复制链接]

尚未签到

发表于 2018-1-2 15:27:56 | 显示全部楼层 |阅读模式
  这里说明一下配置文件的内容,原文地址:http://docs.ansible.com/ansible/latest/intro_configuration.html
  这个与【Ansible 文档】配置 不一样,【Ansible 文档】配置 包含的是内容网址,而且其说明配置的方式和此处介绍的不一样。
  这里说明的配置是配置文件: ansible.cfg

Configuration file 配置文件
  Configuration file


  • Getting the latest configuration
  • Environmental configuration
  • Explanation of values by section

    • General defaults

      • action_plugins
      • allow_unsafe_lookups
      • allow_world_readable_tmpfiles
      • ansible_managed
      • ask_pass
      • ask_sudo_pass
      • ask_vault_pass
      • bin_ansible_callbacks
      • callback_plugins
      • callback_whitelist
      • command_warnings
      • connection_plugins
      • deprecation_warnings
      • display_args_to_stdout
      • display_skipped_hosts
      • error_on_undefined_vars
      • executable
      • filter_plugins
      • force_color
      • force_handlers
      • forks
      • fact_caching
      • fact_caching_connection
      • fact_caching_timeout
      • fact_path
      • gathering
      • hash_behaviour
      • hostfile
      • host_key_checking
      • internal_poll_interval
      • inventory
      • inventory_ignore_extensions
      • jinja2_extensions
      • library
      • local_tmp
      • log_path
      • lookup_plugins
      • merge_multiple_cli_tags
      • module_lang
      • module_name
      • module_set_locale
      • module_utils
      • nocolor
      • nocows
      • pattern
      • poll_interval
      • private_key_file
      • remote_port
      • remote_tmp
      • remote_user
      • retry_files_enabled
      • retry_files_save_path
      • roles_path
      • squash_actions
      • stdout_callback
      • strategy_plugins
      • strategy
      • sudo_exe
      • sudo_flags
      • sudo_user
      • system_warnings
      • timeout
      • transport
      • vars_plugins
      • vault_password_file

    • Privilege Escalation Settings

      • become
      • become_method
      • become_user
      • become_ask_pass
      • become_allow_same_user

    • Paramiko Specific Settings

      • record_host_keys
      • proxy_command

    • OpenSSH Specific Settings

      • ssh_args
      • control_path
      • control_path_dir
      • retries
      • scp_if_ssh
      • pipelining
      • ssh_executable

    • Accelerated Mode Settings

      • accelerate_port
      • accelerate_timeout
      • accelerate_connect_timeout
      • accelerate_daemon_timeout
      • accelerate_multi_key

    • Selinux Specific Settings

      • special_context_filesystems
      • libvirt_lxc_noseclabel
      • show_custom_stats

    • Galaxy Settings

      • server
      • ignore_certs


  Ansible中的某些配置可以通过配置文件调整。现有的配置在大多数情况下对于大多数用户都是足够的,但是在一些某些原因下,用户还是需要自行修改这些配置文件
  配置文件中的配置修改和应用会按照如下的优先级顺序处理:
  

* ANSIBLE_CONFIG (an environment variable)  

* ansible.cfg (in the current directory)  

* .ansible.cfg (in the home directory)  

* /etc/ansible/ansible.cfg  

  Ansible 1.5之前是:
  

* ansible.cfg (in the current directory)  

* ANSIBLE_CONFIG (an environment variable)  

* .ansible.cfg (in the home directory)  

* /etc/ansible/ansible.cfg  

  Ansible会按照上述列表顺序查找,第一个配置文件将被使用。不会合并所有列表文件的内容。

  注意:
  配置文件是ini格式的变种,当在行的首部注释时,可以通过 “#” 或者“;”。如果是在行中注释,只能用分号“;”,如下所示:
  

# some basic default values...  
inventory
= /etc/ansible/hosts  ; This points to the file that lists your hosts  



Getting the latest configuration 获取最新的配置
  如果你使用包管理器安装,最新的ansible.cfg会在/etc/ansible/目录中,并且命名为 ”.rpmnew”,也可能根据不同的更新命名为其它名称
  如果你是通过 pip 或者其他方式安装,则可能需要自行创建这个文件,为了覆写Ansible中的默认配置。
  你可以查看 ansible.cfg in source control来查看最新的配置模版,以及各个参数可能的值。

Environmental configuration 环境配置
  Ansible同样支持通过环境变量配置。如果这些环境变量被设置,他们会覆写任何从配置文件中获得的配置。这些变量可以定义在: constants.py
  可以查看 http://docs.ansible.com/ansible/latest/config.html 中的内容,里面有环境变量设置部分。

Explanation of values by section 按照section来解释配置
  配置文件被分解为不同的section,大部分选项在default section,同时有些section特定一些连接插件的。
  详细配置说明略。

General defaults

Privilege Escalation Settings

Paramiko Specific Settings

OpenSSH Specific Settings

Accelerated Mode Settings

Selinux Specific Settings

Galaxy Settings

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-430849-1-1.html 上篇帖子: Ansible介绍/安装/入门 下篇帖子: ansible批量部署tomcat
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表