Code Monkey home page Code Monkey logo

xiaoyan-test001's Introduction

playbook 使用文档

概要

该playbook分为三个role,分别为puppetserver,puppetdb,amq 对用的play文件分别为.puppetservers.yml, amq.yml, dbservers.yml 清单文件为production和stage两个文件,对应测试和生产环境(可以按需调整)

首先修改ansible配置开启facts缓存

修改/etc/ansible/ansible.cfg,修改一下配置: ansible.cfg: gathering = smart fact_caching = jsonfile fact_caching_connection = /etc/ansible/cache fact_caching_timeout = 86400

修改好配置后,执行获取facts信息

ansible -i stage|production -m setup 或者:
ansible-playbook -i stage|production site.yaml --tags cache_facts

部署结构图

该playbook的部署结构为,单数据中心有两台puppetserver做多活集群,两台activemq做mq集群,两台puppetdb做集群,共六台服务器,具体请见puppet的应用部署架构

	puppetserver1----> puppetdb01,puppetdb02

host----> ----> amq1|amq2 puppetserver2----> puppetdb01,puppetdb02

安装puppet-server集群的具体步骤

1. 修改变量文件,设置对应的变量

该playbook的相关变量信息存放在 group_vars和host_vars两个目录下,请查找对应变量,按需设置具体对应值

2. 运行playbook,安装puppetserver集群

执行如下命令:

ansible-playbook -i stage|production puppetservers.yml [--tags "puppetserver"]   # 这条命令执行 puppetserver的部署

3. 运行playbook,安装puppetdb集群

执行如下命令:

ansible-playbook -i stage|production dbservers.yml [--tags "puppetdb"]  #执行puppetdb软件包的安装和配置

ansible-playbook -i stage|production puppetservers.yml --tags "puppetdb_validate"  #在puppetservers上激活puppetdb

4. 运行playbook,安装activemq

ansible-playbook -i stage|production amq.yml [--tags "amq"]  #在puppetservers上激活puppetdb

5. 运行playbook,配置mco-client

ansible-playbook -i stage|production puppetservers.yml --tags "mco_cli"  #在puppetservers上激活puppetdb

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.