目标
本文,目标是使用ansible安装lnmp+haproxy。
共四台主机,都是ubuntu14 server版,一台作为ansible管理机,另外三台作为ansible客户机用来部署服务。
客户机A安装nginx+php+mysql,客户机B安装nginx+php,客户机C安装haproxy用来负载均衡。如下图:
YAML (/ˈjæməl/ and YAH-ml) is a human-readable data-serialization language. It is commonly used for configuration files and in applications where data is being stored or transmitted. YAML targets many of the same communications applications as Extensible Markup Language (XML) but has a minimal syntax which intentionally differs from SGML. It uses both Python-style indentation to indicate nesting, and a more compact format that uses […] for lists and {…} for maps thus JSON files are valid YAML.
参考文档:
下文主要转载自阮一峰大佬的YAML 语言教程。
ansible是一个用于自动化运维的配置管理和应用部署工具。基于Python开发,集合了众多运维工具(puppet、cfengine、chef、func、fabric.SaltStack )的优点,实现了批量系统配置、批量程序部署、批量运行命令等功能。ansible是基于模块工作的,本身没有批量部署的能力,真正具有批量部署能力的是ansible所运行的模块。
ansible的基本架构:
上述简介摘自ansible基础。
参考文档: