Centos7 simple installation puppet

Source: Internet
Author: User

1. Install puppet. Note: the client and server versions should be the same as possible. If they cannot be the same, the Client Version cannot be too old. The server version cannot be lower than the Client Version.


Installation and simple configuration steps:

Installation preparation (applicable to server and client ):

First, you need to change the computer name: Hostname puppet. nn. Local or: Hostname-F/etc/hostname (enter your computer name in this file, and create one if it does not exist)


Second, it is very important to change the/etc/hosts file (it is best to write the agent in too) to ensure that the ping at both ends is as follows:

192.168.1.1 puppet. nn. Local // server end

192.168.1.2 agent. nn. Local // agent End


Disable iptables and SELinux.

Iptables-F (or open port 8140: iptables-A input-p tcp-M state -- state new-s 192.168.1.0/24 -- dport 8140-J accept)

Setenforce 0 or change enforce in/etc/SELinux/config to disabled ----- "reboot your computer


Finally, make sure that the time between the server and the client remains the same. Otherwise, an error occurs when the client obtains the certificate. NTP is the best choice. I installed the NTP server on puppet (not recommended in the experiment environment and production environment)



It is best to use the package manager of each version for installation. The following installation method is to use the RedHat System for installation.

A. First install the epel Source: https://fedoraproject.org/wiki/epel/zh-cn, and select the desired download path. Such as: epel-release-7.noarch.rpm

Install: rpm-uvh epel-release-7.noarch.rpm and then: Yum update


B. Install the ruby and Ruby libraries:

Yum-y install Ruby ruby-libs ruby-shadow (required by puppet)


C. Install the puppet Server:

Yum-y install puppet (Client Side) puppet-server facter (equivalent to asset management, which can automatically report or obtain client information (such as software environment and operating system ))

* *** Add puppetmaster (main program) to the startup Item:

Earlier than rhel7: chkconfig -- level 3 5 on puppetmaster

Rhel7: systemctl enable puppetmaster. Service


D. Configure the server.

The main configuration file of puppet is/etc/puppet. conf.

Add the following content:

[Master]

Certname = puppet. nn. Local // server name

Change the certificate storage address. We recommend that you store the Certificate in/var/puppet/SSL (/var/puppet/folder must be manually created and the owner should be changed to puppet users and groups)

[Main]

Ssldir =/var/puppet/SSL

Save and exit


Create the/etc/puppet/manifests/site. PP file. If there is a file, you do not need to create it. If not, create it. This file is related to whether puppetmaster can be started.

 

Start: Service puppetmaster start (rhel7: systemctl start puppetmaster. Service). We recommend that you use puppet master -- verbose -- no-daemonize for the first time to view detailed information.



E. Configure the client:

The client configuration file is also:/etc/puppet. conf

Add the following content:

[Agent]

Certname = agent. nn. Local

Server = puppet. nn. Local

Report = true

Change the ssldir option as on the server.

[Main]

Ssldir =/var/puppet/SSL

Save and exit

Start: Service puppet start or systemctl start puppet. Service (rhel7)


F. test:

Client:

Puppet agent -- Server = puppet. nn. Local -- verbose -- no-daemonize -- debug (if the server is started in no-daemonize mode, add this option to the client)

The purpose of this command is to enable the puppet agent in the mode of no Daemon. The advantage is that you can see the communication with the server and the process of signing the certificate to facilitate debugging. By default, puppet requests a signature from the server every 2 minutes.

The agent service is started only when the signed certificate sent from the server is obtained. You can also set the waiting time through -- waitforcert = time. If the time is 0, do not wait.

Server:

View the client Signature Application: puppet cert -- list

Sign the client: puppet cert -- sign agent. nn. Local

Clear user certificate: puppet cert -- clean agent. nn. Local (the client must delete the certificate at the same time: Rm-RF/var/puppet/SSL/agent. nn. Local)

G. when the problem is over, I would like to remind you that most of your firewall failures are caused by it. At least I have encountered such problems, such as no route to host.

References: proficient in puppet


This article is from the "-wind blow grass low-" blog, please be sure to keep this source http://2066265.blog.51cto.com/2056265/1545182

Centos7 simple installation puppet

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.