这里说明一下配置文件的内容,原文地址:http://docs.ansible.com/ansible/latest/intro_configuration.html

这个与【Ansible 文档】配置 不一样,【Ansible 文档】配置 包含的是内容网址,而且其说明配置的方式和此处介绍的不一样。

这里说明的配置是配置文件: ansible.cfg

Configuration file 配置文件

Configuration file

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 文档】【译文】配置文件的更多相关文章

  1. 【转】Python之xml文档及配置文件处理(ElementTree模块、ConfigParser模块)

    [转]Python之xml文档及配置文件处理(ElementTree模块.ConfigParser模块) 本节内容 前言 XML处理模块 ConfigParser/configparser模块 总结 ...

  2. 【Ansible 文档】【译文】Playbooks 变量

    Variables 变量 自动化的存在使得重复的做事情变得很容易,但是我们的系统不可能完全一样. 在某些系统中,你可能想要设置一些与其他系统不一样的行为和配置. 同样地,远程系统的行为和状态也可以影响 ...

  3. 【Ansible 文档】【译文】Ad-Hoc 命令介绍

    Introduction To Ad-Hoc Commands Ad-Hoc命令介绍 下面的例子展示了如何使用 /usr/bin/ansible 来运行ad hoc任务. 什么是ad hoc命令? 一 ...

  4. 【Ansible 文档】【译文】入门教程

    http://docs.ansible.com/ansible/latest/intro_getting_started.html Foreword 前言 到这里,你应该已经安装了Ansible,是时 ...

  5. 【Ansible 文档】【译文】常见问题

    http://docs.ansible.com/ansible/latest/faq.html 如何为一个task或者整个Playbook设置PATH或者任意其他环境变量? 通过environment ...

  6. 【Ansible 文档】【译文】网络支持

    Networking Support 网络支持 Working with Networking Devices 使用网络设备 自从Ansible 2.1开始,你现在可以使用成熟模型 - 编写 play ...

  7. 【Ansible 文档】【译文】Windows 支持

    see also:List of Windows Modules Windows Support Windows 支持 Windows: How Does It Work Windows:如何工作 正 ...

  8. Python之xml文档及配置文件处理(ElementTree模块、ConfigParser模块)

    本节内容 前言 XML处理模块 ConfigParser/configparser模块 总结 一.前言 我们在<中我们描述了Python数据持久化的大体概念和基本处理方式,通过这些知识点我们已经 ...

  9. 【Ansible 文档】【译文】主机清单文件

    Inventory 主机清单文件 Ansible 可以对你的基础设施中多个主机系统同时进行操作.通过选择在Ansible的inventory列出的一部分主机来实现.inventory默认保存在/etc ...

随机推荐

  1. POJ 1258 Agri-Net(Prim算法求解MST)

    题目链接: http://poj.org/problem?id=1258 Description Farmer John has been elected mayor of his town! One ...

  2. 祸害阿里云宕机 3 小时的 IO HANG 究竟是个什么鬼?!

    2019年3月3日凌晨,微博炸锅,有网友反映说阿里云疑似出现宕机,华北很多互联网公司受到暴击伤害,APP.网站全部瘫痪,我自己的朋友圈和微信群里也有好友反馈,刚刚从被窝被叫起来去修Bug,结果发现服务 ...

  3. golang中的接口实现(二)

    指针类型 vs 值类型实现接口 package main import ( "fmt" ) // 定义接口 type Describer interface { Describe( ...

  4. nehibernet .net注意事项

    1:xml属性:嵌入资源建立实体对象:public virtual int id{get;set;}建立与实体对象同名的xml文件,以.hbm.xml为扩展名2:StructureMap.config ...

  5. cloudera Manager使用总结

    最近在用cloudera Manager来 在几个虚拟机上进行hadoop 的安装,总结一下遇到的问题. 1   似乎没有  start-balancer.sh 命令 似乎安装包中没有这个命令  怎么 ...

  6. HDU3001(KB2-J 状态压缩dp)

    Travelling Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total ...

  7. Codeforces485D(SummerTrainingDay01-K)

    D. Maximum Value time limit per test:1 second memory limit per test:256 megabytes input:standard inp ...

  8. HTML5+CSS (简易nav设计)

    HTML部分: <!DOCTYPE html><html> <head> <title></title> <meta charset= ...

  9. ebook

    libgen.io onlybooks.org www.ebook3000.com www.foxebook.net

  10. 腾讯TBS X5 WebView的简单使用

    工作中经常涉及H5网页的加载工作,最多使用的就是安卓系统控件WebView,但是当网页内容比较多的时候,需要等待很久才能加载完,加载完后用户才能看到网页中的内容,这样用户需要等很久,体验很差. 那能不 ...