First, the system environment
1. Puppet Service End
release:rhel6.4
HOSTNAME:puppetserver.rsyslog.org
Tcp/ip:172.16.200.100/24
Packages:
Puppet-server-2.7.21-1.el6.noarch
mcollective-client-2.2.4
activemq-5.5.0
2, puppet node
release:rhel5.8
HOSTNAME:agent1.rsyslog.org
Tcp/ip:172.16.200.101/24
Packages:
Puppet-2.7.21-1.el5
Mcollective-2.2.4-1.el5
3, puppet node
release:rhel6.4
HOSTNAME:agent3.rsyslog.org
Tcp/ip:172.16.200.103/24
Packages:
Puppet-2.7.21-1.el6
Mcollective-2.2.4-1.el6
Ii. Introduction of resources
1, realize the function
1.1 Service in Run state
1.2 Service can automatically restart with configuration file changes
2, support parameters
Ensure => running|stopped the target state of the specified service
Enable => True|false Specifies whether the service is powered on and is not valid for all
Name => "Service Name", the Namevar of the resource, the name of the service, usually the name in the/etc/init.d/directory, and the default is the same as title
Hasstatus => True|false, which indicates whether the admin script supports the status parameter, puppet use the status parameter to determine if the service is already running, or if the status argument is not supported, Puppet uses the lookup run process list to determine if the service is running.
Hasrestart => True|false, which indicates whether the admin script supports restart parameters, and if not, uses stop and start to implement the restart effect.
Path => "/etc/rc.d/init.d", which launches the search path for the script, can split multiple paths with a colon, or specify an array of
Provider => Base|daemontools|init, default to Init