码迷,mamicode.com
首页 > 其他好文 > 详细

1-puppet安装

时间:2016-04-13 20:58:38      阅读:211      评论:0      收藏:0      [点我收藏+]

标签:puppet

一、server端安装

   1、安装puppet yum

    yum -y install http://yum.puppetlabs.com/el/6/products/x86_64/puppetlabs-release-6-7.noarch.rpm

   sed -i -e "s/enabled=1/enabled=0/g" /etc/yum.repos.d/puppetlabs.repo

   yum --enablerepo=puppetlabs-products,puppetlabs-deps -y install puppet-server

   2、修改配置

   vim /etc/sysconfig/puppetmaster

  PUPPETMASTER_MANIFEST=/etc/puppet/manifests/site.pp  #打开注释

  PUPPETMASTER_LOG=syslog                                                          #记录日志

 touch /etc/puppet/manifests/site.pp              #创建文件

   3、启动服务、开机启动

 /etc/rc.d/init.d/puppetmaster start

 chkconfig puppetmaster on

二、client安装

  1、安装puppet yum

    yum -y install http://yum.puppetlabs.com/el/6/products/x86_64/puppetlabs-release-6-7.noarch.rpm

   sed -i -e "s/enabled=1/enabled=0/g" /etc/yum.repos.d/puppetlabs.repo

   yum --enablerepo=puppetlabs-products,puppetlabs-deps -y install puppet

  2、修改配置

  vi /etc/sysconfig/puppet

  PUPPET_SERVER=server.puppet.com    #指定server

 PUPPET_LOG=/var/log/puppet/puppet.log   #记录日志

  3、启动服务、开机启动

 /etc/rc.d/init.d/puppet start

  chkconfig puppet on

三、注册

Server 端:

          puppet cert list                # 查看注册信息

          puppet  cert sign   client1.puppet.com   # 同意注册

四、测试

 server端:

          vim/etc/puppet/manifests/site.pp        #编辑主机配置文件

            

          group { ‘testgroup‘:

                        ensure => present,

                        gid    => 2000,

          }

          puppet apply /etc/puppet/manifests/site.pp #运行主配置文件

 client端:

         /etc/init.d/puppet reload                           #重新载入配置文件

    grep  testgroup /etc/group       #查看是否有testgroup


本文出自 “IT漫漫路” 博客,请务必保留此出处http://longgege.blog.51cto.com/6740519/1763494

1-puppet安装

标签:puppet

原文地址:http://longgege.blog.51cto.com/6740519/1763494

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!