puppet 3.0.0 → 3.0.1.rc1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of puppet might be problematic. Click here for more details.
- data/Rakefile +24 -19
- data/bin/puppet +0 -6
- data/examples/modules/{sample-module.pp → sample_module.pp} +1 -1
- data/examples/modules/{sample-module → sample_module}/lib/puppet/parser/functions/hostname_to_dn.rb +0 -0
- data/examples/modules/{sample-module → sample_module}/manifests/init.pp +1 -1
- data/examples/modules/{sample-module → sample_module}/templates/sample.erb +0 -0
- data/ext/debian/puppetmaster.README.debian +1 -2
- data/ext/debian/puppetmaster.default +1 -28
- data/ext/debian/puppetmaster.init +49 -70
- data/ext/project_data.yaml +2 -2
- data/ext/rack/README +0 -15
- data/ext/rack/files/config.ru +4 -2
- data/ext/redhat/logrotate +1 -1
- data/ext/redhat/server.init +34 -49
- data/ext/redhat/server.sysconfig +2 -20
- data/ext/suse/client.init +10 -9
- data/ext/suse/puppet.spec +12 -25
- data/ext/suse/server.init +25 -15
- data/ext/windows/service/daemon.bat +1 -1
- data/ext/windows/service/daemon.rb +1 -1
- data/lib/puppet.rb +0 -6
- data/lib/puppet/application/agent.rb +1 -0
- data/lib/puppet/defaults.rb +2 -9
- data/lib/puppet/feature/eventlog.rb +0 -1
- data/lib/puppet/feature/rack.rb +1 -6
- data/lib/puppet/feature/rails.rb +0 -2
- data/lib/puppet/feature/rubygems.rb +5 -1
- data/lib/puppet/feature/ssh.rb +0 -1
- data/lib/puppet/feature/stomp.rb +0 -1
- data/lib/puppet/feature/zlib.rb +0 -1
- data/lib/puppet/network/http/rack/rest.rb +4 -1
- data/lib/puppet/rails/inventory_node.rb +26 -13
- data/lib/puppet/run.rb +1 -1
- data/lib/puppet/settings.rb +12 -7
- data/lib/puppet/util/command_line.rb +11 -0
- data/lib/puppet/util/rubygems.rb +7 -6
- data/lib/puppet/util/run_mode.rb +12 -11
- data/lib/puppet/util/zaml.rb +1 -1
- data/lib/puppet/version.rb +1 -1
- data/man/man5/puppet.conf.5 +4 -4
- data/spec/integration/defaults_spec.rb +4 -4
- data/spec/unit/network/http/rack/rest_spec.rb +13 -0
- data/spec/unit/run_spec.rb +11 -5
- data/spec/unit/util/rubygems_spec.rb +4 -2
- data/spec/unit/util/run_mode_spec.rb +9 -0
- data/spec/unit/util/zaml_spec.rb +53 -25
- metadata +2189 -2210
- data/examples/modules/sample-module/README.txt +0 -17
- data/ext/packaging/README-Solaris.md +0 -117
- data/ext/packaging/README.md +0 -89
- data/ext/packaging/tasks/00_utils.rb +0 -290
- data/ext/packaging/tasks/10_setupvars.rake +0 -64
- data/ext/packaging/tasks/apple.rake +0 -201
- data/ext/packaging/tasks/clean.rake +0 -5
- data/ext/packaging/tasks/deb.rake +0 -103
- data/ext/packaging/tasks/gem.rake +0 -55
- data/ext/packaging/tasks/ips.rake +0 -80
- data/ext/packaging/tasks/mock.rake +0 -88
- data/ext/packaging/tasks/release.rake +0 -56
- data/ext/packaging/tasks/rpm.rake +0 -39
- data/ext/packaging/tasks/ship.rake +0 -36
- data/ext/packaging/tasks/sign.rake +0 -79
- data/ext/packaging/tasks/tag.rake +0 -8
- data/ext/packaging/tasks/tar.rake +0 -20
- data/ext/packaging/tasks/version.rake +0 -20
- data/ext/suse/fileserver.conf +0 -12
- data/ext/suse/logrotate +0 -10
- data/ext/suse/puppet.conf +0 -25
- data/lib/puppet/network/http/mongrel/rest.rb +0 -104
- data/spec/integration/network/server/mongrel_spec.rb +0 -64
data/Rakefile
CHANGED
@@ -20,37 +20,42 @@ end
|
|
20
20
|
require 'rake'
|
21
21
|
require 'rspec'
|
22
22
|
require "rspec/core/rake_task"
|
23
|
-
require 'yaml'
|
24
23
|
|
25
24
|
Dir['tasks/**/*.rake'].each { |t| load t }
|
26
25
|
Dir['ext/packaging/tasks/**/*'].sort.each { |t| load t }
|
27
26
|
|
28
|
-
|
29
|
-
|
27
|
+
build_defs_file = 'ext/build_defaults.yaml'
|
28
|
+
if File.exist?(build_defs_file)
|
29
|
+
begin
|
30
|
+
require 'yaml'
|
31
|
+
@build_defaults ||= YAML.load_file(build_defs_file)
|
32
|
+
rescue Exception => e
|
33
|
+
STDERR.puts "Unable to load yaml from #{build_defs_file}:"
|
34
|
+
STDERR.puts e
|
35
|
+
end
|
30
36
|
@packaging_url = @build_defaults['packaging_url']
|
31
37
|
@packaging_repo = @build_defaults['packaging_repo']
|
32
|
-
|
33
|
-
|
34
|
-
end
|
38
|
+
raise "Could not find packaging url in #{build_defs_file}" if @packaging_url.nil?
|
39
|
+
raise "Could not find packaging repo in #{build_defs_file}" if @packaging_repo.nil?
|
35
40
|
|
36
|
-
namespace :package do
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
41
|
+
namespace :package do
|
42
|
+
desc "Bootstrap packaging automation, e.g. clone into packaging repo"
|
43
|
+
task :bootstrap do
|
44
|
+
if File.exist?("ext/#{@packaging_repo}")
|
45
|
+
puts "It looks like you already have ext/#{@packaging_repo}. If you don't like it, blow it away with package:implode."
|
46
|
+
else
|
47
|
+
cd 'ext' do
|
48
|
+
%x{git clone #{@packaging_url}}
|
49
|
+
end
|
44
50
|
end
|
45
51
|
end
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
52
|
+
desc "Remove all cloned packaging automation"
|
53
|
+
task :implode do
|
54
|
+
rm_rf "ext/#{@packaging_repo}"
|
55
|
+
end
|
50
56
|
end
|
51
57
|
end
|
52
58
|
|
53
|
-
|
54
59
|
task :default do
|
55
60
|
sh %{rake -T}
|
56
61
|
end
|
data/bin/puppet
CHANGED
data/examples/modules/{sample-module → sample_module}/lib/puppet/parser/functions/hostname_to_dn.rb
RENAMED
File without changes
|
File without changes
|
@@ -5,8 +5,7 @@ to fall over when you get close to 30 nodes. You will start to see
|
|
5
5
|
connection-reset or End-of-file errors when this happens.
|
6
6
|
|
7
7
|
You will want to a server that can scale better than webrick, such as
|
8
|
-
Passenger (aka. mod_rails),
|
9
|
-
web-proxy such as apache.
|
8
|
+
Passenger (aka. mod_rails), with a front-end web-proxy such as apache.
|
10
9
|
|
11
10
|
If you would like to run Passenger (aka. mod_rails) with apache install the
|
12
11
|
puppetmaster-passenger package. It will automatically setup an apache2 virtual
|
@@ -7,32 +7,5 @@ START=yes
|
|
7
7
|
# Startup options
|
8
8
|
DAEMON_OPTS=""
|
9
9
|
|
10
|
-
# What
|
11
|
-
# Options:
|
12
|
-
# webrick: default, cannot handle more than ~30 nodes
|
13
|
-
# mongrel: scales better than webrick because you can run
|
14
|
-
# multiple processes if you are getting
|
15
|
-
# connection-reset or End-of-file errors, switch to
|
16
|
-
# mongrel. Requires front-end web-proxy such as
|
17
|
-
# apache, nginx, or pound, more information:
|
18
|
-
# http://puppetlabs.com/trac/puppet/wiki/UsingMongrel
|
19
|
-
# passenger: no need to set this, be sure to set START=no above
|
20
|
-
SERVERTYPE=webrick
|
21
|
-
|
22
|
-
# How many puppetmaster instances to start? Its pointless to set this
|
23
|
-
# higher than 1 if you are not using mongrel.
|
24
|
-
PUPPETMASTERS=1
|
25
|
-
|
26
|
-
# What port should the puppetmaster listen on (default: 8140). If
|
27
|
-
# PUPPETMASTERS is set to a number greater than 1, then the port for
|
28
|
-
# the first puppetmaster will be set to the port listed below, and
|
29
|
-
# further instances will be incremented by one
|
30
|
-
#
|
31
|
-
# NOTE: if you are using mongrel, then you will need to have a
|
32
|
-
# front-end web-proxy (such as apache, nginx, pound) that takes
|
33
|
-
# incoming requests on the port your clients are connecting to
|
34
|
-
# (default is: 8140), and then passes them off to the mongrel
|
35
|
-
# processes. In this case it is recommended to run your web-proxy on
|
36
|
-
# port 8140 and change the below number to something else, such as
|
37
|
-
# 18140.
|
10
|
+
# What port should the puppetmaster listen on (default: 8140).
|
38
11
|
PORT=8140
|
@@ -5,7 +5,7 @@
|
|
5
5
|
# Required-Stop: $network $named $remote_fs $syslog
|
6
6
|
# Default-Start: 2 3 4 5
|
7
7
|
# Default-Stop: 0 1 6
|
8
|
-
### END INIT INFO
|
8
|
+
### END INIT INFO
|
9
9
|
|
10
10
|
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
11
11
|
DAEMON=/usr/bin/puppet
|
@@ -20,11 +20,25 @@ test -x $DAEMON || exit 0
|
|
20
20
|
. /lib/lsb/init-functions
|
21
21
|
|
22
22
|
if [ ! -d /var/run/puppet ]; then
|
23
|
-
|
23
|
+
mkdir -p /var/run/puppet
|
24
24
|
fi
|
25
25
|
|
26
26
|
chown puppet:puppet /var/run/puppet
|
27
27
|
|
28
|
+
mongrel_warning="The mongrel servertype is no longer built-in to Puppet. It
|
29
|
+
appears as though mongrel is being used, as the number of puppetmasters is
|
30
|
+
greater than one. Starting the puppetmaster service will not behave as expected
|
31
|
+
until this is resolved. Only the first port has been used in the service, and
|
32
|
+
only one puppetmaster has been started. These settings are defined in
|
33
|
+
/etc/default/puppetmaster"
|
34
|
+
|
35
|
+
|
36
|
+
# Warn about removed and unsupported mongrel servertype
|
37
|
+
if ([ -n "$PUPPETMASTERS" ] && [ ${PUPPETMASTERS} -gt 1 ]) || [ "${SERVERTYPE}" = "mongrel" ]; then
|
38
|
+
echo $mongrel_warning
|
39
|
+
echo
|
40
|
+
fi
|
41
|
+
|
28
42
|
is_true() {
|
29
43
|
if [ "x$1" = "xtrue" -o "x$1" = "xyes" -o "x$1" = "x0" ] ; then
|
30
44
|
return 0
|
@@ -35,41 +49,16 @@ is_true() {
|
|
35
49
|
|
36
50
|
start_puppet_master() {
|
37
51
|
if is_true "$START" ; then
|
38
|
-
|
39
|
-
|
40
|
-
DAEMON_OPTS="$DAEMON_OPTS --servertype=mongrel"
|
41
|
-
NUMSTART=0
|
42
|
-
STARTPORT=$PORT
|
43
|
-
while [ $NUMSTART -lt $PUPPETMASTERS ]; do
|
44
|
-
start-stop-daemon --start --quiet --pidfile=/var/run/puppet/${NAME}-${STARTPORT}.pid \
|
45
|
-
--startas $DAEMON -- $NAME $DAEMON_OPTS --masterport=$STARTPORT --pidfile=/var/run/puppet/${NAME}-${STARTPORT}.pid
|
46
|
-
STARTPORT=$(($STARTPORT + 1))
|
47
|
-
NUMSTART=$(($NUMSTART + 1))
|
48
|
-
done
|
49
|
-
else
|
50
|
-
start-stop-daemon --start --quiet --pidfile /var/run/puppet/${NAME}.pid \
|
51
|
-
--startas $DAEMON -- $NAME $DAEMON_OPTS --masterport=$PORT
|
52
|
-
fi
|
52
|
+
start-stop-daemon --start --quiet --pidfile /var/run/puppet/${NAME}.pid \
|
53
|
+
--startas $DAEMON -- $NAME $DAEMON_OPTS --masterport=$PORT
|
53
54
|
else
|
54
|
-
|
55
|
-
|
55
|
+
echo ""
|
56
|
+
echo "puppetmaster not configured to start, please edit /etc/default/puppetmaster to enable"
|
56
57
|
fi
|
57
58
|
}
|
58
59
|
|
59
60
|
stop_puppet_master() {
|
60
|
-
|
61
|
-
then
|
62
|
-
NUMSTART=0
|
63
|
-
STOPPORT=$PORT
|
64
|
-
while [ $NUMSTART -lt $PUPPETMASTERS ]; do
|
65
|
-
start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/puppet/${NAME}-${STOPPORT}.pid
|
66
|
-
rm -f /var/run/puppet/${NAME}-${STOPPORT}.pid
|
67
|
-
STOPPORT=$(($STOPPORT + 1))
|
68
|
-
NUMSTART=$(($NUMSTART + 1))
|
69
|
-
done
|
70
|
-
else
|
71
|
-
start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/puppet/${NAME}.pid
|
72
|
-
fi
|
61
|
+
start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/puppet/${NAME}.pid
|
73
62
|
}
|
74
63
|
|
75
64
|
status_puppet_master() {
|
@@ -84,13 +73,13 @@ status_puppet_master() {
|
|
84
73
|
esac
|
85
74
|
done
|
86
75
|
shift $(($OPTIND - 1))
|
87
|
-
|
76
|
+
|
88
77
|
if [ -n "$pidfile" ]; then
|
89
78
|
pidfile="-p $pidfile"
|
90
79
|
fi
|
91
80
|
daemon="$1"
|
92
81
|
name="$2"
|
93
|
-
|
82
|
+
|
94
83
|
status="0"
|
95
84
|
pidofproc $pidfile $daemon >/dev/null || status="$?"
|
96
85
|
if [ "$status" = 0 ]; then
|
@@ -102,57 +91,47 @@ status_puppet_master() {
|
|
102
91
|
else
|
103
92
|
log_failure_msg "$name is not running"
|
104
93
|
return $status
|
105
|
-
fi
|
94
|
+
fi
|
106
95
|
}
|
107
96
|
fi
|
108
97
|
|
109
|
-
|
110
|
-
|
111
|
-
then
|
112
|
-
NUMSTART=0
|
113
|
-
STARTPORT=$PORT
|
114
|
-
while [ $NUMSTART -lt $PUPPETMASTERS ]; do
|
115
|
-
status_of_proc -p "/var/run/puppet/${NAME}-${STARTPORT}.pid" \
|
116
|
-
"${DAEMON}" "${NAME}-${STARTPORT}"
|
117
|
-
STARTPORT=$(($STARTPORT + 1))
|
118
|
-
NUMSTART=$(($NUMSTART + 1))
|
119
|
-
done
|
120
|
-
else
|
121
|
-
status_of_proc -p "/var/run/puppet/${NAME}.pid" "${DAEMON}" "${NAME}"
|
122
|
-
fi
|
98
|
+
if is_true "$START" ; then
|
99
|
+
status_of_proc -p "/var/run/puppet/${NAME}.pid" "${DAEMON}" "${NAME}"
|
123
100
|
else
|
124
|
-
|
125
|
-
|
101
|
+
echo ""
|
102
|
+
echo "puppetmaster not configured to start"
|
126
103
|
fi
|
127
104
|
}
|
128
105
|
|
129
106
|
|
130
107
|
case "$1" in
|
131
108
|
start)
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
109
|
+
log_begin_msg "Starting $DESC"
|
110
|
+
start_puppet_master
|
111
|
+
log_end_msg $?
|
112
|
+
;;
|
136
113
|
stop)
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
114
|
+
log_begin_msg "Stopping $DESC"
|
115
|
+
stop_puppet_master
|
116
|
+
log_end_msg $?
|
117
|
+
;;
|
141
118
|
reload)
|
142
|
-
|
119
|
+
# Do nothing, as Puppetmaster rechecks its config automatically
|
143
120
|
;;
|
144
121
|
status)
|
145
|
-
|
122
|
+
status_puppet_master
|
146
123
|
;;
|
147
124
|
restart|force-reload)
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
125
|
+
log_begin_msg "Restarting $DESC"
|
126
|
+
stop_puppet_master
|
127
|
+
sleep 1
|
128
|
+
start_puppet_master
|
129
|
+
log_end_msg $?
|
130
|
+
;;
|
154
131
|
*)
|
155
|
-
|
156
|
-
|
157
|
-
|
132
|
+
echo "Usage: $0 {start|stop|status|restart|force-reload}" >&2
|
133
|
+
exit 1
|
134
|
+
;;
|
158
135
|
esac
|
136
|
+
|
137
|
+
# vim: tabstop=4:softtabstop=4:shiftwidth=4:expandtab
|
data/ext/project_data.yaml
CHANGED
@@ -15,8 +15,8 @@ gem_executables: 'puppet'
|
|
15
15
|
gem_default_executables: 'puppet'
|
16
16
|
gem_forge_project: 'puppet'
|
17
17
|
gem_runtime_dependencies:
|
18
|
-
facter: '
|
19
|
-
hiera: '
|
18
|
+
facter: '~> 1.6.11'
|
19
|
+
hiera: '~> 1.0.0'
|
20
20
|
gem_rdoc_options:
|
21
21
|
- --title
|
22
22
|
- "Puppet - Configuration Management"
|
data/ext/rack/README
CHANGED
@@ -21,21 +21,6 @@ WEBrick is currently not supported as a Rack host. You'll be better off
|
|
21
21
|
just running puppetmasterd directly.
|
22
22
|
|
23
23
|
|
24
|
-
Mongrel
|
25
|
-
-------
|
26
|
-
|
27
|
-
If you like Mongrel, and want to replicate wiki:UsingMongrel, you could
|
28
|
-
probably start your backend mongrels this way:
|
29
|
-
|
30
|
-
cd ext/rack
|
31
|
-
for port in `seq 18140 18150`; do
|
32
|
-
rackup --server mongrel --port $port &
|
33
|
-
done
|
34
|
-
|
35
|
-
rackup is part of the rack gem. Make sure it's in your path.
|
36
|
-
|
37
|
-
|
38
|
-
|
39
24
|
Apache with Passenger (aka mod_rails)
|
40
25
|
-------------------------------------
|
41
26
|
|
data/ext/rack/files/config.ru
CHANGED
@@ -11,9 +11,11 @@ $0 = "master"
|
|
11
11
|
|
12
12
|
ARGV << "--rack"
|
13
13
|
|
14
|
-
# Rack applications typically don't start as root. Set --confdir
|
15
|
-
# reading configuration from
|
14
|
+
# Rack applications typically don't start as root. Set --confdir and --vardir
|
15
|
+
# to prevent reading configuration from ~puppet/.puppet/puppet.conf and writing
|
16
|
+
# to ~puppet/.puppet
|
16
17
|
ARGV << "--confdir" << "/etc/puppet"
|
18
|
+
ARGV << "--vardir" << "/var/lib/puppet"
|
17
19
|
|
18
20
|
# NOTE: it's unfortunate that we have to use the "CommandLine" class
|
19
21
|
# here to launch the app, but it contains some initialization logic
|
data/ext/redhat/logrotate
CHANGED
data/ext/redhat/server.init
CHANGED
@@ -24,11 +24,7 @@ fi
|
|
24
24
|
|
25
25
|
PUPPETMASTER_OPTS="master "
|
26
26
|
[ -n "$PUPPETMASTER_MANIFEST" ] && PUPPETMASTER_OPTS="${PUPPETMASTER_OPTS} --manifest=${PUPPETMASTER_MANIFEST}"
|
27
|
-
|
28
|
-
PUPPETMASTER_OPTS="${PUPPETMASTER_OPTS} --servertype=mongrel"
|
29
|
-
elif [ -n "$PUPPETMASTER_PORTS" ] && [ ${#PUPPETMASTER_PORTS[@]} -eq 1 ]; then
|
30
|
-
PUPPETMASTER_OPTS="${PUPPETMASTER_OPTS} --masterport=${PUPPETMASTER_PORTS[0]}"
|
31
|
-
fi
|
27
|
+
[ -n "$PUPPETMASTER_PORTS" ] && PUPPETMASTER_OPTS="${PUPPETMASTER_OPTS} --masterport=${PUPPETMASTER_PORTS[0]}"
|
32
28
|
[ -n "$PUPPETMASTER_LOG" ] && PUPPETMASTER_OPTS="${PUPPETMASTER_OPTS} --logdest ${PUPPETMASTER_LOG}"
|
33
29
|
PUPPETMASTER_OPTS="${PUPPETMASTER_OPTS} \
|
34
30
|
${PUPPETMASTER_EXTRA_OPTS}"
|
@@ -40,9 +36,20 @@ if status | grep -q -- '-p' 2>/dev/null; then
|
|
40
36
|
pidopts="-p $pidfile"
|
41
37
|
fi
|
42
38
|
|
39
|
+
mongrel_warning="The mongrel servertype is no longer built-in to Puppet. It appears
|
40
|
+
as though mongrel is being used, as the number of ports is greater than
|
41
|
+
one. Starting the puppetmaster service will not behave as expected until this
|
42
|
+
is resolved. Only the first port has been used in the service. These settings
|
43
|
+
are defined at /etc/sysconfig/puppetmaster"
|
44
|
+
|
45
|
+
# Warn about removed and unsupported mongrel servertype
|
46
|
+
if [ -n "$PUPPETMASTER_PORTS" ] && [ ${#PUPPETMASTER_PORTS[@]} -gt 1 ]; then
|
47
|
+
echo $mongrel_warning
|
48
|
+
echo
|
49
|
+
fi
|
50
|
+
|
43
51
|
RETVAL=0
|
44
52
|
|
45
|
-
prog=puppetmasterd
|
46
53
|
PUPPETMASTER=/usr/bin/puppet
|
47
54
|
|
48
55
|
start() {
|
@@ -50,16 +57,8 @@ start() {
|
|
50
57
|
|
51
58
|
# Confirm the manifest exists
|
52
59
|
if [ -r $PUPPETMASTER_MANIFEST ]; then
|
53
|
-
|
54
|
-
|
55
|
-
echo -en "\nPort: ${PUPPETMASTER_PORTS[$i]}"
|
56
|
-
daemon $PUPPETMASTER $PUPPETMASTER_OPTS --masterport=${PUPPETMASTER_PORTS[$i]} --pidfile=/var/run/puppet/puppetmaster.${PUPPETMASTER_PORTS[$i]}.pid
|
57
|
-
ret=$?; [ $ret != 0 ] && RETVAL=$ret
|
58
|
-
done
|
59
|
-
else
|
60
|
-
daemon $daemonopts $PUPPETMASTER $PUPPETMASTER_OPTS
|
61
|
-
RETVAL=$?
|
62
|
-
fi
|
60
|
+
daemon $daemonopts $PUPPETMASTER $PUPPETMASTER_OPTS
|
61
|
+
RETVAL=$?
|
63
62
|
else
|
64
63
|
failure $"Manifest does not exist: $PUPPETMASTER_MANIFEST"
|
65
64
|
echo
|
@@ -72,72 +71,58 @@ start() {
|
|
72
71
|
|
73
72
|
stop() {
|
74
73
|
echo -n $"Stopping puppetmaster: "
|
75
|
-
|
76
|
-
|
77
|
-
echo -en "\nPort: ${PUPPETMASTER_PORTS[$i]}"
|
78
|
-
killproc -p /var/run/puppet/puppetmaster.${PUPPETMASTER_PORTS[$i]}.pid puppetmaster
|
79
|
-
ret=$?; [ $ret != 0 ] && RETVAL=$ret
|
80
|
-
done
|
81
|
-
else
|
82
|
-
killproc $pidopts $PUPPETMASTER
|
83
|
-
RETVAL=$?
|
84
|
-
fi
|
74
|
+
killproc $pidopts $PUPPETMASTER
|
75
|
+
RETVAL=$?
|
85
76
|
echo
|
86
77
|
[ $RETVAL -eq 0 ] && rm -f "$lockfile"
|
87
78
|
return $RETVAL
|
88
79
|
}
|
89
80
|
|
90
81
|
restart() {
|
91
|
-
|
92
|
-
|
82
|
+
stop
|
83
|
+
start
|
93
84
|
}
|
94
85
|
|
95
86
|
genconfig() {
|
96
|
-
|
97
|
-
|
87
|
+
echo -n $"Generate configuration puppetmaster: "
|
88
|
+
$PUPPETMASTER $PUPPETMASTER_OPTS --genconfig
|
98
89
|
}
|
99
90
|
|
100
91
|
rh_status() {
|
101
|
-
|
102
|
-
|
103
|
-
echo -en "Port ${PUPPETMASTER_PORTS[$i]}: "
|
104
|
-
status -p /var/run/puppet/puppetmaster.${PUPPETMASTER_PORTS[$i]}.pid puppetmaster
|
105
|
-
ret=$?; [ $ret != 0 ] && RETVAL=$ret
|
106
|
-
done
|
107
|
-
else
|
108
|
-
status $pidopts $PUPPETMASTER
|
109
|
-
RETVAL=$?
|
110
|
-
fi
|
92
|
+
status $pidopts $PUPPETMASTER
|
93
|
+
RETVAL=$?
|
111
94
|
return $RETVAL
|
112
95
|
}
|
113
96
|
|
114
97
|
rh_status_q() {
|
115
|
-
|
98
|
+
rh_status >/dev/null 2>&1
|
116
99
|
}
|
117
100
|
|
118
101
|
case "$1" in
|
119
|
-
|
120
|
-
|
121
|
-
|
102
|
+
start)
|
103
|
+
start
|
104
|
+
;;
|
122
105
|
stop)
|
123
106
|
stop
|
124
|
-
|
107
|
+
;;
|
125
108
|
restart|reload|force-reload)
|
126
109
|
restart
|
127
|
-
|
110
|
+
;;
|
128
111
|
condrestart)
|
129
112
|
rh_status_q || exit 0
|
130
113
|
restart
|
131
|
-
|
114
|
+
;;
|
132
115
|
status)
|
133
116
|
rh_status
|
134
|
-
|
117
|
+
;;
|
135
118
|
genconfig)
|
136
119
|
genconfig
|
137
|
-
|
120
|
+
;;
|
138
121
|
*)
|
139
122
|
echo $"Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart|genconfig}"
|
140
123
|
exit 1
|
141
124
|
esac
|
142
125
|
|
143
126
|
exit $RETVAL
|
127
|
+
|
128
|
+
# vim: tabstop=4:softtabstop=4:shiftwidth=4:expandtab
|