DevOps - 配置管理工具Ansible

配置管理工具

配置管理工具(SCM,Software Configuration Management)可以将代码、软件方式实现的基础设施配置信息保存,也可以根据需求变化反复进行变更。
相关工具包括Ansible、Chef、Puppe、SaltStack等,版本管理工具有Git、Subversion等。

  • 省时省力:通过自动化进行快速设置
  • 声明式:通过配置信息对当前配置对象的具体状态进行明确描述
  • 抽象化:配置信息能涵盖细微的环境差异
  • 收敛性:不管对象的状态如何,最终都会达到期望的状态
  • 幂等性:不管执行多少次,都能得到相同的结果

Ansible

Ansible是基于python语言开发的一种开源的自动化运维工具和平台,集合了众多运维工具的优点,实现了批量配置管理、批量应用部署和运行命令执行特定任务等功能。
Ansible基于SSH来和远程主机通讯,不需要在远程主机上安装client/agents。
Ansible只是提供一种框架,本身没有批量部署的能力。真正具有批量部署的是ansible所运行的模块。主要包括:

  • 连接插件connection plugins:负责和被监控端实现通信
  • host inventory:指定操作的主机,是一个配置文件里面定义监控的主机
  • 各种模块核心模块、command模块、自定义模块
  • 借助于插件完成记录日志邮件等功能
  • playbook:剧本执行多个任务时,非必需可以让节点一次性运行多个任务

官网与教程

原文地址:https://www.cnblogs.com/anliven/p/11823891.html

时间: 2024-10-10 07:19:42

DevOps - 配置管理工具Ansible的相关文章

[email protected]一个高效的配置管理工具--Ansible configure management--翻译(六)

无书面许可请勿转载 高级playbook Finding files with variables All modules can take variables as part of their arguments by dereferencing them with {{ and }} . You can use this to load a particular file based on a variable. For example, you might want to select a

[email protected]一个高效的配置管理工具--Ansible configure management--翻译(七)

如无书面授权,请勿转载 Larger Projects Until now, we have been looking at single plays in one playbook file. This approach will work for simple infrastructures, or when using Ansible as a simple deployment mechanism. However, if you have a large and complicated

[email protected]一个高效的配置管理工具--Ansible configure management--翻译(十二)

如无书面授权,请勿转载 第五章 自定义模块 External inventories In the first chapter we saw how Ansible needs an inventory file, so that it knows where its hosts are and how to access them. Ansible also allows you to specify a script that allows you to fetch the inventor

Ansi[email protected]一个高效的配置管理工具--Ansible configure management--翻译(五)

无书面许可请勿转载 高级Playbook Extra variables You may have seen in our template example in the previous chapter that we used a variable called group_names . This is one of the magic variables that are provided by Ansible itself. At the time of writing there a

[email protected]一个高效的配置管理工具--Ansible configure management--翻译(四)

无书面许可请勿转载 由于第三章内容较长,我将分做几个部分来翻译. Advanced Playbooks So far the playbooks that we have looked at are simple and just run a number of modules in order. Ansible allows much more control over the execution of your playbook. Using the following techniques

[email protected]一个高效的配置管理工具--Ansible configure management--翻译(九)

如无书面授权,请勿转载 第四章 大型项目中Ansible的使用 New features in 1.3 There are two features in Ansible 1.3 that were alluded to previously in the chapter. The first feature is the metadata roles. They allow you to specify that your role depends on other roles. For ex

[email protected]一个高效的配置管理工具--Ansible configure management--翻译(十)

无书面许可,请勿转载 Custom Modules Until now we have been working solely with the tools provided to us by Ansible. This does afford us a lot of power, and make many things possible. However, if you have something particularly complex or if you find yourself u

[email protected]一个高效的配置管理工具--Ansible configure management--翻译(十一)

无书面授权,请勿转载 第五章 自定义模块 Using a module Now that we have written our very first module for Ansible, we should give it a go in a playbook. Ansible looks at several places for its modules: first it looks at the place specified in the library key in its con

[email protected]一个高效的配置管理工具--Ansible configure management--翻译(一)

未经书面许可,请勿转载 ---      Ansible is the simplest way to automate apps and IT infrastructure 这是Ansible官方站点的介绍,本着学习的态度我决定一边学习一边翻译Ansible configure management这本书.原文下载稍后放出 #一些自解释的文字,我会忽略.或者依照自己的理解简单翻译一下,并不是每行每句都是一一相应. Preface Since CFEngine was first created