<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-Hans-CN">
	<id>https://wiki.linuxsa.org/index.php?action=history&amp;feed=atom&amp;title=Puppet%E5%9F%BA%E7%A1%80</id>
	<title>Puppet基础 - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.linuxsa.org/index.php?action=history&amp;feed=atom&amp;title=Puppet%E5%9F%BA%E7%A1%80"/>
	<link rel="alternate" type="text/html" href="https://wiki.linuxsa.org/index.php?title=Puppet%E5%9F%BA%E7%A1%80&amp;action=history"/>
	<updated>2026-04-17T03:44:26Z</updated>
	<subtitle>本wiki上该页面的版本历史</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://wiki.linuxsa.org/index.php?title=Puppet%E5%9F%BA%E7%A1%80&amp;diff=842&amp;oldid=prev</id>
		<title>Evan：​/* Installing Puppet Server */</title>
		<link rel="alternate" type="text/html" href="https://wiki.linuxsa.org/index.php?title=Puppet%E5%9F%BA%E7%A1%80&amp;diff=842&amp;oldid=prev"/>
		<updated>2021-11-22T01:07:09Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Installing Puppet Server&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;=why=&lt;br /&gt;
 一切按官方文档是最好的哦 虽然英文Oct 27 2021 &lt;br /&gt;
salt 老是0day问题  ,为了安全 于是上puppet 现在文档真的很少,以前在dovo时,流行得很呢   于是有了本文&lt;br /&gt;
&lt;br /&gt;
=install=&lt;br /&gt;
&lt;br /&gt;
https://puppet.com/docs/puppet/7/install_agents.html#configure_server_setting&lt;br /&gt;
&lt;br /&gt;
https://puppet.com/docs/puppetserver/5.3/intermediate_ca_configuration.html&lt;br /&gt;
&lt;br /&gt;
https://puppet.com/docs/puppet/7/ssl_regenerate_certificates.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==aliyun mirrors ==&lt;br /&gt;
https://developer.aliyun.com/mirror/puppet&lt;br /&gt;
https://mirrors.aliyun.com/puppet/&lt;br /&gt;
&lt;br /&gt;
==* Enable the Puppet platform repository ==                                                                                                                                    &lt;br /&gt;
                                                                                                                                                                             &lt;br /&gt;
=== RH===&lt;br /&gt;
  可以用aliyun mirrors 会更加快 &lt;br /&gt;
 wget -c  https://mirrors.aliyun.com/puppet/yum/puppet7/el/7/x86_64/puppet7-release-7.0.0-1.el7.noarch.rpm &amp;amp;&amp;amp;  rpm -Uvh puppet7-release-7.0.0-1.el7.noarch.rpm&lt;br /&gt;
&lt;br /&gt;
 rpm -Uvh https://yum.puppet.com/puppet6-release-el-7.noarch.rpm&lt;br /&gt;
&lt;br /&gt;
=== debian 10  or kali 2021  只能是 buster 注意 ===                                                                                                                                                &lt;br /&gt;
 &amp;lt;pre&amp;gt;                                                                                                                                                                            &lt;br /&gt;
 记得要改为google dns 8.8.4.4 or alidns                                                                                                                                      &lt;br /&gt;
 #wget -c https://apt.puppetlabs.com/puppet6-release-buster.deb &amp;amp;&amp;amp; dpkg  -i  puppet6-release-buster.deb              &lt;br /&gt;
&lt;br /&gt;
#on my kali &lt;br /&gt;
wget -c https://mirrors.aliyun.com/puppet/apt/puppet7-release-buster.deb &amp;amp;&amp;amp;  dpkg  -i puppet7-release-buster.deb&lt;br /&gt;
#https://mirrors.aliyun.com/puppet/apt/puppet6-release-buster.deb &amp;amp;&amp;amp;                                                         &lt;br /&gt;
                                                                                                                                                                             &lt;br /&gt;
 wget -c https://mirrors.aliyun.com/puppet/apt/puppet7-release-bullseye.deb        &amp;amp;&amp;amp; dpkg -i  puppet7-release-bullseye.deb #debian 11                                                                                                                                                               &lt;br /&gt;
 #wget  https://apt.puppet.com/puppet7-release-buster.deb  &amp;amp;&amp;amp; dpkg -i   puppet7-release-buster.deb                                                                     &lt;br /&gt;
 apt update       &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installing Puppet Server  ==                                                                                                                                                &lt;br /&gt;
