puppet 5.x 安装配置

准备

1. 关闭防火墙(测试环境方便测试用)

systemctl stop firewalld.service

2. 测试服务器

机器名/域名ippuppet服务
centos1192.168.56.11puppet-agent
centos2192.168.56.12puppetserver
centos3192.168.56.13puppet-agent

3. 安装puppet repository

rpm -Uvh https://yum.puppet.com/puppet5/puppet5-release-el-7.noarch.rpm

 

puppet server 5.1

1. 清空yum缓存

rm -rf /var/cache/yum

2. insatll pacakge

yum install puppetserver

3.修改配置文件(master)

vi /etc/puppetlabs/puppet/puppet.conf
[main]
certname = centos2
server = centos2
environment = production
runinterval = 5m

[master]
vardir = /opt/puppetlabs/server/data/puppetserver
logdir = /var/log/puppetlabs/puppetserver
rundir = /var/run/puppetlabs/puppetserver
pidfile = /var/run/puppetlabs/puppetserver/puppetserver.pid
codedir = /etc/puppetlabs/code

4. 启动server服务

systemctl start puppetserver

5. 开机自动启动

systemctl enable puppetserver

# 测试

/opt/puppetlabs/bin/puppet master -v -d --no-daemonize

 

puppet agent 5.3

1. 安装puppet repository

rpm -Uvh https://yum.puppet.com/puppet5/puppet5-release-el-7.noarch.rpm

2. install pacakge

yum install puppet-agent

3. 拷贝rpm包

find /var/cache/yum -name "*.rpm" -exec cp {} /data/tmp \;

4. 安装

rpm -ivh puppet-agent-5.3.3-1.el7.x86_64.rpm

5. 修改配置文件(agent)

vi /etc/puppetlabs/puppet/puppet.conf
[main]
certname = centos3
server = centos2
environment = production
runinterval = 5m

6. 启动服务
方法一

systemctl start puppet

方法二

sudo /opt/puppetlabs/bin/puppet resource service puppet ensure=running enable=true.

7. 测试并验证agent配置

sudo /opt/puppetlabs/bin/puppet agent --test

8. master上给agent证书签名
1)查看待签名证书

/opt/puppetlabs/bin/puppet cert list

2)签名

/opt/puppetlabs/bin/puppet cert sign <NAME>

 

puppet.conf例子

官方文档地址:
文件说明: https://puppet.com/docs/puppet/5.3/config_file_main.html
配置项: https://puppet.com/docs/puppet/5.3/configuration.html

Example agent config

[main]
certname = agent01.example.com
server = puppet
environment = production
runinterval = 1h

Example master config

[main]
certname = puppetmaster01.example.com
server = puppet
environment = production
runinterval = 1h
strict_variables = true

[master]
dns_alt_names = puppetmaster01,puppetmaster01.example.com,puppet,puppet.example.com
reports = puppetdb
storeconfigs_backend = puppetdb
storeconfigs = true
environment_timeout = unlimited

转载于:https://my.oschina.net/u/3776771/blog/1616711

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Write custom plugins for Puppet, including facts, providers, and functions Key Features Grasp recipes that work with centralized and decentralized deployments Explore language differences and enhancements anticipated in Puppet version 5.x Gain expert understanding of Puppet's latest and most advanced features Book Description Puppet is a configuration management system that automates all your IT configurations, giving you control of managing each node.Puppet 5 Cookbook will take you through Puppet's latest and most advanced features, including Docker containers, Hiera, and AWS Cloud Orchestration. Updated with the latest advancements and best practices, this book delves into various aspects of writing good Puppet code, which includes using Puppet community style, checking your manifests with puppet-lint, and learning community best practices with an emphasis on real-world implementation. You will learn to set up, install, and create your first manifests with Puppet version control, and also understand various sysadmin tasks, including managing config files, using Augeas, and generating files from snippets and templates. As the book progresses, you'll explore virtual resources and use Puppet's resource scheduling and auditing features. In the concluding chapters, you'll walk through managing applications and writing your own resource types, providers, and external node classifiers. By the end of this book, you will have learned to report, log, and debug your system. What you will learn Discover the latest and most advanced features of Puppet Bootstrap your Puppet installation using powerful tools like Rake Master techniques to deal with centralized and decentralized Puppet deployments Use exported resources and forge modules to set up Puppet modules Create efficient manifests to streamline your deployments Automate Puppet master deployment using Git hooks and PuppetDB Make Puppet reliable, performant, and scalable Who This Book Is For Puppet 5 Cookbook is for

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值