1 准备

  • 2台 centos7 (master/server:192.168.1.103 agent/client:192.168.1.106)
  • 分别添加puppet自定义仓库 https://yum.puppet.com/puppet6-release-el-7.noarch.rpm

2 Master/Server

设置 hostname

hostnamectl set-hostname puppet.example.net --static

设置 hosts

vi /etc/hosts

增加

192.168.1.103 puppet.example.net

安装 puppet server

yum -y install puppet-server

启动puppetmaster

systemctl start puppetmaster

systemctl enable puppetmaster

3 Agent/Client

设置hostname

nmtui->set system hostname->agent1.example.net

设置hosts

vi /etc/hosts

增加

192.168.1.106 agent1.example.net
192.168.1.103 puppet.example.net

安装puppet agent

yum -y install puppet

设置 puppet.conf

// vi /etc/puppet/puppet.conf
[agent]
certname = agent1.example.net
server = puppet.example.net
report = true

启动

systemctl start puppet.service
systemctl enable puppet.service

4 测试

client执行:puppet agent --test

输出

Info: Creating a new SSL key for agent1.example.net
Info: Caching certificate for ca
Info: csr_attributes file loading from /etc/puppet/csr_attributes.yaml
Info: Creating a new SSL certificate request for agent1.example.net
Info: Certificate Request fingerprint (SHA256): DB:21:15:C8:90:E4:2D:54:53:4C:A5:9A:4A:00:50:E7:99:5B:73:EE:0C:23:F9:7B:36:99:34:CD:FE:E6:DF:DA
Info: Caching certificate for ca
Exiting; no certificate found and waitforcert is disabled

最后一行不是错误

master执行:

  • puppet cert list 输出:
"agent1.example.net" (SHA256) 14:7D:AA:34:C8:F1:70:28:B9:51:A6:7D:94:3F:69:92:8F:61:94:17:7D:4A:EF:F2:44:CC:4A:BC:6B:D5:C3:EC
  • puppet cert sign agent1.example.net 或者 puppet cert sign --all

    输出:

Notice: Signed certificate request for agent1.example.net
Notice: Removing file Puppet::SSL::CertificateRequest agent1.example.net at '/var/lib/puppet/ssl/ca/requests/agent1.example.net.pem'

client再次执行

puppet agent --test

输出:

Info: Caching certificate for agent1.example.net
Info: Caching certificate_revocation_list for ca
Info: Caching certificate for agent1.example.net
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Caching catalog for agent1.example.net
Info: Applying configuration version '1428474782'
Info: Creating state file /var/lib/puppet/state/state.yaml
Notice: Finished catalog run in 0.05 seconds

在master上编辑 /etc/puppet/manifests/site.pp

node default {
file {"/tmp/test.txt":
content=>"I'm testing puppet\n";
}
}

在agent上执行 puppet agent --test

[root@agent1]# puppet agent --test
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Caching catalog for stor01.centos7.com
Info: Applying configuration version '1563239001'
Notice: /Stage[main]/Main/Node[default]/File[/tmp/test.txt]/ensure: defined content as '{md5}3ac8d756cdcb2a7594aa115a2f03e065'
Notice: Finished catalog run in 0.01 seconds
[root@stor01 puppet]# cat /tmp/test.txt
I'm testing puppet

参考资料