&amp;lt;pre&amp;gt;    &lt;br /&gt;
&lt;br /&gt;
#问题 昨天在家里的 debian 11 安装不了 puppetserver &lt;br /&gt;
&lt;br /&gt;
但是在外网的debian10 是可以安装的 &lt;br /&gt;
&lt;br /&gt;
#base on RHEL &lt;br /&gt;
yum install puppetserver&lt;br /&gt;
&lt;br /&gt;
#base on  debina&lt;br /&gt;
apt update                                                                                                                                                                          &lt;br /&gt;
apt-get install puppetserver -y                                                                                                                                            &lt;br /&gt;
systemctl  enable puppetserver                                                                                                                                                                            &lt;br /&gt;
sudo systemctl start puppetserver                                                                                                                                          &lt;br /&gt;
                                                                                                                                                                             &lt;br /&gt;
 /opt/puppetlabs/server/apps/puppetserver/bin/puppetserver  -v                                                                                                               &lt;br /&gt;
 puppetserver version: 6.14.1                                                                                                                                                &lt;br /&gt;
                                                                                                                                                                             &lt;br /&gt;
 cp /etc/profile  /etc/profileevanbak                                                                                                                                        &lt;br /&gt;
 echo &amp;#039;export PATH=/opt/puppetlabs/server/apps/puppetserver/bin/:$PATH&amp;#039; &amp;gt;&amp;gt; /etc/profile                                                                                                                                                                                                                                            &lt;br /&gt;
                                                                                                                                                                         &lt;br /&gt;
