puppet-笔记1

master------------agent     证书加密

192.168.2.130   puppet.hequan.lol  puppet
192.168.2.131   station.hequan.lol  station

安装
master:  yum install  puppet.noarch          puppet-server.noarch
agent:   yum install  puppet.noarch

[[email protected] puppet]# ls
auth.conf  fileserver.conf  manifests  modules  puppet.conf
vim puppet.conf
  1 [master]
  2         certname=puppet.hequan.lol
[[email protected] puppet]# puppet master
[[email protected] puppet]# netstat -lntup | grep 8140
tcp        0      0 0.0.0.0:8140            0.0.0.0:*               LISTEN      2580/ruby           
[[email protected] ~]# puppet agent      --server=puppet.hequan.lol   --no-daemonize    --verbose  --onetime ##默认去找puppet
[[email protected] puppet]# ll /var/lib/puppet/ssl/ca/requests/  
-rw-r--r-- 1 puppet puppet 1598 8月  31 20:38 station.hequan.lol.pem
[[email protected] puppet]# puppet cert --list
  "station.hequan.lol" (SHA256) 35:BD:28:6C:18:5D:58:3F:EF:60:F6:2D:6E:5D:5A:B7:16:02:36:84:48:08:31:32:28:DF:C7:BD:A6:65:9F:E9
  
  
puppet cert --sign  station.hequan.lol     ##all           签发

[[email protected] puppet]# ll /var/lib/puppet/ssl/ca/signed/       ##签发完成,建立联系         
总用量 8
-rw-r--r-- 1 puppet puppet 2009 8月  31 20:34 puppet.hequan.lol.pem
-rw-r--r-- 1 puppet puppet 1960 8月  31 20:41 station.hequan.lol.pem

/etc/puppet/manifests   ##管理服务器清单,这个目录里面需要一个文件,   xxx.pp
[[email protected] manifests]# ll
-rw-r--r-- 1 root root 159 8月  31 20:58 node.pp
-rw-r--r-- 1 root root  53 8月  31 20:48 site.pp

[[email protected] manifests]# cat site.pp
$puppetserver="puppet.hequan.lol"
import   ‘node.pp‘
[[email protected] manifests]# cat node.pp
node  ‘station.hequan.lol‘  {
                #定义资源的方式:
                #资源类型{‘资源名‘:属性1=>‘值1‘}
                package{"system-config-date":ensure=>‘present‘}
}
package {‘nginx‘:
        ensure  => present,
}
        file {"/root/aa1.txt":
          ensure=>"present",
          mode=>"0000"
}
[[email protected] puppet]# ll /root
总用量 4
----------  1 root root   0 8月  31 21:26 aa1.txt
时间: 2024-08-08 09:40:32

puppet-笔记1的相关文章

puppet 笔记

1.创建模块目录结构 注意:在未指定modulepath搜索路径的情况下,会有默认搜索路径的,可通过以下方式查看到     [[email protected] ~]# puppet master --genconfig >/etc/puppet/puppet.conf.out     [[email protected] ~]# cat /etc/puppet/puppet.conf.out | grep modulepath       modulepath = /etc/puppet/mo

【python】获取51cto博客的文章列表

python的正则与网页操作练习二: import re import urllib.request #51cto urlcode=gb18030 class down51web: s_url='' s_blogid='' s_blogpages='' s_html='' s_code='' def __init__(self,url,code): self.s_url=url self.s_code=code def get_html(self): self.s_html=urllib.req

Puppet学习笔记(CentOS6.3+Puppet3.01)

Puppet学习笔记(CentOS6.3+Puppet3.01) 技术 Add comments Oct262012 下了决心,好好学习puppet,周末专门去参加一个puppet的培训,难得朋友那么热心,组织大家一起去学习.我就提前做一下功课. 2012年10月29日:参加完两天的培训,深刻体会到puppet的强悍,当然讲Puppet的朋友,还是非常有经验,不只是puppet经验,还有讲课的经验,学习一个新东西的经验.一个最大的收获:官方的文档非常好,把puppet读完,你就差不多. Cont

Puppet实战笔记

什么是puppet? puppet批量管理工具,目前乐视,安居都是在用puppet,采用的是C/S模式的结构的linux,unix的集中配置 管理系统,puppet拥有自己的语言,可以管理文件用户,cron任务,软件包等,系统服务. puppet工作原理: 采用https和XML协议,master去管理client,客户通过https的xmlrpc协议发给服务器端,服务器通过分析客户主机名,找到该主机配置代码 当客户端操作完成后向服务器返回消息,看看是否执行成功. puppet 应用于公司有大量

学习笔记--Puppet集中配置管理系统

实验环境:server6:server端 Server7:client端 须保证server端与client端存在解析,并且时间一致,火墙与selinux关闭 1.安装 Server端:yum install -y puppet-server-3.8.1-1.el6.noarch.rpm puppet-3.8.1-1.el6.noarch.rpm facter-2.4.4-1.el6.x86_64.rpm hiera-1.3.4-1.el6.noarch.rpm rubygem-json-1.5

puppet学习笔记之安装与配置

Server: ip=`ifconfig eth0 |grep "inet addr" |awk -F ":" '{print $2}'| awk '{print $1}'` hostname=`hostname` echo "$ip    $hostname" >> /etc/hosts yum -y install gcc ruby ntp /etc/init.d/ntpd stop ntpdate cn.pool.ntp.org

puppet学习笔记之node/package/service/file/user/group/cron/exec管理

#节点管理; node 'puppet.63638790.cn','puppet-agent-188','puppet-agent-190' {         include package::install         include services::system         include services::lamp         include privileges         include software::distribution         includ

<老友记>学习笔记

这是六个人的故事,从不服输而又有强烈控制欲的monica,未经世事的千金大小姐rachel,正直又专情的ross,幽默风趣的chandle,古怪迷人的phoebe,花心天真的joey——六个好友之间的情路坎坷,事业成败和生活中的喜怒哀乐,无时无刻不牵动着彼此的心,而正是正平凡的点点滴滴,却成为最令人感动与留恋的东西. 人物:1.瑞秋•格林(RACHEL GREENE)由珍妮佛•安妮斯顿(Jennifer Aniston)扮演 瑞秋是莫妮卡的高中同学,在与牙医未婚夫的婚礼上脱逃至莫妮卡处. 2.罗

运维自动化工具ansible学习笔记

利用五一假期的时间学习了下ansible,看了一天的官方文档,对其中需要注意的地方,做下笔记整理下思绪. 一.简介 Ansible是与puppet.saltstack类似的集群管理工具,其优点是仅需要ssh和Python即可使用,而不像puppet.saltstack那样都需要客户端.puppet与saltstack这2个软件都需要安装客户端,而saltstack与ansible很相似,都是属于python流的,但saltstack不是很稳定:puppet虽然稳定,但命令执行的时候,需要配置模块

搭建puppet dashboard及遇到的问题

其实网上这样的文章已经很多了,这里随便摘出两篇,以供参考 1.Puppet Dashboard的安装与配置 2.Puppet学习笔记(CentOS6.3+Puppet3.01) 发这篇文章主要说下自己部署过程中踩过的坑: 1.在手动导入报告文件到mysql的时候报 undefined method `source_index' for Gem:Module 错误 原因是自己yum安装的rubygem版本是2.0以上,而2.0以后取消了source_index这个方法,这个puppet dashb