Puppet resource Summary

Source: Internet
Author: User

Puppet resource Summary

Resource introduction:

Common resources: file, service, and package

Tool resources: exec, cron, user, group


Resource Summary

File

  • Ensure => (specify the File status)

Present checks whether the file exists. If the file does not exist, it is created.

Absent checks whether the file exists and creates the file if it exists.

Directory specifies this is a directory

  • Path => (full file path, same as title by default)

  • Source => File Retrieval address, which is read from the master starting with puppet: //

  • Content => File content

  • Recurse => true for directory (true) No (false) recursion (ensure => directory is valid)

  • Owner => file owner

  • Group => File group

  • Mode => File Permission

 

Package:

  • Ensure => specifies the package status

Present check whether the package exists. Install the package if it does not exist (you can also write it as installed)

Absent checks whether the package exists and uninstalls the package if it exists.

Laster checks whether the package is up-to-date. If not, upgrade it to the latest version.

Pureged clean remove the software

  • Name => Software Package name

  • Source => get the installation package address

 

Service:

  • Ensure => specify service status

Running

Stopped stop status

  • Enable => whether the service is automatically started

True boot

False boot not started

  • Name => service name, which is the same as the title by default

  • Start, stop, restart, status => Service Startup, shutdown, and restart (start => "/etc/init. d/nginx start ")

  • Hasrestart => false/true this management script supports the restart command. The default value is false. If no value is set, stop/start is used to restart the script.

  • Hasstatus => false/true this script supports the status command. The default value is false. If not, use grep to determine

  • Pattern => "XXX" sets the specified string of the collection process. When the restart/status command is not supported, grep collects the data based on this value.

  • Binary => when the service does not have an init script, the binary Package ontology of the program is directly used. The value of the binary Attribute is the complete path of the ontology.

  • Subscribe => File ["configuration File path"] When the configuration File changes, restart the service.

 

User:

  • Ensure => specify the user status

Present is generated if the user does not exist.

Absent delete user

  • Name => User name, which is the same as title by default

  • Uid => User ID, automatically generated if not specified

  • Gid => GID of the user group

  • Groups => name of the user group to which the user belongs, which can be a list

  • Home => user's home directory

  • Managehome => whether to automatically generate the home directory. The default value is false. You must manually specify

  • Shell => shell (/bin/bash |/sbin/nologin) assigned by the user by default after login)

 

Group:

  • Ensure => specify the user group status

Present is created if the user group does not exist.

Delete if the absent user group exists

  • Name => User Group name. The default value is title.

  • Gid => User Group ID

  • System => whether the user group is a system group. A small GID is used. The default value is false.

  • Members => ['user1', 'user2'] group members

 

Cron:

  • Ensrure => specify the status of the scheduled task

Present If the cron does not exist, add

Absent: Delete the cron if it exists.

  • Command => script command and path to be executed

  • Hour (0-23), minute (0-59), month (1-12), monthday (1-31), weekday (0-7) => schedule of scheduled tasks. The list is supported (for example, [2, 4]).

  • User => user executed to cron

 

Exec:

  • Path => set the command PATH, which is the same as the path environment variable.

  • Command => Run command. If no path is specified, the complete path must be written.

  • Creates => Create if the "filename" file does not exist

  • Cwd => specifies the directory for command execution. If the directory does not exist, the execution fails.

  • Onlyif => when the command in this attribute is successfully executed, this name is returned for running.

  • Unless => opposite to onlyif

 

Puppet Learning Series:

 

Puppet Learning 1: Installation and simple instance applications

 

Puppet 2: simple module configuration and application

 

 

Research on three Backup Recovery solutions for Puppet agent
Register your Puppet node in a safer way
Deep understanding of Puppet syntax and working mechanism through SSH Configuration
Puppet uses Nginx multiple ports for Load Balancing
C/S mode instance of Puppet in CentOS (5 and 6)

 

For more information about Puppet, click here.
Puppet: click here

This article permanently updates the link address:

 

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.