Instance notes of the Poppet function module under CentOS 6.3

Source: Internet
Author: User

Previous articles introduced the initial installation configuration of Poppet:

Portal:

Today I will introduce the specific practical functions of Poppet. In fact, my understanding is how to be lazy.

1. Fill in the file content:

(Server ):

Modify the server configuration file:

# Vi/etc/puppet/manifests/site. pp

-----------------

Node default {

File {"/tmp/test ":

Content => "this is a test file ";

}

}

-----------------

Restart puppetmaster to update the configuration file.

# Service puppetmaster restart

(Client ):

Restart puppet (no need to restart)

# Service puppet restart

Synchronize files:

# Puppetd -- server server.example.com -- test

------------------

Warning: peer certificate won't be verified in this SSL session

Info: Caching certificate for client.example.com

Info: Caching certificate_revocation_list for ca

Info: Caching catalog for client.example.com

Info: Applying configuration version '20140901'

Notice:/Stage [main] // Node [default]/File [/tmp/test]/ensure: defined content as '{md5} 100b144907af2a4786003758a0a6a563'

Info: Creating state file/var/lib/puppet/state. yaml

Notice: Finished catalog run in 0.02 seconds

------------------

View the/tmp/test file and file content

# Cat/tmp/test

-----------

This is a test file

-----------

2. File distribution:

Puppet allows you to push files to the managed machine by using the source attribute of the file type.

1: Modify/etc/puppet/fileserver. conf

2: Modify/etc/puppet/manifests/site. pp

Instance: Transfer puppet-2.6.13.tar.gz under/rootdirectory on the server to the/tmp directory of the client server. The file name remains unchanged.

# Vi/etc/puppet/fileserver. conf

----------------

[Files]

Path/root

Allow 192.168.7.0/24

----------------

# Vi/etc/puppet/manifests/site. pp

Add to node default:

---------------

File {"/tmp/puppet-2.6.13.tar.gz ":

Source = & gt; "puppet: // $ puppetserver/files/puppet-2.6.13.tar.gz ",

}

---------------

Restart the poppetmaster Service

# Service poppetmaster restart

(Client ):

Execute the update command

# Puppetd -- test -- server server.example.com

Here, "$ puppetserver" is the name of the puppet Server, that is, the hostname of the local machine. The online tutorials are all specified in hosts. We recommend that you use internal DNS for resolution in the production environment.

  • 1
  • 2
  • 3
  • Next Page

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.