apt-get install default-jdk                                                                                                                                                                                                                                                                                                                              &lt;br /&gt;
     &amp;lt;/pre&amp;gt;                                                                                                                                                                         &lt;br /&gt;
                                                                                                                                                                             &lt;br /&gt;
                                                                                                                                                                             &lt;br /&gt;
 [https://zhuanlan.zhihu.com/p/86308378 如何在 Debian 10 上安装 OpenJDK11/OpenJDK8]                                                                                          &lt;br /&gt;
                                                                                                                                                                             &lt;br /&gt;
                                                                                                                                                                             &lt;br /&gt;
 [https://linuxhint.com/install_jdk_debian_10/ Installing JDK on Debian 10]                                                                                                  &lt;br /&gt;
                                                                                                                                                                             &lt;br /&gt;
 https://puppet.com/docs/puppet/6.19/server/install_from_packages.html&lt;br /&gt;
&lt;br /&gt;
== * 3. Install Puppet agent ==&lt;br /&gt;
                                                                                                                                                 &lt;br /&gt;
=== ** RHEL ===&lt;br /&gt;
 rpm -Uvh  https://yum.puppet.com/puppet7-release-el-7.noarch.rpm                                                                                                         &lt;br /&gt;
                                                                                                                                                                             &lt;br /&gt;
 https://yum.puppet.com/puppet7-release-el-8.noarch.rpm                                                                                                                      &lt;br /&gt;
 https://yum.puppet.com/puppet6-release-el-7.noarch.rpm      &lt;br /&gt;
&lt;br /&gt;
=====**   =====&lt;br /&gt;
 &amp;lt;pre&amp;gt; cat /etc/yum.repos.d/puppet7.repo &lt;br /&gt;
[puppet7]&lt;br /&gt;
name=Puppet 7 Repository el 7 - $basearch&lt;br /&gt;
#baseurl=https://mirrors.aliyun.com/puppet/yum/puppet7/el/7/$basearch&lt;br /&gt;
baseurl=http://yum.puppetlabs.com/puppet7/el/7/$basearch&lt;br /&gt;
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-puppet7-release&lt;br /&gt;
       file:///etc/pki/rpm-gpg/RPM-GPG-KEY-2025-04-06-puppet7-release&lt;br /&gt;
enabled=1&lt;br /&gt;
gpgcheck=1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
yum clean all&lt;br /&gt;
yum makecache&lt;br /&gt;
                                                                                                                                                                       &lt;br /&gt;
yum install puppet-agent  &lt;br /&gt;
                                                                                                                                                  &lt;br /&gt;
                                                                                                                                                                             &lt;br /&gt;
 echo &amp;#039;export PATH=/opt/puppetlabs/bin:$PATH&amp;#039;  &amp;gt;&amp;gt; /etc/profile  &amp;amp;&amp;amp; source /etc/profile                                                                                 &lt;br /&gt;
                                                                                                                                                                         https://puppet.com/docs/puppet/6.19/install_agents.html                                                                                                                     &lt;br /&gt;
                                                                                                                                                                             &lt;br /&gt;
 Start the Puppet service: sudo /opt/puppetlabs/bin/puppet resource service puppet ensure=running enable=true                                                                &lt;br /&gt;
 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ** deb  ===&lt;br /&gt;
&amp;lt;pre&amp;gt;  apt-get install puppet-agent&lt;br /&gt;
&lt;br /&gt;
 source /etc/profile.d/puppet-agent.sh &lt;br /&gt;
&lt;br /&gt;
systemctl enable puppet &lt;br /&gt;
 systemctl start  puppet &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
cat  /etc/profile.d/puppet-agent.sh &lt;br /&gt;
# Add /opt/puppetlabs/bin to the path for sh compatible users&lt;br /&gt;
&lt;br /&gt;
if [ -z &amp;quot;${PATH-}&amp;quot; ] ; then&lt;br /&gt;
  export PATH=/opt/puppetlabs/bin&lt;br /&gt;
elif ! echo &amp;quot;${PATH}&amp;quot; | grep -q /opt/puppetlabs/bin ; then&lt;br /&gt;
  export PATH=&amp;quot;${PATH}:/opt/puppetlabs/bin&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if ! echo &amp;quot;${MANPATH-}&amp;quot; | grep -q /opt/puppetlabs/puppet/share/man ; then&lt;br /&gt;
  export MANPATH=&amp;quot;${MANPATH-}:/opt/puppetlabs/puppet/share/man&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
                         &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
https://puppet.com/docs/puppet/7/install_agents.html&lt;br /&gt;
&lt;br /&gt;
==* 4. Install PuppetDB (optional)==&lt;br /&gt;
&lt;br /&gt;
= =&lt;br /&gt;
&lt;br /&gt;
=configure=&lt;br /&gt;
&lt;br /&gt;
https://puppet.com/docs/puppet/7/install_agents.html#agent_primary_server_connections&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# 要先配置hosts &lt;br /&gt;
&lt;br /&gt;
#On the agent node, run:&lt;br /&gt;
puppet config set server puppetserver.example.com --section main&lt;br /&gt;
&lt;br /&gt;
#3. Connect the agent to the primary server and sign the certificate&lt;br /&gt;
&lt;br /&gt;
# on agent  node&lt;br /&gt;
puppet ssl bootstrap&lt;br /&gt;
&lt;br /&gt;
You will see a message that looks like:&lt;br /&gt;
&lt;br /&gt;
Info: Creating a new RSA SSL key for &amp;lt;agent node&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#On the primary server node, sign the certificate:&lt;br /&gt;
#puppetsrver &lt;br /&gt;
sudo puppetserver ca sign --certname &amp;lt;name&amp;gt;&lt;br /&gt;
#我是这个 其实最好不要这个 &lt;br /&gt;
puppetserver ca sign --all&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#On the agent node, run the agent again:&lt;br /&gt;
&lt;br /&gt;
puppet ssl bootstrap&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
== 相关配置文件==&lt;br /&gt;
===code on server===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
最开始的样子&lt;br /&gt;
[root@r code]# tree &lt;br /&gt;
.&lt;br /&gt;
├── environments&lt;br /&gt;
│   └── production&lt;br /&gt;
│       ├── data&lt;br /&gt;
│       ├── environment.conf&lt;br /&gt;
│       ├── hiera.yaml&lt;br /&gt;
│       ├── manifests&lt;br /&gt;
│       └── modules&lt;br /&gt;
└── modules&lt;br /&gt;
&lt;br /&gt;
6 directories, 2 files&lt;br /&gt;
[root@code]# pwd&lt;br /&gt;
/etc/puppetlabs/code&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===puppet server ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#官方文档就是666 唯一瑕疵 就是配置hosts 和  certname = puppetserver.example.com 好像没说到 还是我没看到呢  这次配置完成用官方文档了,今天就用了删除原来的key good&lt;br /&gt;
cat /etc/hosts&lt;br /&gt;
&lt;br /&gt;
127.0.0.1    puppetserver.example.com &lt;br /&gt;
192.168.10.32    puppetserver.example.com &lt;br /&gt;
192.168.10.39 puppetagent&lt;br /&gt;
192.168.10.33 puppetagent2&lt;br /&gt;
&lt;br /&gt;
cat /etc/puppetlabs/puppet/puppet.conf&lt;br /&gt;
&lt;br /&gt;
# This file can be used to override the default puppet settings.&lt;br /&gt;
# See the following links for more details on what settings are available:&lt;br /&gt;
# - https://puppet.com/docs/puppet/latest/config_important_settings.html&lt;br /&gt;
# - https://puppet.com/docs/puppet/latest/config_about_settings.html&lt;br /&gt;
# - https://puppet.com/docs/puppet/latest/config_file_main.html&lt;br /&gt;
# - https://puppet.com/docs/puppet/latest/configuration.html&lt;br /&gt;
[server]&lt;br /&gt;
vardir = /opt/puppetlabs/server/data/puppetserver&lt;br /&gt;
logdir = /var/log/puppetlabs/puppetserver&lt;br /&gt;
rundir = /var/run/puppetlabs/puppetserver&lt;br /&gt;
pidfile = /var/run/puppetlabs/puppetserver/puppetserver.pid&lt;br /&gt;
codedir = /etc/puppetlabs/code&lt;br /&gt;
[master]&lt;br /&gt;
certname = puppetserver.example.com&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===agent ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat /etc/hosts&lt;br /&gt;
127.0.0.1	localhost&lt;br /&gt;
#127.0.1.1	puppetserver.example.com	puppetserver&lt;br /&gt;
192.168.10.32 	puppetserver.example.com	puppetserver&lt;br /&gt;
127.0.1.1	puppetagent&lt;br /&gt;
&lt;br /&gt;
cat /etc/puppetlabs/puppet/puppet.conf &lt;br /&gt;
[main]&lt;br /&gt;
server = puppetserver.example.com&lt;br /&gt;
# This file can be used to override the default puppet settings.&lt;br /&gt;
# See the following links for more details on what settings are available:&lt;br /&gt;
# - https://puppet.com/docs/puppet/latest/config_important_settings.html&lt;br /&gt;
# - https://puppet.com/docs/puppet/latest/config_about_settings.html&lt;br /&gt;
# - https://puppet.com/docs/puppet/latest/config_file_main.html&lt;br /&gt;
# - https://puppet.com/docs/puppet/latest/configuration.html&lt;br /&gt;
[agent]&lt;br /&gt;
runinterval=30&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== agent2===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat /etc/hosts&lt;br /&gt;
127.0.0.1	localhost&lt;br /&gt;
127.0.1.1	puppetagent2&lt;br /&gt;
#debian11&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
192.168.10.32    puppetserver.example.com &lt;br /&gt;
&lt;br /&gt;
root@puppetagent2:~# cat /etc/puppetlabs/puppet/puppet.conf &lt;br /&gt;
[main]&lt;br /&gt;
server = puppetserver.example.com&lt;br /&gt;
[agent]&lt;br /&gt;
runinterval=30&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 这里的明天再补上 Sep 26&lt;br /&gt;
&lt;br /&gt;
= 全新 mastet  添加agent node(全新安装) 和证书配置=&lt;br /&gt;
==info==&lt;br /&gt;
  各自记得起hostname&lt;br /&gt;
 192.168.10.70 master.pu.com&lt;br /&gt;
 192.168.10.71 agent1.pu.com&lt;br /&gt;
&lt;br /&gt;
==add hosts==&lt;br /&gt;
&lt;br /&gt;
===master hosts===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
127.0.1.1	  puppet&lt;br /&gt;
192.168.10. 70 master.pu.com&lt;br /&gt;
192.168.10. 71 agent1.pu.com&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===agent1 hosts===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
192.168.10.70 master.pu.com&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==config ==&lt;br /&gt;
===on agent===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
puppet config set server master.pu.com --section main&lt;br /&gt;
&lt;br /&gt;
#改变半小时生效太长&lt;br /&gt;
cat /etc/puppetlabs/puppet/puppet.conf&lt;br /&gt;
[agent]&lt;br /&gt;
runinterval=30&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#生成证书&lt;br /&gt;
 puppet ssl bootstrap&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===on  master===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#On the primary server node, sign the certificate:&lt;br /&gt;
&lt;br /&gt;
puppetserver ca sign --certname agent1.pu.com&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 全部节点安装个软件试试==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root@master:/etc/puppetlabs/code/environments/production/manifests# cat  site.pp&lt;br /&gt;
node default {&lt;br /&gt;
    package { &amp;#039;tmux&amp;#039;:&lt;br /&gt;
     ensure =&amp;gt; present,&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=添加 agent node(全新安装) 和证书配置=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==add hosts==&lt;br /&gt;
=== add hosts on  server===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#puppet &lt;br /&gt;
#home&lt;br /&gt;
127.0.0.1    puppetserver.example.com &lt;br /&gt;
192.168.10.32    puppetserver.example.com &lt;br /&gt;
192.168.10.39 puppetagent&lt;br /&gt;
192.168.10.33 puppetagent2&lt;br /&gt;
192.168.10.38 puppetagent38&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
192.168.2.200 proxy-intra&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== add config and  hosts on  agent ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat /etc/hosts&lt;br /&gt;
&lt;br /&gt;
192.168.10.32    puppetserver.example.com &lt;br /&gt;
&lt;br /&gt;
cat /etc/puppetlabs/puppet/puppet.conf &lt;br /&gt;
[main]&lt;br /&gt;
server = puppetserver.example.com&lt;br /&gt;
&lt;br /&gt;
[agent]&lt;br /&gt;
runinterval=30&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 生成证书 on agent ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 evan]#  puppet ssl bootstrap&lt;br /&gt;
Info: csr_attributes file loading from /etc/puppetlabs/puppet/csr_attributes.yaml&lt;br /&gt;
Info: Creating a new SSL certificate request for proxy-intra&lt;br /&gt;
Info: Certificate Request fingerprint (SHA256): 14:49:D8:04:C7:3B:62:88:0A:20:91:22:15:72:49:37:A8:49:18:84:6A:BD:95:6B:3C:A3:0B:B6:42:8F:FD:9C&lt;br /&gt;
Info: Certificate for proxy-intra has not been signed yet&lt;br /&gt;
Couldn&amp;#039;t fetch certificate from CA server; you might still need to sign this agent&amp;#039;s certificate (proxy-intra).&lt;br /&gt;
Info: Will try again in 120 second&lt;br /&gt;
&lt;br /&gt;
#注意  一般server 接受了证书后 还要过几分钟才完成 最终提示如下 &lt;br /&gt;
&lt;br /&gt;
Notice: Completed SSL initialization&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 接受证书 on server ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#certname 看生成证书时的提醒 一般是你的node agent的hostname &lt;br /&gt;
puppetserver ca sign --certname  proxy-intra&lt;br /&gt;
&lt;br /&gt;
#执行完成 提示如下 &lt;br /&gt;
Successfully signed certificate request for proxy-intra&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=添加 agent node(非全新安装) 和证书配置=&lt;br /&gt;
官方文档最6  &lt;br /&gt;
https://puppet.com/docs/puppet/7/ssl_regenerate_certificates.html&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
puppetserver ca   list  --all&lt;br /&gt;
Signed Certificates:&lt;br /&gt;
&lt;br /&gt;
    idc-test-all-db-192-168-10-120-c7          (SHA256)  AF:EA:3F:3D:97:71:04:76:5D:5B:B2:C2:91:98:2A:1:7A:19:44:F6:BD:B2:EB:B2:F1:2E:95:CA:D3:06	alt names: [&amp;quot;DNS:idc-test-all-db-192-168-10-120-c7&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#先删除原来存在的了key  on server   这几步 也是 puppet rror: The certificate for &amp;#039;CN=&amp;#039; does not match its private key的解决办法 &lt;br /&gt;
puppetserver ca clean --certname  idc-test-all-db-192-168-10-120-c7 &lt;br /&gt;
puppetserver ca clean --certname idc-test-all-php-192-168-10-122-c7&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#如果有老的key 不是新安装 &lt;br /&gt;
cd  /etc/puppetlabs/puppet/ssl/certs/&lt;br /&gt;
rm  -f ca.pem  idc-test-all-db-192-168-10-120-c7.pem&lt;br /&gt;
&lt;br /&gt;
# if on node  puppet client &lt;br /&gt;
systemctl  restart puppet&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#agent node &lt;br /&gt;
root@debian11# puppet ssl bootstrap&lt;br /&gt;
Info: csr_attributes file loading from /etc/puppetlabs/puppet/csr_attributes.yaml&lt;br /&gt;
Info: Creating a new SSL certificate request for idc-test-all-php-192-168-10-122-c7&lt;br /&gt;
Info: Certificate Request fingerprint (SHA256): 7D:9F:B7:68:B3::84:06:6D:90:49:9C:8F:76:D7:3A:25:C9:98:E0:2F:0D:39:E1:95:A6:BB:EE:B1:27&lt;br /&gt;
Info: Certificate for idc-test-all-php-192-168-10-122-c7 has not been signed yet&lt;br /&gt;
Couldn&amp;#039;t fetch certificate from CA server; you might still need to sign this agent&amp;#039;s certificate (idc-test-all-php-192-168-10-122-c7).&lt;br /&gt;
Info: Will try again in 120 seconds.&lt;br /&gt;
&lt;br /&gt;
#这个是接受后成功的提示 ,如果只有这个提示 没有前面的 那就是在servrer 存在了相同的了 &lt;br /&gt;
Notice: Completed SSL initialization&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#sever 上接受 成功喽 &lt;br /&gt;
#单独一个  &lt;br /&gt;
puppetserver ca sign --certname  puppet2021&lt;br /&gt;
&lt;br /&gt;
puppetserver ca sign   --all&lt;br /&gt;
Successfully signed certificate request for idc-test-all-php-192-168-10-122-c7&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#这个命令还是不成功 &lt;br /&gt;
puppetserver ca sign  idc-test-all-php-192-168-10-122-c7&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
例如&lt;br /&gt;
#最后在master 接受的证书名是以hostname的哦  最好是事先起好hostname,虽然我hosts文件配置为puppet38 配置任务用这个也是成功的 ,不过还是不够规范&lt;br /&gt;
 puppetserver ca sign   --all&lt;br /&gt;
Successfully signed certificate request for debian11&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=默认30分钟太久=&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#on agent  120 秒  ,2 分钟 &lt;br /&gt;
vi  /etc/puppetlabs/puppet/puppet.conf &lt;br /&gt;
[agent]&lt;br /&gt;
server = master.test.cn&lt;br /&gt;
runinterval=120&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=入门例子=&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#安装到所有节点  默认是半个小时成效 可以手工执行&lt;br /&gt;
 cat /etc/puppetlabs/code/environments/production/manifests/site.pp&lt;br /&gt;
node default {&lt;br /&gt;
    package { &amp;#039;emacs&amp;#039;:&lt;br /&gt;
     ensure =&amp;gt; present,&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# 笨方法  两个节点安装 w3m &lt;br /&gt;
 cat /etc/puppetlabs/code/environments/production/manifests/site.pp&lt;br /&gt;
node &amp;#039;puppetagent&amp;#039; {&lt;br /&gt;
    package { &amp;#039;w3m&amp;#039;:&lt;br /&gt;
     ensure =&amp;gt; present,&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
node &amp;#039;puppetagent2&amp;#039; {&lt;br /&gt;
    package { &amp;#039;w3m&amp;#039;:&lt;br /&gt;
     ensure =&amp;gt; present,&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==第一个file 例子==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#on server&lt;br /&gt;
#cat /etc/puppetlabs/code/environments/production/manifests/site.pp&lt;br /&gt;
node default {&lt;br /&gt;
    file { &amp;quot;/tmp/oct28.txt&amp;quot;:&lt;br /&gt;
     content =&amp;gt; &amp;quot;hey  first puppet file&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#结果 随便找个 agent node &lt;br /&gt;
root@puppetagent:~# cat /tmp/oct28.txt &lt;br /&gt;
hey  first puppet file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==第一个shell 命令例子==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 cat site.pp&lt;br /&gt;
node default {&lt;br /&gt;
    Exec {path =&amp;gt;&amp;quot;/bin:/sbin:/bin/sh:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin&amp;quot;}&lt;br /&gt;
    exec { &amp;quot;touch files&amp;quot;:&lt;br /&gt;
     command =&amp;gt; &amp;quot;/usr/bin/touch /tmp/mytouch.txt&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==第一个 配置一个测试节点 modules ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
cd /etc/puppetlabs/code/environments/production/modules&lt;br /&gt;
root@master:/etc/puppetlabs/code/environments/production/modules# &lt;br /&gt;
mkdir -p  test/{manifests,templates,files}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
vi templates/test.erb &lt;br /&gt;
hostname &amp;lt;%= fqdn %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
vi  manifests/init.pp&lt;br /&gt;
class  test {&lt;br /&gt;
    file {&amp;quot;/tmp/$hostname.txt&amp;quot;: content =&amp;gt; &amp;quot;hey world&amp;quot;;}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
root@master:/etc/puppetlabs/code/environments/production/manifests# mkdir nodes&lt;br /&gt;
&lt;br /&gt;
vi agent1.pu.com.pp&lt;br /&gt;
node &amp;#039;agent1.pu.com&amp;#039; {&lt;br /&gt;
   include test&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
主动拉取&lt;br /&gt;
root@agent1:~# puppet agent -t &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 cat   ../site.pp&lt;br /&gt;
node default {&lt;br /&gt;
    package { &amp;#039;tree&amp;#039;:&lt;br /&gt;
     ensure =&amp;gt; present,&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#其实只要这行 上面和下面的全可不要 &lt;br /&gt;
import &amp;quot;nodes/agent1.pu.pp&amp;quot;&lt;br /&gt;
#include的写法  但是好像有问题  这个所有的 &lt;br /&gt;
import  &amp;quot;nodes/*.pp&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
成功  暂时是只有  agent1 有,因为开始只是node 里只有 agent1  &lt;br /&gt;
root@agent1:~# cat /tmp/agent1.txt &lt;br /&gt;
hey world&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
trouble shooting &lt;br /&gt;
&lt;br /&gt;
 The certificate for &amp;#039;CN=idc-test-all-php-192-168-10-122-c7&amp;#039; does not matc&amp;gt;&lt;br /&gt;
11月 21 22:25:11 myxps puppet-agent[34301]: The certificate for &amp;#039;CN=idc-test-all-php-192-168-10-122-c7&amp;#039; does not matc&amp;gt;&lt;br /&gt;
~&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=video=&lt;br /&gt;
[https://www.bilibili.com/video/BV1H7411u7mu?p=5 Puppet自动化运维企业实战]&lt;br /&gt;
&lt;br /&gt;
=进阶=&lt;br /&gt;
[https://www.cnblogs.com/along21/p/10369858.html  企业级自动化运维工具---puppet详解 ]&lt;br /&gt;
&lt;br /&gt;
[https://www.cnblogs.com/keerya/p/8040071.html  自动化运维工具——puppet详解（一） ]&lt;br /&gt;
&lt;br /&gt;
[https://www.cnblogs.com/keerya/p/8087675.html  自动化运维工具——puppet详解（二） ]&lt;br /&gt;
&lt;br /&gt;
=see also=&lt;br /&gt;
&lt;br /&gt;
=trouble shooting=&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
root@master:~# puppetserver ca sign --certname agent1.pu.com&lt;br /&gt;
Fatal error when running action &amp;#039;sign&amp;#039;&lt;br /&gt;
  Error: Failed connecting to https://puppet:8140/puppet-ca/v1/certificate_status/&lt;br /&gt;
  Root cause: Failed to open TCP connection to puppet:8140 (getaddrinfo: Name or service not known)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
root@master:~#  cat /etc/hosts&lt;br /&gt;
&lt;br /&gt;
127.0.1.1	 puppet&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=references=&lt;br /&gt;
https://en.wikipedia.org/wiki/Puppet_(software)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[https://www.cnblogs.com/baizhantang/p/3208210.html  puppet批量管理500多台服务器 ]&lt;br /&gt;
&lt;br /&gt;
[https://www.cnblogs.com/kevingrace/p/5740984.html  Puppet常识梳理 ]&lt;br /&gt;
&lt;br /&gt;
[http://www.srcmini.com/41406.html Puppet组件详解]&lt;br /&gt;
&lt;br /&gt;
[http://www.srcmini.com/41401.html Puppet类用法示例]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[https://www.cnblogs.com/krainbow/p/4212056.html  puppet多环境配置（puppet自动化系列2） ]&lt;br /&gt;
&lt;br /&gt;
[https://www.cnblogs.com/krainbow/p/4212048.html  puppet初始化安装和配置（puppet自动化系列1） ]&lt;br /&gt;
&lt;br /&gt;
[https://www.meirenji.info/2018/09/03/puppet%E8%87%AA%E5%8A%A8%E5%8C%96%E5%B8%83%E7%BD%B2%E9%85%8D%E7%BD%AE%E5%85%A5%E9%97%A8/ puppet自动化布署配置入门]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[https://www.cnblogs.com/sddai/p/11031885.html  Puppet自动化管理配置 ]&lt;br /&gt;
&lt;br /&gt;
[https://www.jianshu.com/p/63234d526866 puppet入门]&lt;br /&gt;
&lt;br /&gt;
[https://blog.51cto.com/u_433266/2176059?xiangguantuijian&amp;amp;06 Puppet 实验五 软件安装测试]&lt;br /&gt;
&lt;br /&gt;
Usage &lt;br /&gt;
&lt;br /&gt;
[https://www.zsythink.net/archives/331  puppet入门：puppet使用基础（puppet 5） ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[https://www.linuxidc.com/Linux/2012-12/75979.htm Puppet批量部署实际案例]&lt;br /&gt;
&lt;br /&gt;
[https://www.cnblogs.com/Dicky-Zhang/p/6260127.html puppet的配置]&lt;br /&gt;
&lt;br /&gt;
==应用例子 ==&lt;br /&gt;
&lt;br /&gt;
[https://blog.51cto.com/forall/1913534  Puppet批量部署tomcat]&lt;br /&gt;
&lt;br /&gt;
[https://blog.csdn.net/weixin_33964094/article/details/92921026  Puppet批量部署tomcat]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[category:devops]]&lt;/div&gt;</summary>
		<author><name>Evan</name></author>
	</entry>
</feed>