如题所示,本文将在RHEL7.6的系统上部署Puppet。
本文涉及的是Puppet的服务端的配置。

Puppet:
官网:https://puppet.com/
官方下载地址:https://puppet.com/download-puppet-enterprise
旧的版本的下载地址:https://puppet.com/misc/pe-files/previous-releases

【Puppet】官方网站

环境说明:
IP: 192.168.40.252
OS: RHEL 7.6
防火墙:关闭并禁用
SELINUX:关闭并禁用

来看看操作系统上的当前状态:

[root@puppet ~]# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 7.6 (Maipo)
[root@puppet ~]# 
[root@puppet ~]# ifconfig
ens32: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.40.252  netmask 255.255.255.0  broadcast 192.168.40.255
        inet6 fe80::3d39:79ab:a10b:aef5  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:f4:4c:7a  txqueuelen 1000  (Ethernet)
        RX packets 1783  bytes 153110 (149.5 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 836  bytes 99010 (96.6 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 64  bytes 5472 (5.3 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 64  bytes 5472 (5.3 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

[root@puppet ~]# 
[root@puppet ~]# service firewalld status
Redirecting to /bin/systemctl status firewalld.service
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man:firewalld(1)
[root@puppet ~]# 
[root@puppet ~]# sestatus 
SELinux status:                 disabled
[root@puppet ~]# 
[root@puppet ~]# cat /etc/selinux/config 

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected. 
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted 


[root@puppet ~]# 

配置YUM:

源:本地 – ISO镜像

[root@puppet ~]# cat /etc/yum.conf 
[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=1
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=3

#  This is the default, if you make this bigger yum won't see if the metadata
# is newer on the remote and so you'll "gain" the bandwidth of not having to
# download the new metadata and "pay" for it by yum not having correct
# information.
#  It is esp. important, to have correct metadata, for distributions like
# Fedora which don't keep old packages around. If you don't like this checking
# interupting your command line usage, it's much better to have something
# manually check the metadata once an hour (yum-updatesd will do this).
# metadata_expire=90m

# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d
[root@puppet ~]# 
[root@puppet ~]# ls -ltr /etc/yum.repos.d/
total 4
-rw-r--r-- 1 root root 511 Jul 31 19:18 local_iso.repo
[root@puppet ~]# 
[root@puppet ~]# cat /etc/yum.repos.d/local_iso.repo 
# Local: ISO: Repository
# Usage:
# 1. /etc/yum.conf
# 2. /etc/yum.repos.d
# 3. yum repolist

# For: RHEL 7.x
# ============================================

[ISO-BASE]
name=ISO-BASE
baseurl=file:///iso
gpgcheck=0

[ISO-ADDONS-ResilientStorage]
name=ISO-ResilientStorage
baseurl=file:///iso/addons/ResilientStorage
gpgcheck=0

[ISO-ADDONS-HighAvailability]
name=ISO-HighAvailability
baseurl=file:///iso/addons/HighAvailability
gpgcheck=0

# ============================================
[root@puppet ~]# 
[root@puppet ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda3        18G  1.6G   17G   9% /
devtmpfs        900M     0  900M   0% /dev
tmpfs           910M     0  910M   0% /dev/shm
tmpfs           910M  9.6M  901M   2% /run
tmpfs           910M     0  910M   0% /sys/fs/cgroup
/dev/sda1       297M  127M  171M  43% /boot
tmpfs           182M     0  182M   0% /run/user/0
[root@puppet ~]# 
[root@puppet ~]# mkdir /iso
[root@puppet ~]# 
[root@puppet ~]# mount /dev/sr0 /iso/
mount: /dev/sr0 is write-protected, mounting read-only
[root@puppet ~]# 
[root@puppet ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda3        18G  1.6G   17G   9% /
devtmpfs        900M     0  900M   0% /dev
tmpfs           910M     0  910M   0% /dev/shm
tmpfs           910M  9.6M  901M   2% /run
tmpfs           910M     0  910M   0% /sys/fs/cgroup
/dev/sda1       297M  127M  171M  43% /boot
tmpfs           182M     0  182M   0% /run/user/0
/dev/sr0        4.2G  4.2G     0 100% /iso
[root@puppet ~]# 
[root@puppet ~]# yum repolist
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
ISO-ADDONS-HighAvailability                                                                                                                   | 4.3 kB  00:00:00     
ISO-ADDONS-ResilientStorage                                                                                                                   | 4.3 kB  00:00:00     
ISO-BASE                                                                                                                                      | 4.3 kB  00:00:00     
(1/6): ISO-ADDONS-HighAvailability/primary_db                                                                                                 |  33 kB  00:00:01     
(2/6): ISO-ADDONS-HighAvailability/group_gz                                                                                                   | 3.5 kB  00:00:01     
(3/6): ISO-ADDONS-ResilientStorage/group_gz                                                                                                   | 5.1 kB  00:00:01     
(4/6): ISO-ADDONS-ResilientStorage/primary_db                                                                                                 |  39 kB  00:00:01     
(5/6): ISO-BASE/group_gz                                                                                                                      | 146 kB  00:00:01     
(6/6): ISO-BASE/primary_db                                                                                                                    | 4.2 MB  00:00:00     
repo id                                                                            repo name                                                                   status
ISO-ADDONS-HighAvailability                                                        ISO-HighAvailability                                                           51
ISO-ADDONS-ResilientStorage                                                        ISO-ResilientStorage                                                           56
ISO-BASE                                                                           ISO-BASE                                                                    5,152
repolist: 5,259
[root@puppet ~]# 

源:网络 – EPEL

阿里云镜像站:https://opsx.alibaba.com/mirror
清华大学镜像站:https://mirror.tuna.tsinghua.edu.cn/help/centos/
腾讯云镜像站:https://mirrors.cloud.tencent.com/

[root@puppet ~]# wget -O /etc/yum.repos.d/Tencent_CENTOS_BASE.repo http://mirrors.cloud.tencent.com/repo/centos7_base.repo                         
--2019-08-05 18:01:32--  http://mirrors.cloud.tencent.com/repo/centos7_base.repo
Resolving mirrors.cloud.tencent.com (mirrors.cloud.tencent.com)... 111.231.36.190
Connecting to mirrors.cloud.tencent.com (mirrors.cloud.tencent.com)|111.231.36.190|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1923 (1.9K) [application/octet-stream]
Saving to: ‘/etc/yum.repos.d/Tencent_CENTOS_BASE.repo’

100%[===========================================================================================================================>] 1,923       --.-K/s   in 0s      

2019-08-05 18:01:32 (109 MB/s) - ‘/etc/yum.repos.d/Tencent_CENTOS_BASE.repo’ saved [1923/1923]

[root@puppet ~]# 
[root@puppet ~]# wget -O /etc/yum.repos.d/ALIYUN_CentOS_Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo 
--2019-08-05 18:03:25--  http://mirrors.aliyun.com/repo/Centos-7.repo
Resolving mirrors.aliyun.com (mirrors.aliyun.com)... 111.63.49.199, 111.62.69.238
Connecting to mirrors.aliyun.com (mirrors.aliyun.com)|111.63.49.199|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2523 (2.5K) [application/octet-stream]
Saving to: ‘/etc/yum.repos.d/ALIYUN_CentOS_Base.repo’

100%[===========================================================================================================================>] 2,523       --.-K/s   in 0s      

2019-08-05 18:03:25 (125 MB/s) - ‘/etc/yum.repos.d/ALIYUN_CentOS_Base.repo’ saved [2523/2523]

[root@puppet ~]# 
[root@puppet ~]# cd /etc/yum.repos.d/
[root@puppet yum.repos.d]# 
[root@puppet yum.repos.d]# vi TSINGHUA_CENTOS_BASE.repo
[root@puppet yum.repos.d]# 
[root@puppet yum.repos.d]# ls -ltr
total 20
-rw-r--r-- 1 root root 2523 Jun 15  2018 ALIYUN_CentOS_Base.repo
-rw-r--r-- 1 root root 1923 Jul  4 05:02 Tencent_CENTOS_BASE.repo
-rw-r--r-- 1 root root  511 Jul 31 19:18 local_iso.repo
-rw-r--r-- 1 root root  358 Aug  5 17:39 redhat.repo
-rw-r--r-- 1 root root 1657 Aug  5 18:02 TSINGHUA_CENTOS_BASE.repo
[root@puppet yum.repos.d]# 
[root@puppet yum.repos.d]# sed -i 's/\$releasever/7/g' *
[root@puppet yum.repos.d]# sed -i '/gpgcheck/s/1/0/g' * 
[root@puppet yum.repos.d]# 
[root@puppet yum.repos.d]# yum repolist
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository extras is listed more than once in the configuration
repo id                                                                  repo name                                                                             status
ISO-ADDONS-HighAvailability                                              ISO-HighAvailability                                                                      51
ISO-ADDONS-ResilientStorage                                              ISO-ResilientStorage                                                                      56
ISO-BASE                                                                 ISO-BASE                                                                               5,152
base/x86_64                                                              CentOS-7 - Base - mirrors.aliyun.com                                                  10,019
extras/x86_64                                                            CentOS-7 - Extras - mirrors.aliyun.com                                                   419
os/x86_64                                                                Qcloud centos os - x86_64                                                             10,019
updates/x86_64                                                           CentOS-7 - Updates - mirrors.aliyun.com                                                2,500
repolist: 28,216
[root@puppet yum.repos.d]# 

服务配置:【NTP】

[root@puppet ~]# yum list | grep ntp
fontpackages-filesystem.noarch          1.44-8.el7                 @anaconda/7.6
ntpdate.x86_64                          4.2.6p5-28.el7             @anaconda/7.6
ntp.x86_64                              4.2.6p5-28.el7             ISO-BASE     
python-ntplib.noarch                    0.3.2-1.el7                ISO-BASE     
[root@puppet ~]# 
[root@puppet ~]# yum install ntp
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Resolving Dependencies
--> Running transaction check
---> Package ntp.x86_64 0:4.2.6p5-28.el7 will be installed
--> Processing Dependency: libopts.so.25()(64bit) for package: ntp-4.2.6p5-28.el7.x86_64
--> Running transaction check
---> Package autogen-libopts.x86_64 0:5.18-5.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=====================================================================================================================================================================
 Package                                    Arch                              Version                                      Repository                           Size
=====================================================================================================================================================================
Installing:
 ntp                                        x86_64                            4.2.6p5-28.el7                               ISO-BASE                            549 k
Installing for dependencies:
 autogen-libopts                            x86_64                            5.18-5.el7                                   ISO-BASE                             66 k

Transaction Summary
=====================================================================================================================================================================
Install  1 Package (+1 Dependent package)

Total download size: 615 k
Installed size: 1.5 M
Is this ok [y/d/N]: y
Downloading packages:
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                 15 MB/s | 615 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : autogen-libopts-5.18-5.el7.x86_64                                                                                                                 1/2 
  Installing : ntp-4.2.6p5-28.el7.x86_64                                                                                                                         2/2 
ISO-ADDONS-HighAvailability/productid                                                                                                         | 1.6 kB  00:00:00     
ISO-ADDONS-ResilientStorage/productid                                                                                                         | 1.6 kB  00:00:00     
ISO-BASE/productid                                                                                                                            | 1.6 kB  00:00:00     
  Verifying  : autogen-libopts-5.18-5.el7.x86_64                                                                                                                 1/2 
  Verifying  : ntp-4.2.6p5-28.el7.x86_64                                                                                                                         2/2 

Installed:
  ntp.x86_64 0:4.2.6p5-28.el7                                                                                                                                        

Dependency Installed:
  autogen-libopts.x86_64 0:5.18-5.el7                                                                                                                                

Complete!
[root@puppet ~]# 

配置NTP:

[root@puppet ~]# ls -ltr /etc/ | grep ntp
-rw-r--r--   1 root root     1992 Oct  9  2017 ntp.conf
drwxr-xr-x.  3 root root       52 Aug  5 17:40 ntp
[root@puppet ~]# 
[root@puppet ~]# cp /etc/ntp.conf /etc/ntp.conf_orig_20190806_1
[root@puppet ~]# 
[root@puppet ~]# ls -ltr /etc/ | grep ntp                      
-rw-r--r--   1 root root     1992 Oct  9  2017 ntp.conf
drwxr-xr-x.  3 root root       52 Aug  5 17:40 ntp
-rw-r--r--   1 root root     1992 Aug  5 17:42 ntp.conf_orig_20190806_1
[root@puppet ~]# 
[root@puppet ~]# vi /etc/ntp.conf
[root@puppet ~]# 
[root@puppet ~]# cat /etc/ntp.conf
# For more information about this file, see the man pages
# ntp.conf(5), ntp_acc(5), ntp_auth(5), ntp_clock(5), ntp_misc(5), ntp_mon(5).

driftfile /var/lib/ntp/drift

# Permit time synchronization with our time source, but do not
# permit the source to query or modify the service on this system.
restrict default nomodify notrap nopeer noquery

# Permit all access over the loopback interface.  This could
# be tightened as well, but to do so would effect some of
# the administrative functions.
restrict 127.0.0.1 
restrict ::1

# Hosts on local network are less restricted.
#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap

# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
#server 0.rhel.pool.ntp.org iburst
#server 1.rhel.pool.ntp.org iburst
#server 2.rhel.pool.ntp.org iburst
#server 3.rhel.pool.ntp.org iburst

server 127.127.1.0
fudge 127.127.1.0 stratum 3

#broadcast 192.168.1.255 autokey        # broadcast server
#broadcastclient                        # broadcast client
#broadcast 224.0.1.1 autokey            # multicast server
#multicastclient 224.0.1.1              # multicast client
#manycastserver 239.255.254.254         # manycast server
#manycastclient 239.255.254.254 autokey # manycast client

# Enable public key cryptography.
#crypto

includefile /etc/ntp/crypto/pw

# Key file containing the keys and key identifiers used when operating
# with symmetric key cryptography. 
keys /etc/ntp/keys

# Specify the key identifiers which are trusted.
#trustedkey 4 8 42

# Specify the key identifier to use with the ntpdc utility.
#requestkey 8

# Specify the key identifier to use with the ntpq utility.
#controlkey 8

# Enable writing of statistics records.
#statistics clockstats cryptostats loopstats peerstats

# Disable the monitoring facility to prevent amplification attacks using ntpdc
# monlist command when default restrict does not include the noquery flag. See
# CVE-2013-5211 for more details.
# Note: Monitoring will not be disabled with the limited restriction flag.
disable monitor
[root@puppet ~]# 
[root@puppet ~]# diff /etc/ntp.conf /etc/ntp.conf_orig_20190806_1 
21,27c21,24
< #server 0.rhel.pool.ntp.org iburst
< #server 1.rhel.pool.ntp.org iburst
< #server 2.rhel.pool.ntp.org iburst
< #server 3.rhel.pool.ntp.org iburst
< 
< server 127.127.1.0
< fudge 127.127.1.0 stratum 3
---
> server 0.rhel.pool.ntp.org iburst
> server 1.rhel.pool.ntp.org iburst
> server 2.rhel.pool.ntp.org iburst
> server 3.rhel.pool.ntp.org iburst
[root@puppet ~]# 

启动NTP服务:

[root@puppet ~]# service ntpd status
Redirecting to /bin/systemctl status ntpd.service
● ntpd.service - Network Time Service
   Loaded: loaded (/usr/lib/systemd/system/ntpd.service; disabled; vendor preset: disabled)
   Active: inactive (dead)
[root@puppet ~]# 
[root@puppet ~]# chkconfig ntpd on
Note: Forwarding request to 'systemctl enable ntpd.service'.
Created symlink from /etc/systemd/system/multi-user.target.wants/ntpd.service to /usr/lib/systemd/system/ntpd.service.
[root@puppet ~]# 
[root@puppet ~]# service ntpd start
Redirecting to /bin/systemctl start ntpd.service
[root@puppet ~]# 
[root@puppet ~]# service ntpd status
Redirecting to /bin/systemctl status ntpd.service
● ntpd.service - Network Time Service
   Loaded: loaded (/usr/lib/systemd/system/ntpd.service; enabled; vendor preset: disabled)
   Active: active (running) since Mon 2019-08-05 17:45:43 PDT; 5s ago
  Process: 36535 ExecStart=/usr/sbin/ntpd -u ntp:ntp $OPTIONS (code=exited, status=0/SUCCESS)
 Main PID: 36536 (ntpd)
   CGroup: /system.slice/ntpd.service
           └─36536 /usr/sbin/ntpd -u ntp:ntp -g

Aug 05 17:45:43 puppet.adamhuan.com ntpd[36536]: Listen normally on 2 lo 127.0.0.1 UDP 123
Aug 05 17:45:43 puppet.adamhuan.com ntpd[36536]: Listen normally on 3 ens32 192.168.40.252 UDP 123
Aug 05 17:45:43 puppet.adamhuan.com ntpd[36536]: Listen normally on 4 lo ::1 UDP 123
Aug 05 17:45:43 puppet.adamhuan.com ntpd[36536]: Listen normally on 5 ens32 fe80::3d39:79ab:a10b:aef5 UDP 123
Aug 05 17:45:43 puppet.adamhuan.com ntpd[36536]: Listening on routing socket on fd #22 for interface updates
Aug 05 17:45:43 puppet.adamhuan.com ntpd[36536]: refclock_open /dev/hpgps0: No such file or directory
Aug 05 17:45:43 puppet.adamhuan.com ntpd[36536]: 127.127.26.0 interface 127.0.0.1 -> (none)
Aug 05 17:45:43 puppet.adamhuan.com ntpd[36536]: 0.0.0.0 c016 06 restart
Aug 05 17:45:43 puppet.adamhuan.com ntpd[36536]: 0.0.0.0 c012 02 freq_set kernel 0.000 PPM
Aug 05 17:45:43 puppet.adamhuan.com ntpd[36536]: 0.0.0.0 c011 01 freq_not_set
[root@puppet ~]#

查看NTP状态:

[root@puppet ~]# ntpstat 
synchronised to local net at stratum 4 
   time correct to within 7948 ms
   polling server every 64 s
[root@puppet ~]# 

这样,NTP的服务就配置好了。


规划主机名;
文件:/etc/hosts

[root@puppet ~]# vi /etc/hosts
[root@puppet ~]# 
[root@puppet ~]# cat /etc/hosts
#127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
#::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

# Local
127.0.0.1       localhost

# Pub
# --> eg.
#192.168.40.254 linux

# --> Puppet: server side
192.168.40.252  puppet puppet.adamhuan.com

# --> Puppet: client side

# =====================
# Finished.
[root@puppet ~]# 
[root@puppet ~]# hostname       
puppet.adamhuan.com
[root@puppet ~]# 
[root@puppet ~]# ping -c 3 `hostname`
PING puppet (192.168.40.252) 56(84) bytes of data.
64 bytes from puppet (192.168.40.252): icmp_seq=1 ttl=64 time=0.015 ms
64 bytes from puppet (192.168.40.252): icmp_seq=2 ttl=64 time=0.061 ms
64 bytes from puppet (192.168.40.252): icmp_seq=3 ttl=64 time=0.072 ms

--- puppet ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 1998ms
rtt min/avg/max/mdev = 0.015/0.049/0.072/0.025 ms
[root@puppet ~]# 

软件包支持:EPEL

[root@puppet yum.repos.d]# yum list | grep epel
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository extras is listed more than once in the configuration
epel-release.noarch                       7-11                     extras       
[root@puppet yum.repos.d]# 
[root@puppet yum.repos.d]# yum install -y epel-release
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Resolving Dependencies
--> Running transaction check
---> Package epel-release.noarch 0:7-11 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=====================================================================================================================================================================
 Package                                     Arch                                  Version                               Repository                             Size
=====================================================================================================================================================================
Installing:
 epel-release                                noarch                                7-11                                  extras                                 15 k

Transaction Summary
=====================================================================================================================================================================
Install  1 Package

Total download size: 15 k
Installed size: 24 k
Downloading packages:
epel-release-7-11.noarch.rpm                                                                                                                  |  15 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : epel-release-7-11.noarch                                                                                                                          1/1 
  Verifying  : epel-release-7-11.noarch                                                                                                                          1/1 

Installed:
  epel-release.noarch 0:7-11                                                                                                                                         

Complete!
[root@puppet yum.repos.d]# 
[root@puppet yum.repos.d]# yum repolist
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository extras is listed more than once in the configuration
epel/x86_64/metalink                                                                                                                          | 8.4 kB  00:00:00     
epel                                                                                                                                          | 5.4 kB  00:00:00     
(1/3): epel/x86_64/group_gz                                                                                                                   |  88 kB  00:00:01     
(2/3): epel/x86_64/updateinfo                                                                                                                 | 996 kB  00:00:02     
(3/3): epel/x86_64/primary_db                                                                                                                 | 6.8 MB  00:00:03     
repo id                                                               repo name                                                                                status
ISO-ADDONS-HighAvailability                                           ISO-HighAvailability                                                                         51
ISO-ADDONS-ResilientStorage                                           ISO-ResilientStorage                                                                         56
ISO-BASE                                                              ISO-BASE                                                                                  5,152
base/x86_64                                                           CentOS-7 - Base - mirrors.aliyun.com                                                     10,019
epel/x86_64                                                           Extra Packages for Enterprise Linux 7 - x86_64                                           13,336
extras/x86_64                                                         CentOS-7 - Extras - mirrors.aliyun.com                                                      419
os/x86_64                                                             Qcloud centos os - x86_64                                                                10,019
updates/x86_64                                                        CentOS-7 - Updates - mirrors.aliyun.com                                                   2,500
repolist: 41,552
[root@puppet yum.repos.d]# 

安装:PUPPET

EPEL:

[root@puppet yum.repos.d]# yum list | grep --color puppet
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository extras is listed more than once in the configuration
dmlite-puppet-dpm.noarch                1.12.1-1.el7                    epel    
puppet.noarch                           3.6.2-3.el7                     epel    
puppet-firewalld.noarch                 0.1.3-1.el7                     epel    
puppet-server.noarch                    3.6.2-3.el7                     epel    
puppetlabs-stdlib.noarch                4.25.1-1.el7                    epel    
rubygem-puppet-lint.noarch              1.1.0-2.el7                     epel    
rubygem-puppet-lint-doc.noarch          1.1.0-2.el7                     epel    
[root@puppet yum.repos.d]# 

官方网站:puppet.com

下载地址:

Puppet Enterprise
--> Master
RHEL8:
https://pm.puppet.com/cgi-bin/download.cgi?dist=el&rel=8&arch=x86_64&ver=latest 
RHEL7:
https://pm.puppet.com/cgi-bin/download.cgi?dist=el&rel=7&arch=x86_64&ver=latest 
RHEL6:
https://pm.puppet.com/cgi-bin/download.cgi?dist=el&rel=6&arch=x86_64&ver=latest 
Ubuntu18.04:
https://pm.puppet.com/cgi-bin/download.cgi?dist=ubuntu&rel=18.04&arch=amd64&ver=latest 
Ubuntu16.04:
https://pm.puppet.com/cgi-bin/download.cgi?dist=ubuntu&rel=16.04&arch=amd64&ver=latest 
SUSE12:
https://pm.puppet.com/cgi-bin/download.cgi?dist=sles&rel=12&arch=x86_64&ver=latest 
--> Agent
RHEL8:
https://pm.puppet.com/puppet-agent/2019.1.1/6.4.3/repos/el/8/puppet6/x86_64/puppet-agent-6.4.3-1.el8.x86_64.rpm 
RHEL7:
https://pm.puppet.com/puppet-agent/2019.1.1/6.4.3/repos/el/7/puppet6/x86_64/puppet-agent-6.4.3-1.el7.x86_64.rpm 
RHEL6:
https://pm.puppet.com/puppet-agent/2019.1.1/6.4.3/repos/el/6/puppet6/x86_64/puppet-agent-6.4.3-1.el6.x86_64.rpm 
RHEL5
https://pm.puppet.com/puppet-agent/2019.1.1/6.4.3/repos/el/5/puppet6/x86_64/puppet-agent-6.4.3-1.el5.x86_64.rpm
Microsoft Windows ver. Windows Server 2008(R2), Windows Server 2012(R2), Windows Server 2016, Windows Server 2019, Windows 7/8.1/10 (64-bit)
https://pm.puppet.com/puppet-agent/2019.1.1/6.4.3/repos/windows/puppet-agent-6.4.3-x64.msi

我的当前系统是RHEL7,所以我选择下面的地址下载:
https://s3.amazonaws.com/pe-builds/released/2019.1.1/puppet-enterprise-2019.1.1-el-7-x86_64.tar.gz

由于是亚马逊的源,所以国内大陆用户下载可能比较慢。

这里,我选择的是EPEL的方式安装的:

[root@puppet yum.repos.d]# yum install -y puppet-server
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Resolving Dependencies
--> Running transaction check
---> Package puppet-server.noarch 0:3.6.2-3.el7 will be installed
--> Processing Dependency: puppet = 3.6.2-3.el7 for package: puppet-server-3.6.2-3.el7.noarch
--> Running transaction check
---> Package puppet.noarch 0:3.6.2-3.el7 will be installed
--> Processing Dependency: facter >= 1.6.6 for package: puppet-3.6.2-3.el7.noarch
--> Processing Dependency: hiera >= 1.0.0 for package: puppet-3.6.2-3.el7.noarch
--> Processing Dependency: /usr/bin/ruby for package: puppet-3.6.2-3.el7.noarch
--> Processing Dependency: ruby for package: puppet-3.6.2-3.el7.noarch
--> Processing Dependency: ruby(augeas) for package: puppet-3.6.2-3.el7.noarch
--> Processing Dependency: ruby(release) for package: puppet-3.6.2-3.el7.noarch
--> Processing Dependency: ruby(selinux) for package: puppet-3.6.2-3.el7.noarch
--> Processing Dependency: ruby(shadow) for package: puppet-3.6.2-3.el7.noarch
--> Processing Dependency: rubygem(rgen) for package: puppet-3.6.2-3.el7.noarch
--> Running transaction check
---> Package facter.x86_64 0:2.4.1-1.el7 will be installed
---> Package hiera.noarch 1:1.3.4-5.el7 will be installed
---> Package libselinux-ruby.x86_64 0:2.5-14.1.el7 will be installed
---> Package ruby.x86_64 0:2.0.0.648-35.el7_6 will be installed
--> Processing Dependency: rubygem(bigdecimal) >= 1.2.0 for package: ruby-2.0.0.648-35.el7_6.x86_64
--> Processing Dependency: ruby(rubygems) >= 2.0.14.1 for package: ruby-2.0.0.648-35.el7_6.x86_64
---> Package ruby-augeas.x86_64 0:0.5.0-1.el7 will be installed
---> Package ruby-libs.x86_64 0:2.0.0.648-35.el7_6 will be installed
---> Package ruby-shadow.x86_64 0:1.4.1-23.el7 will be installed
---> Package rubygem-rgen.noarch 0:0.6.6-2.el7 will be installed
--> Running transaction check
---> Package rubygem-bigdecimal.x86_64 0:1.2.0-35.el7_6 will be installed
---> Package rubygems.noarch 0:2.0.14.1-35.el7_6 will be installed
--> Processing Dependency: rubygem(rdoc) >= 4.0.0 for package: rubygems-2.0.14.1-35.el7_6.noarch
--> Processing Dependency: rubygem(psych) >= 2.0.0 for package: rubygems-2.0.14.1-35.el7_6.noarch
--> Processing Dependency: rubygem(io-console) >= 0.4.2 for package: rubygems-2.0.14.1-35.el7_6.noarch
--> Running transaction check
---> Package rubygem-io-console.x86_64 0:0.4.2-35.el7_6 will be installed
---> Package rubygem-psych.x86_64 0:2.0.0-35.el7_6 will be installed
---> Package rubygem-rdoc.noarch 0:4.0.0-35.el7_6 will be installed
--> Processing Dependency: ruby(irb) = 2.0.0.648 for package: rubygem-rdoc-4.0.0-35.el7_6.noarch
--> Processing Dependency: rubygem(json) >= 1.7.7 for package: rubygem-rdoc-4.0.0-35.el7_6.noarch
--> Running transaction check
---> Package ruby-irb.noarch 0:2.0.0.648-35.el7_6 will be installed
---> Package rubygem-json.x86_64 0:1.7.7-35.el7_6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=====================================================================================================================================================================
 Package                                      Arch                             Version                                      Repository                          Size
=====================================================================================================================================================================
Installing:
 puppet-server                                noarch                           3.6.2-3.el7                                  epel                                24 k
Installing for dependencies:
 facter                                       x86_64                           2.4.1-1.el7                                  epel                               101 k
 hiera                                        noarch                           1:1.3.4-5.el7                                epel                                25 k
 libselinux-ruby                              x86_64                           2.5-14.1.el7                                 ISO-BASE                           121 k
 puppet                                       noarch                           3.6.2-3.el7                                  epel                               1.2 M
 ruby                                         x86_64                           2.0.0.648-35.el7_6                           updates                             72 k
 ruby-augeas                                  x86_64                           0.5.0-1.el7                                  epel                                23 k
 ruby-irb                                     noarch                           2.0.0.648-35.el7_6                           updates                             93 k
 ruby-libs                                    x86_64                           2.0.0.648-35.el7_6                           updates                            2.8 M
 ruby-shadow                                  x86_64                           1.4.1-23.el7                                 epel                                14 k
 rubygem-bigdecimal                           x86_64                           1.2.0-35.el7_6                               updates                             84 k
 rubygem-io-console                           x86_64                           0.4.2-35.el7_6                               updates                             55 k
 rubygem-json                                 x86_64                           1.7.7-35.el7_6                               updates                             80 k
 rubygem-psych                                x86_64                           2.0.0-35.el7_6                               updates                             83 k
 rubygem-rdoc                                 noarch                           4.0.0-35.el7_6                               updates                            322 k
 rubygem-rgen                                 noarch                           0.6.6-2.el7                                  epel                                84 k
 rubygems                                     noarch                           2.0.14.1-35.el7_6                            updates                            220 k

Transaction Summary
=====================================================================================================================================================================
Install  1 Package (+16 Dependent packages)

Total download size: 5.4 M
Installed size: 18 M
Downloading packages:
warning: /var/cache/yum/x86_64/7Server/epel/packages/hiera-1.3.4-5.el7.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY B/s |    0 B  --:--:-- ETA 
Public key for hiera-1.3.4-5.el7.noarch.rpm is not installed
(1/16): hiera-1.3.4-5.el7.noarch.rpm                                                                                                          |  25 kB  00:00:01     
(2/16): facter-2.4.1-1.el7.x86_64.rpm                                                                                                         | 101 kB  00:00:01     
(3/16): puppet-server-3.6.2-3.el7.noarch.rpm                                                                                                  |  24 kB  00:00:00     
(4/16): ruby-2.0.0.648-35.el7_6.x86_64.rpm                                                                                                    |  72 kB  00:00:00     
(5/16): puppet-3.6.2-3.el7.noarch.rpm                                                                                                         | 1.2 MB  00:00:05     
(6/16): ruby-irb-2.0.0.648-35.el7_6.noarch.rpm                                                                                                |  93 kB  00:00:00     
(7/16): ruby-augeas-0.5.0-1.el7.x86_64.rpm                                                                                                    |  23 kB  00:00:00     
(8/16): rubygem-io-console-0.4.2-35.el7_6.x86_64.rpm                                                                                          |  55 kB  00:00:00     
(9/16): ruby-shadow-1.4.1-23.el7.x86_64.rpm                                                                                                   |  14 kB  00:00:00     
(10/16): rubygem-json-1.7.7-35.el7_6.x86_64.rpm                                                                                               |  80 kB  00:00:00     
(11/16): rubygem-psych-2.0.0-35.el7_6.x86_64.rpm                                                                                              |  83 kB  00:00:00     
(12/16): rubygem-rgen-0.6.6-2.el7.noarch.rpm                                                                                                  |  84 kB  00:00:00     
(13/16): rubygem-rdoc-4.0.0-35.el7_6.noarch.rpm                                                                                               | 322 kB  00:00:00     
(14/16): rubygems-2.0.14.1-35.el7_6.noarch.rpm                                                                                                | 220 kB  00:00:00     
(15/16): ruby-libs-2.0.0.648-35.el7_6.x86_64.rpm                                                                                              | 2.8 MB  00:00:03     
rubygem-bigdecimal-1.2.0-35.el FAILED                                          
http://mirrors.cloud.aliyuncs.com/centos/7/updates/x86_64/Packages/rubygem-bigdecimal-1.2.0-35.el7_6.x86_64.rpm: [Errno 14] curl#6 - "Could not resolve host: mirrors.cloud.aliyuncs.com; Unknown error"
Trying other mirror.
(16/16): rubygem-bigdecimal-1.2.0-35.el7_6.x86_64.rpm                                                                                         |  84 kB  00:00:00     
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                457 kB/s | 5.4 MB  00:00:12     
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Importing GPG key 0x352C64E5:
 Userid     : "Fedora EPEL (7) <epel@fedoraproject.org>"
 Fingerprint: 91e9 7d7c 4a5e 96f1 7f3e 888f 6a2f aea2 352c 64e5
 Package    : epel-release-7-11.noarch (@extras)
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : ruby-libs-2.0.0.648-35.el7_6.x86_64                                                                                                              1/17 
  Installing : ruby-irb-2.0.0.648-35.el7_6.noarch                                                                                                               2/17 
  Installing : rubygem-bigdecimal-1.2.0-35.el7_6.x86_64                                                                                                         3/17 
  Installing : rubygem-rdoc-4.0.0-35.el7_6.noarch                                                                                                               4/17 
  Installing : rubygem-json-1.7.7-35.el7_6.x86_64                                                                                                               5/17 
  Installing : rubygem-io-console-0.4.2-35.el7_6.x86_64                                                                                                         6/17 
  Installing : rubygem-psych-2.0.0-35.el7_6.x86_64                                                                                                              7/17 
  Installing : rubygems-2.0.14.1-35.el7_6.noarch                                                                                                                8/17 
  Installing : ruby-2.0.0.648-35.el7_6.x86_64                                                                                                                   9/17 
  Installing : facter-2.4.1-1.el7.x86_64                                                                                                                       10/17 
  Installing : rubygem-rgen-0.6.6-2.el7.noarch                                                                                                                 11/17 
  Installing : ruby-augeas-0.5.0-1.el7.x86_64                                                                                                                  12/17 
  Installing : 1:hiera-1.3.4-5.el7.noarch                                                                                                                      13/17 
  Installing : ruby-shadow-1.4.1-23.el7.x86_64                                                                                                                 14/17 
  Installing : libselinux-ruby-2.5-14.1.el7.x86_64                                                                                                             15/17 
  Installing : puppet-3.6.2-3.el7.noarch                                                                                                                       16/17 
  Installing : puppet-server-3.6.2-3.el7.noarch                                                                                                                17/17 
  Verifying  : ruby-2.0.0.648-35.el7_6.x86_64                                                                                                                   1/17 
  Verifying  : ruby-irb-2.0.0.648-35.el7_6.noarch                                                                                                               2/17 
  Verifying  : puppet-server-3.6.2-3.el7.noarch                                                                                                                 3/17 
  Verifying  : ruby-libs-2.0.0.648-35.el7_6.x86_64                                                                                                              4/17 
  Verifying  : ruby-augeas-0.5.0-1.el7.x86_64                                                                                                                   5/17 
  Verifying  : facter-2.4.1-1.el7.x86_64                                                                                                                        6/17 
  Verifying  : rubygem-bigdecimal-1.2.0-35.el7_6.x86_64                                                                                                         7/17 
  Verifying  : rubygem-rdoc-4.0.0-35.el7_6.noarch                                                                                                               8/17 
  Verifying  : rubygem-json-1.7.7-35.el7_6.x86_64                                                                                                               9/17 
  Verifying  : puppet-3.6.2-3.el7.noarch                                                                                                                       10/17 
  Verifying  : rubygem-io-console-0.4.2-35.el7_6.x86_64                                                                                                        11/17 
  Verifying  : 1:hiera-1.3.4-5.el7.noarch                                                                                                                      12/17 
  Verifying  : libselinux-ruby-2.5-14.1.el7.x86_64                                                                                                             13/17 
  Verifying  : rubygem-rgen-0.6.6-2.el7.noarch                                                                                                                 14/17 
  Verifying  : rubygem-psych-2.0.0-35.el7_6.x86_64                                                                                                             15/17 
  Verifying  : rubygems-2.0.14.1-35.el7_6.noarch                                                                                                               16/17 
  Verifying  : ruby-shadow-1.4.1-23.el7.x86_64                                                                                                                 17/17 

Installed:
  puppet-server.noarch 0:3.6.2-3.el7                                                                                                                                 

Dependency Installed:
  facter.x86_64 0:2.4.1-1.el7           hiera.noarch 1:1.3.4-5.el7                 libselinux-ruby.x86_64 0:2.5-14.1.el7      puppet.noarch 0:3.6.2-3.el7          
  ruby.x86_64 0:2.0.0.648-35.el7_6      ruby-augeas.x86_64 0:0.5.0-1.el7           ruby-irb.noarch 0:2.0.0.648-35.el7_6       ruby-libs.x86_64 0:2.0.0.648-35.el7_6
  ruby-shadow.x86_64 0:1.4.1-23.el7     rubygem-bigdecimal.x86_64 0:1.2.0-35.el7_6 rubygem-io-console.x86_64 0:0.4.2-35.el7_6 rubygem-json.x86_64 0:1.7.7-35.el7_6 
  rubygem-psych.x86_64 0:2.0.0-35.el7_6 rubygem-rdoc.noarch 0:4.0.0-35.el7_6       rubygem-rgen.noarch 0:0.6.6-2.el7          rubygems.noarch 0:2.0.14.1-35.el7_6  

Complete!
[root@puppet yum.repos.d]# 

安装后检查:

[root@puppet yum.repos.d]# yum list | grep puppet
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository extras is listed more than once in the configuration
puppet.noarch                           3.6.2-3.el7                     @epel   
puppet-server.noarch                    3.6.2-3.el7                     @epel   
dmlite-puppet-dpm.noarch                1.12.1-1.el7                    epel    
puppet-firewalld.noarch                 0.1.3-1.el7                     epel    
puppetlabs-stdlib.noarch                4.25.1-1.el7                    epel    
rubygem-puppet-lint.noarch              1.1.0-2.el7                     epel    
rubygem-puppet-lint-doc.noarch          1.1.0-2.el7                     epel    
[root@puppet yum.repos.d]# 
[root@puppet yum.repos.d]# rpm -qa | grep puppet
puppet-server-3.6.2-3.el7.noarch
puppet-3.6.2-3.el7.noarch
[root@puppet yum.repos.d]# 

启动Puppet服务:

[root@puppet yum.repos.d]# service puppetmaster status
Redirecting to /bin/systemctl status puppetmaster.service
● puppetmaster.service - Puppet master
   Loaded: loaded (/usr/lib/systemd/system/puppetmaster.service; disabled; vendor preset: disabled)
   Active: inactive (dead)
[root@puppet yum.repos.d]# 
[root@puppet yum.repos.d]# chkconfig puppetmaster on
Note: Forwarding request to 'systemctl enable puppetmaster.service'.
Created symlink from /etc/systemd/system/multi-user.target.wants/puppetmaster.service to /usr/lib/systemd/system/puppetmaster.service.
[root@puppet yum.repos.d]# 
[root@puppet yum.repos.d]# service puppetmaster start
Redirecting to /bin/systemctl start puppetmaster.service
[root@puppet yum.repos.d]# 
[root@puppet yum.repos.d]# service puppetmaster status
Redirecting to /bin/systemctl status puppetmaster.service
● puppetmaster.service - Puppet master
   Loaded: loaded (/usr/lib/systemd/system/puppetmaster.service; enabled; vendor preset: disabled)
   Active: active (running) since Mon 2019-08-05 19:06:17 PDT; 14s ago
 Main PID: 40241 (start-puppet-ma)
   CGroup: /system.slice/puppetmaster.service
           ├─40241 /bin/sh /usr/bin/start-puppet-master master --no-daemonize
           └─40242 /usr/bin/ruby /usr/bin/puppet master --no-daemonize

Aug 05 19:06:17 puppet.adamhuan.com systemd[1]: Started Puppet master.
Aug 05 19:06:18 puppet.adamhuan.com puppet-master[40242]: Signed certificate request for ca
Aug 05 19:06:20 puppet.adamhuan.com puppet-master[40242]: puppet.adamhuan.com has a waiting certificate request
Aug 05 19:06:20 puppet.adamhuan.com puppet-master[40242]: Signed certificate request for puppet.adamhuan.com
Aug 05 19:06:20 puppet.adamhuan.com puppet-master[40242]: Removing file Puppet::SSL::CertificateRequest puppet.adamhuan.com at '/var/lib/puppet/ssl/ca/req...com.pem'
Aug 05 19:06:20 puppet.adamhuan.com puppet-master[40242]: Removing file Puppet::SSL::CertificateRequest puppet.adamhuan.com at '/var/lib/puppet/ssl/certif...com.pem'
Aug 05 19:06:20 puppet.adamhuan.com puppet-master[40242]: Starting Puppet master version 3.6.2
Hint: Some lines were ellipsized, use -l to show in full.
[root@puppet yum.repos.d]# 

这样Puppet的服务端就配置好了。


终了,…

说点什么

avatar

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据

  Subscribe  
提醒