安装puppet服务

先安装ruby语言包、ruby标准库、ruby shadow库
yum install -y ruby ruby-libs ruby-shadow
2.需要添加EPRL库,来支持puppet
[root@test date]#wget http://dl.Fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
[root@test date]#rpm -Uvh epel-release-6-8.noarch.rpm
如果你的系统是其他版本或者是32位的,可以到网站:
dl.fedoraproject.org查找你们想要的

在 master上安装和启用 puppet 服务:
[root@master ~]# yum install -y puppet puppet-server facter

[root@master ~]# chkconfig --list |grep puppet

puppet 0:off 1:off 2:off 3:off 4:off 5:off 6:off

puppetmaster 0:off 1:off 2:off 3:off 4:off 5:off 6:off

[root@master ~]# chkconfig puppet on

[root@master ~]# service puppetmaster start

Starting puppetmaster: [ OK ]

[root@master ~]#vi /etc/sysconfig/network

hostname master.test.com

在clients上安装puppet客户端

[root@node1 ~]# yum install -y puppet

[root@node1 ~]# chkconfig --list |grep puppet

puppet 0:off 1:off 2:off 3:off 4:off 5:off 6:off

[root@node1 ~]# chkconfig puppet on

[root@node1 ~]# chkconfig --list |grep puppet

puppet 0:off 1:off 2:on 3:on 4:on 5:on 6:off

[root@node1 ~]# service puppet start

Starting puppet agent: [ OK ]

[root@node1 ~]#

在clients上解析pupetmaster 的域名

[root@node1 ~]#vim /etc/hosts

192.168.50.30 master.test.com

3.配置puppet

对于puppet 客户端,修改/etc/puppet/puppet.conf,指定master服务器
[main]

# The Puppet log directory.

# The default value is '$vardir/log'.

logdir = /var/log/puppet

# Where Puppet PID files are kept.

# The default value is '$vardir/run'.

rundir = /var/run/puppet

# Where SSL certificates are kept.

# The default value is '$confdir/ssl'.

ssldir = $vardir/ssl

[agent]

# The file in which puppetd stores a list of the classes

# associated with the retrieved configuratiion. Can be loaded in# the separate ``puppet`` executable using the ``--loadclasses``

# option.

# The default value is '$confdir/classes.txt'.

classfile = $vardir/classes.txt

# Where puppetd caches the local configuration. An

# extension indicating the cache format is added automatically.

# The default value is '$confdir/localconfig'.

localconfig = $vardir/localconfig

server = master.test.com

并重启puppet服务
[root@node1 ~]# service puppet restart

Stopping puppet agent: [ OK ]

Starting puppet agent: [ OK ]

[root@node1 ~]#

4.Client申请证书  
服务端自动签发证书设置  
设置master自动签发所有的证书,我们只需要在/etc/puppet 目录下创建 autosign.conf 文件。(不需要修改 /etc/puppet/puppet.conf文件,因为我默认的autosign.conf 文件的位置没有修改)
[root@master ~]# ll /etc/puppet/

total 28

-rw-r--r--. 1 root root 4178 Nov 4 06:24 auth.conf

drwxr-xr-x. 3 root root 4096 Dec 29 15:44 environments

-rw-r--r--. 1 root root 1462 Nov 4 06:23 fileserver.conf

drwxr-xr-x. 2 root root 4096 Nov 4 06:24 manifests

drwxr-xr-x. 2 root root 4096 Nov 4 06:24 modules

-rw-r--r--. 1 root root 853 Nov 4 06:23 puppet.conf

[root@master ~]# cat > /etc/puppet/autosign.conf <<EOF

> *.fisteam2.com

> EOF

[root@master ~]# service puppetmaster restart

Stopping puppetmaster: [ OK ]

Starting puppetmaster: [ OK ]

[root@master ~]#

这样就会对所有来自fisteam2.com的机器的请求,都自动签名。  
client需要向服务器端发出请求, 让服务器对客户端进行管理. 这其实是一个证书签发的过程. 第一次运行puppet 客户端的时候会生成一个 SSL 证书并指定发给 Puppet 服务端, 服务器端如果同意管理客户端,就会对这个证书进行签发,可以用这个命令来签发证书,由于我们已经在客户端设置了server地址,因此不需要跟服务端地址
[root@master ~]# puppet agent

为了详细了解注册的过程和日后排错,可以增加参数,因为配置文件里  
–no-daemonize 前台输出日志  
–verbose 输入更加详细的日志  
–debug 更加详细的日志,排错的时候使用  
–test 表示测试,就带一个–test参数就可以
[root@node1 ~]# puppet agent --no-daemonize --onetime --verbose --debug

就可以申请证书了,由于我配置的自动签发证书,所以直接就签发了,在服务端执行
[root@master ~]# puppet cert list --all

