puppet 简单的安装及配置

2024-05-28 00:58
文章标签 简单 配置 安装 puppet

本文主要是介绍puppet 简单的安装及配置,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

系统环境:Centos 6.7 


根据系统加入PuppetLabs官方源

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

master端安装

yum install -y ruby facter puppet-server
[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/localconfigserver  = puppet					# 服务器名称
[master]certname = puppet					# puppetmaster认证服务器名称#修改配置
vim /etc/puppet/puppet.conf启动服务
service puppet start
service puppetmaster start加入开启启动
chkconfig  puppet on
chkconfig  puppetmaster on[root@puppet ~]# puppet cert --list -all	# 带“+”表明注册成功
+ "puppet"      (SHA256) 41:CB:D2:51:8D:B1:48:6E:6E:97:CD:EE:5A:36:DB:F8:66:9B:F9:BB:57:F9:18:4C:11:3D:4E:0A:4E:9C:8F:04

安装Agent客户端

#绑定hosts
vim /etc/hosts
192.168.0.1 puppetyum install -y puppet facter[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/localconfigserver = puppet					# 设置puppetmaster

# Agent发送身份验证 
[root@api ~]# puppet agent -t
Info: Creating a new SSL key for api
Info: Caching certificate for ca
Info: csr_attributes file loading from /etc/puppet/csr_attributes.yaml
Info: Creating a new SSL certificate request for api
Info: Certificate Request fingerprint (SHA256): 1B:71:9D:C6:09:F6:84:14:A2:23:3F:89:77:4F:16:DB:20:CD:B8:F7:1A:F0:90:54:13:ED:5A:9B:8E:AD:40:3E
Info: Caching certificate for ca
Exiting; no certificate found and waitforcert is disabled# Master 查看请求验证
[root@puppet ~]# puppet cert --sign --list"api" (SHA256) 1B:71:9D:C6:09:F6:84:14:A2:23:3F:89:77:4F:16:DB:20:CD:B8:F7:1A:F0:90:54:13:ED:5A:9B:8E:AD:40:3E# Master 通过客户端认证
[root@puppet ~]# puppet cert --sign api
Notice: Signed certificate request for api
Notice: Removing file Puppet::SSL::CertificateRequest api at '/var/lib/puppet/ssl/ca/requests/api.pem'# 查看 Master 认证机器
[root@puppet ~]# puppet cert list --all
+ "api"    (SHA256) 6C:A7:50:6A:29:CD:09:A9:CA:0E:0F:84:81:33:97:34:C9:0E:CC:D2:A3:2D:52:F5:25:64:C3:98:A0:02:E6:07
+ "puppet"      (SHA256) 41:CB:D2:51:8D:B1:48:6E:6E:97:CD:EE:5A:36:DB:F8:66:9B:F9:BB:57:F9:18:4C:11:3D:4E:0A:4E:9C:8F:04# Agent 测试认证后结果
[root@api ~]# puppet agent -t
Info: Caching certificate for api
Info: Caching certificate_revocation_list for ca
Info: Caching certificate for api
Warning: Unable to fetch my node definition, but the agent run will continue:
Warning: undefined method `include?' for nil:NilClass
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Caching catalog for api
Info: Applying configuration version '1510131350'
Info: Creating state file /var/lib/puppet/state/state.yaml
Notice: Finished catalog run in 0.03 seconds



这篇关于puppet 简单的安装及配置的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/1009092

相关文章

Nginx配置location+rewrite实现隐性域名配置

《Nginx配置location+rewrite实现隐性域名配置》本文主要介绍了Nginx配置location+rewrite实现隐性域名配置,包括基于根目录、条件和反向代理+rewrite配置的隐性... 目录1、配置基于根目录的隐性域名(就是nginx反向代理)2、配置基于条件的隐性域名2.1、基于条件

Linux配置IP地址的三种实现方式

《Linux配置IP地址的三种实现方式》:本文主要介绍Linux配置IP地址的三种实现方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录环境RedHat9第一种安装 直接配置网卡文件第二种方式 nmcli(Networkmanager command-line

使用EasyExcel实现简单的Excel表格解析操作

《使用EasyExcel实现简单的Excel表格解析操作》:本文主要介绍如何使用EasyExcel完成简单的表格解析操作,同时实现了大量数据情况下数据的分次批量入库,并记录每条数据入库的状态,感兴... 目录前言固定模板及表数据格式的解析实现Excel模板内容对应的实体类实现AnalysisEventLis

VSCode配置Anaconda Python环境的实现

《VSCode配置AnacondaPython环境的实现》VisualStudioCode中可以使用Anaconda环境进行Python开发,本文主要介绍了VSCode配置AnacondaPytho... 目录前言一、安装 Visual Studio Code 和 Anaconda二、创建或激活 conda

Pycharm安装报错:Cannot detect a launch configuration解决办法

《Pycharm安装报错:Cannotdetectalaunchconfiguration解决办法》本文主要介绍了Pycharm安装报错:Cannotdetectalaunchconfigur... 本文主要介绍了Pycharm安装报错:Cannot detect a launch configuratio

pytorch+torchvision+python版本对应及环境安装

《pytorch+torchvision+python版本对应及环境安装》本文主要介绍了pytorch+torchvision+python版本对应及环境安装,安装过程中需要注意Numpy版本的降级,... 目录一、版本对应二、安装命令(pip)1. 版本2. 安装全过程3. 命令相关解释参考文章一、版本对

Windows系统下如何查找JDK的安装路径

《Windows系统下如何查找JDK的安装路径》:本文主要介绍Windows系统下如何查找JDK的安装路径,文中介绍了三种方法,分别是通过命令行检查、使用verbose选项查找jre目录、以及查看... 目录一、确认是否安装了JDK二、查找路径三、另外一种方式如果很久之前安装了JDK,或者在别人的电脑上,想

大数据spark3.5安装部署之local模式详解

《大数据spark3.5安装部署之local模式详解》本文介绍了如何在本地模式下安装和配置Spark,并展示了如何使用SparkShell进行基本的数据处理操作,同时,还介绍了如何通过Spark-su... 目录下载上传解压配置jdk解压配置环境变量启动查看交互操作命令行提交应用spark,一个数据处理框架

IDEA连接达梦数据库的详细配置指南

《IDEA连接达梦数据库的详细配置指南》达梦数据库(DMDatabase)作为国产关系型数据库的代表,广泛应用于企业级系统开发,本文将详细介绍如何在IntelliJIDEA中配置并连接达梦数据库,助力... 目录准备工作1. 下载达梦JDBC驱动配置步骤1. 将驱动添加到IDEA2. 创建数据库连接连接参数

Python FastAPI入门安装使用

《PythonFastAPI入门安装使用》FastAPI是一个现代、快速的PythonWeb框架,用于构建API,它基于Python3.6+的类型提示特性,使得代码更加简洁且易于绶护,这篇文章主要介... 目录第一节:FastAPI入门一、FastAPI框架介绍什么是ASGI服务(WSGI)二、FastAP