【Ansible 文档】【译文】配置文件
这里说明一下配置文件的内容,原文地址:http://docs.ansible.com/ansible/latest/intro_configuration.html
这个与【Ansible 文档】配置 不一样,【Ansible 文档】配置 包含的是内容网址,而且其说明配置的方式和此处介绍的不一样。
这里说明的配置是配置文件: ansible.cfg
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
- Paramiko Specific Settings
- OpenSSH Specific Settings
- Accelerated Mode Settings
- Selinux Specific Settings
- Galaxy Settings
- General defaults
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
【Ansible 文档】【译文】配置文件的更多相关文章
- 【转】Python之xml文档及配置文件处理(ElementTree模块、ConfigParser模块)
[转]Python之xml文档及配置文件处理(ElementTree模块.ConfigParser模块) 本节内容 前言 XML处理模块 ConfigParser/configparser模块 总结 ...
- 【Ansible 文档】【译文】Playbooks 变量
Variables 变量 自动化的存在使得重复的做事情变得很容易,但是我们的系统不可能完全一样. 在某些系统中,你可能想要设置一些与其他系统不一样的行为和配置. 同样地,远程系统的行为和状态也可以影响 ...
- 【Ansible 文档】【译文】Ad-Hoc 命令介绍
Introduction To Ad-Hoc Commands Ad-Hoc命令介绍 下面的例子展示了如何使用 /usr/bin/ansible 来运行ad hoc任务. 什么是ad hoc命令? 一 ...
- 【Ansible 文档】【译文】入门教程
http://docs.ansible.com/ansible/latest/intro_getting_started.html Foreword 前言 到这里,你应该已经安装了Ansible,是时 ...
- 【Ansible 文档】【译文】常见问题
http://docs.ansible.com/ansible/latest/faq.html 如何为一个task或者整个Playbook设置PATH或者任意其他环境变量? 通过environment ...
- 【Ansible 文档】【译文】网络支持
Networking Support 网络支持 Working with Networking Devices 使用网络设备 自从Ansible 2.1开始,你现在可以使用成熟模型 - 编写 play ...
- 【Ansible 文档】【译文】Windows 支持
see also:List of Windows Modules Windows Support Windows 支持 Windows: How Does It Work Windows:如何工作 正 ...
- Python之xml文档及配置文件处理(ElementTree模块、ConfigParser模块)
本节内容 前言 XML处理模块 ConfigParser/configparser模块 总结 一.前言 我们在<中我们描述了Python数据持久化的大体概念和基本处理方式,通过这些知识点我们已经 ...
- 【Ansible 文档】【译文】主机清单文件
Inventory 主机清单文件 Ansible 可以对你的基础设施中多个主机系统同时进行操作.通过选择在Ansible的inventory列出的一部分主机来实现.inventory默认保存在/etc ...
随机推荐
- [leetcode]238. 除自身以外数组的乘积
题目描述 给定长度为 n 的整数数组 nums,其中 n > 1,返回输出数组 output ,其中 output[i] 等于 nums 中除 nums[i] 之外其余各元素的乘积. 示例: 输 ...
- C#Redis初识
前面博客写了nginx负载均衡,大致了解了下nginx,不过这都是2016年的,2017年的计划也列了,重要的是执行,最近在看RabbitMQ和redis,由于今天和小伙伴们一起去聚餐了,回来的比较晚 ...
- C# Owin 创建与测试自己的中间件Middleware(二)
本文纯属介绍怎么简单地创建自己的Owin.还没有理解owin概念的请看上一篇文章:http://www.cnblogs.com/alunchen/p/7049307.html 目录 1.创建项目 2. ...
- javaer有福了,基于Web的mysql数据库管理工具TreeSoft发布了。
基于Web的数据库管理工具TreeSoft数据库管理系统发布快3年了,版本不断更快速迭代开发中,QQ群也积累了300多位粉丝,虽然时不时也掉粉,但总体还是增加中.大家虽然捐赠不多,但是苍蝇再小也是肉啊 ...
- 【Mybatis】XML配置实现增删改查
①创建数据库和表,数据库为mytest,表为users CREATE DATABASE mytest; USE mytest; DROP TABLE IF EXISTS users; CREATE T ...
- 一道很好的mysql面试练习题,having综合应用
写一条SQL语句,求出2门以及2门以上不及格的科目平均分 >要出现2门以及2门以上的学科不及格 >计算该考生所有学科的平均分,不单是,不及格的那几门 #创建表: create table ...
- Three.js开发指南---学习使用几何体(第五章)
一 基础几何体 1 二维图形:二维图形都是基于x和y轴构建的,即展示的形式就是他们都是“直立”的,如果希望这些二维图形躺下,则需要将几何体沿着x轴向后旋转1/4圈 mesh.rotation.x=-M ...
- Codeforces500C(SummerTrainingDay01-G)
C. New Year Book Reading time limit per test:2 seconds memory limit per test:256 megabytes input:sta ...
- 【 js 基础 】【 源码学习 】源码设计 (更新了backbone分析)
学习源码,除了学习对一些方法的更加聪明的代码实现,同时也要学习源码的设计,把握整体的架构.(推荐对源码有一定熟悉了之后,再看这篇文章) 目录结构:第一部分:zepto 设计分析 第二部分:unders ...
- 关于python操作带有中文文件名报错的解决办法
python代码的编码格式 #coding:utf-8 在操作文件时,如果文件名带有中文,则需要将文件路径以Unicode的编码格式进行操作 具体的方式如下 path = "你的 ...