就可以看到所有客户端已经都已签发证书,前面带”+”号的就是签发成功的,如果没有签名的,可以用
[root@master ~]# puppet cert --sign node1.localdomain

即可看到证书已经签发。

安装puppet的更多相关文章

  1. CentOS7:安装Puppet

    环境说明: 192.168.154.137 master.localdomain #Puppet Server 192.168.154.138 agent1.localdomain #Puppet A ...

  2. CentOS7安装Puppet+GitLab+Bind

    添加Puppet官方源 rpm -Uvh https://yum.puppetlabs.com/puppetlabs-release-el-7.noarch.rpm 安装Puppet yum -y i ...

  3. yum安装puppet

    yum安装puppet author:headsen chen     2017-10-31  17:09:35 个人原创,转载请注明作者和出处,否则依法追究法律责任: 环境:centos 6.5 [ ...

  4. CentOS 6.4安装Puppet

    CentOS安装Puppet   环境介绍:centos6.4x64 採用CentOS-6.4-x86_64-minimal.iso最小化安装   puppet版本号3.6.2.ruby1.8.7,f ...

  5. Centos 安装Puppet

    环境说明: OS:CentOS 5.4 i386puppetmaster    192.168.0.12    hostname: puppetmaster.info.comclient       ...

  6. Puppet部署:安装puppet server、client

    Puppet部署:安装puppet server.client   puppet与其他手工操作工具有一个最大的区别就是 puppet的配置具有稳定性,因此你可以多次执行puppet,一旦你更新了你的配 ...

  7. 在CentOS 6.4上安装Puppet配置管理工具

    在CentOS 6.4上安装Puppet配置管理工具 linux, puppetAdd comments 五052013 上篇说了下在ubuntu12.04上安装puppet,安装的版本为puppet ...

  8. puppet的使用:安装puppet

    最近项目要使用puppet,趁机赶紧学习下. 在家里的机器中搭建puppet环境,使用两台ubuntu 14.04: 准备工作 时间同步 两台设备先进行时间同步,我把要安装master的机器作为NTP ...

  9. centos7安装puppet详细教程(简单易懂,小白也可以看懂的教程)

    简介: Puppet是一种linux.unix平台的集中配置管理系统,使用ruby语言,可配置文件.用户.cron任务.软件包.系统服务等.Puppet把这些系统实体称之为资源,它的设计目标是简化对这 ...

随机推荐

  1. JavaWeb框架SSH_Struts2_(二)

    1.  Struts2的核心配置(详解) 本章内容目录: 配置struts.xml文件 struts.xml文件 常量配置 包配置 包含配置 Action配置 实现Action控制类 配置Action ...

  2. Python第一天自学,变量,基本数据类型

    PyCharm 一些简单常用设置操作设置模板 File->Settings->Editor->File and Code Templates //切换python版本File-> ...

  3. jquery.form.js+jquery.validation.js实现表单校验和提交

      一.jquery引用 主要用到3个js: jquery.js jquery.form.js jquery.validation.js 另外,为了校验结果提示本地化,还需要引入jquery.vali ...

  4. ExceptionLess 本地部署小结

    ExceptionLess 是一个免费开源分布式系统日志收集框架,地址:https://github.com/exceptionless/Exceptionless 运行环境: .NET 4.6.1 ...

  5. 分布式监控系统Zabbix3.2跳坑指南

    zabbix是什么在此就不多作介绍了,可以参考之前的文章 零代码如何打造自己的实时监控预警系统 ,这篇主要介绍安装及注意事项. 主要分为服务端和客户端安装,客户端又分为Linux.Windows. 服 ...

  6. Android智能下拉刷新加载框架—看这些就够了

    一些值得学习的几个下拉刷新上拉加载开源库 Android智能下拉刷新框架-SmartRefreshLayout 支持所有的 View(AbsListView.RecyclerView.WebView. ...

  7. Anaconda 安装 Python 库(MySQLdb)的方法

    [已解决]Anaconda 安装 Python 库(MySQLdb)的方法 zoerywzhou@163.com http://www.cnblogs.com/swje/ 作者:Zhouwan 201 ...

  8. leetcode算法题1: 两个二进制数有多少位不相同?异或、位移、与运算的主场

    /* The Hamming distance between two integers is the number of positions at which the corresponding b ...

  9. canvas入门之时钟的实现

    canvas 入门之作: 三步实现一个时钟: 直接上效果:   step 1  : 背景制作首先制作从1-12的数字: var canvas = document.getElementById('ca ...

  10. video视频铺满

    1. 因项目需求,要在公司官网加一段视频,达到的效果是视频平铺整个网页,大小随网页变化:网上找了许久才找了了这么一个生僻的属性,只需给video加这么个样式就可以了:object-fit: fill; ...