在 CentOS 7 上安装和配置 Puppet的更多相关文章

  1. 在 CentOS 7上安装并配置 Python 3.6 环境

    前言 按照此方法安装保证以下报错什么的统统都没有! 基础环境 系统:centos7.4 软件:python3 Retrying (Retry(total=0, connect=None, read=N ...

  2. Ubuntu/CentOS 系统上安装与配置Nginx

    一.在线安装: Ubuntu:sudo apt-get install nginx CentOS: sudo yum install nginx 二.安装后的位置: 1.服务地址:/etc/init. ...

  3. Ubuntu/Centos 系统上安装与配置Apache

    一.在线安装: Ubuntu:sudo apt-get install apache2 Centos: sudo yum install apache2 二.安装后的位置: 1.服务地址:/etc/i ...

  4. 怎样在 CentOS/RHEL 7/6 上安装和配置 Sendmail 服务器

    在 CentOS 上,可以通过 mailx 命令 或 sendmail 命令来给因特网发送电子邮件. 关于前者的文章比较多,关于后者的文章比较少. 这里记录了我在 CentOS 7 上安装和配置 se ...

  5. 在 CentOS 上安装和配置 OpenNebula

    转自:http://www.aikaiyuan.com/4889.html 我们提到的云计算一般有三种类型:软件即服务(Software as a Service, SaaS),平台即服务(Platf ...

  6. 怎样在CentOS 7.0上安装和配置VNC服务器

    VNC轻松连接远程Linux桌面 http://jingyan.baidu.com/article/6c67b1d6f1bac92786bb1e6d.html 这是一个关于怎样在你的 CentOS 7 ...

  7. 在Linux(CentOS 6.6)服务器上安装并配置基于Apache的SVN服务器

    #!/bin/bash # # 在Linux(CentOS 6.6)服务器上安装并配置基于Apache的SVN服务器: # # .安装服务 # .创建svn版本库 # .创建svn用户 # .配置sv ...

  8. 怎样在 CentOS 7.0 上安装和配置 VNC 服务器

    这是一个关于怎样在你的 CentOS 7 上安装配置 VNC 服务的教程.当然这个教程也适合 RHEL 7 .在这个教程里,我们将学习什么是 VNC 以及怎样在 CentOS 7 上安装配置 VNC ...

  9. 在Centos 7上安装配置 Apche Kafka 分布式消息系统集群

    Apache Kafka是一种颇受欢迎的分布式消息代理系统,旨在有效地处理大量的实时数据.Kafka集群不仅具有高度可扩展性和容错性,而且与其他消息代理(如ActiveMQ和RabbitMQ)相比,还 ...

随机推荐

  1. 帮助IT业告别内卷,哪项变革最能被寄予厚望?

    近日,中国软件行业协会发布<2021年中国低代码/无代码市场研究报告>,其中提到:我国低代码整体市场规模已达数十亿规模,并将在未来五年保持49.5%的复合增长率.低代码成为整个中国ICT产 ...

  2. 在Eclipse中编写jQuery代码时产生的错误(连载)

    1.Error:启动Eclipse中的服务,显示错误,端口号被占用 解决方法: 方式一:修改对应的端口号(实际情况实际处理) 方式二:在进程中关闭Eclispe重新打开即可(截图说明) 2.Error ...

  3. shell脚本 监控网卡信息

    一.简介 源码地址 日期:2018/6/22 介绍:显示实时输入输出流量 效果图: 二.使用 适用:centos6+ 语言:英文 注意:无 下载 wget https://raw.githubuser ...

  4. LuoguP7593 凑数 题解

    Content 给定 \(n\) 个整数 \(1,2,\dots,n\),请问是否能从这 \(n\) 个数中恰好选 \(k\) 个数,使得这 \(k\) 个数的和为 \(s\). 数据范围:\(t\) ...

  5. LuoguB2133 我家的门牌号 题解

    Update \(\texttt{2021.11.27}\) 修复了代码中的 \(10000\) 写成 \(n\) 的错误. Content 一个家庭住在一个胡同里面,门牌号从 \(1\) 开始编号. ...

  6. java 常用类库:BigInteger大整数;BigDecimal大小数(解决double精度损失);

    大整数BigInteger package com.zmd.common_class_libraries; import java.math.BigInteger; /** * @ClassName ...

  7. Tornado 异步浅解

    7.1 认识异步 1. 同步 我们用两个函数来模拟两个客户端请求,并依次进行处理: #!/usr/bin/env python3 # -*- coding:utf-8 -*- # @Time: 202 ...

  8. MAVEN项目打包报错:Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode) -> [Help 1]

    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war (default-war) on pr ...

  9. c++跨平台字符编码与乱码杂谈

    blos https://article.itxueyuan.com/qpQml https://www.cnblogs.com/wangmh/p/7265258.html https://blog. ...

  10. Android JNI 启动线程,并设置线程名称

    p.p1 { margin: 0; font: 12px Menlo; color: rgba(100, 56, 32, 1); background-color: rgba(255, 255, 25 ...