Puppet --- a simple example

Source: Internet
Author: User

As an important tool in automated O & M, puppet can be used for batch server or specified server software version updates and Configuration updates.


Let's talk less about theme.


  1. Install puppet-server and puppet on the puppet server and client respectively.

  2. Since puppet is developed based on Ruby, check whether the system has ruby before 1. If not, install it on your own.


The installation steps are as follows:

  1. Yum install Ruby ruby-libs ruby-shadow

  2. On the server and client, first download the RPM learned by puppet repository. This will automatically add the puppet Yum source to the system.

    Rpm-uvh http://yum.puppetlabs.com/puppetlabs-release-el-5.noarch.rpm

    # Select a version based on the Operating System

  3. Then, run

    Yum install puppet-Server

  4. On the client, run

    Yum install puppet

  5. Now, the installation is complete. The following is a simple configuration and tests whether a file can be pushed through puppet.


6. On the server side, Edit

VI/etc/puppet/manifests/site. PP

Node default

{

File

{

"/Tmp/puppet-test1.txt": content => "this is a puppet test! \ N ";

}

}


7. On the client

Puppet agent -- server cahoa.linux.net -- Test -- verbose -- debug -- no-daemonize

# Apply for authentication from the server, obtain files, enable verbose, debug, and re-output information # redirect to Console mode (no-daemonize)


8. You can see that the above command is run, and the final output is:

Exiting; no certificate found and waitforcert is disabled

The agent sends a certificate verification request to the master, waiting for the master to return the certificate.


9. Verify the client on the server

Puppet cert -- list

"Cahou.linux.net" (sha256) 22: 17: 7d: 3D: 0b: 02: **************************************** * ***************** (* content is omitted)


The server signs the verification client,

Puppet Cert sign cahou.linux.net -- verbose -- debug -- no-daemonize


10. Run the configuration again on the client and request server resources.


Puppet agent -- server cahoa.linux.net -- Test -- verbose -- debug -- no-daemonize


11. Check on the client. You can see that the specified content file has been created at the specified location.


CAT/tmp/puppet-test1.txt

This is a puppet test!











This article is from the "Linux and network" blog, please be sure to keep this source http://khaozi.blog.51cto.com/952782/1564979

Puppet --- a simple example

Related Article

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.