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.

Files changed (70) hide show
  1. data/Rakefile +24 -19
  2. data/bin/puppet +0 -6
  3. data/examples/modules/{sample-module.pp → sample_module.pp} +1 -1
  4. data/examples/modules/{sample-module → sample_module}/lib/puppet/parser/functions/hostname_to_dn.rb +0 -0
  5. data/examples/modules/{sample-module → sample_module}/manifests/init.pp +1 -1
  6. data/examples/modules/{sample-module → sample_module}/templates/sample.erb +0 -0
  7. data/ext/debian/puppetmaster.README.debian +1 -2
  8. data/ext/debian/puppetmaster.default +1 -28
  9. data/ext/debian/puppetmaster.init +49 -70
  10. data/ext/project_data.yaml +2 -2
  11. data/ext/rack/README +0 -15
  12. data/ext/rack/files/config.ru +4 -2
  13. data/ext/redhat/logrotate +1 -1
  14. data/ext/redhat/server.init +34 -49
  15. data/ext/redhat/server.sysconfig +2 -20
  16. data/ext/suse/client.init +10 -9
  17. data/ext/suse/puppet.spec +12 -25
  18. data/ext/suse/server.init +25 -15
  19. data/ext/windows/service/daemon.bat +1 -1
  20. data/ext/windows/service/daemon.rb +1 -1
  21. data/lib/puppet.rb +0 -6
  22. data/lib/puppet/application/agent.rb +1 -0
  23. data/lib/puppet/defaults.rb +2 -9
  24. data/lib/puppet/feature/eventlog.rb +0 -1
  25. data/lib/puppet/feature/rack.rb +1 -6
  26. data/lib/puppet/feature/rails.rb +0 -2
  27. data/lib/puppet/feature/rubygems.rb +5 -1
  28. data/lib/puppet/feature/ssh.rb +0 -1
  29. data/lib/puppet/feature/stomp.rb +0 -1
  30. data/lib/puppet/feature/zlib.rb +0 -1
  31. data/lib/puppet/network/http/rack/rest.rb +4 -1
  32. data/lib/puppet/rails/inventory_node.rb +26 -13
  33. data/lib/puppet/run.rb +1 -1
  34. data/lib/puppet/settings.rb +12 -7
  35. data/lib/puppet/util/command_line.rb +11 -0
  36. data/lib/puppet/util/rubygems.rb +7 -6
  37. data/lib/puppet/util/run_mode.rb +12 -11
  38. data/lib/puppet/util/zaml.rb +1 -1
  39. data/lib/puppet/version.rb +1 -1
  40. data/man/man5/puppet.conf.5 +4 -4
  41. data/spec/integration/defaults_spec.rb +4 -4
  42. data/spec/unit/network/http/rack/rest_spec.rb +13 -0
  43. data/spec/unit/run_spec.rb +11 -5
  44. data/spec/unit/util/rubygems_spec.rb +4 -2
  45. data/spec/unit/util/run_mode_spec.rb +9 -0
  46. data/spec/unit/util/zaml_spec.rb +53 -25
  47. metadata +2189 -2210
  48. data/examples/modules/sample-module/README.txt +0 -17
  49. data/ext/packaging/README-Solaris.md +0 -117
  50. data/ext/packaging/README.md +0 -89
  51. data/ext/packaging/tasks/00_utils.rb +0 -290
  52. data/ext/packaging/tasks/10_setupvars.rake +0 -64
  53. data/ext/packaging/tasks/apple.rake +0 -201
  54. data/ext/packaging/tasks/clean.rake +0 -5
  55. data/ext/packaging/tasks/deb.rake +0 -103
  56. data/ext/packaging/tasks/gem.rake +0 -55
  57. data/ext/packaging/tasks/ips.rake +0 -80
  58. data/ext/packaging/tasks/mock.rake +0 -88
  59. data/ext/packaging/tasks/release.rake +0 -56
  60. data/ext/packaging/tasks/rpm.rake +0 -39
  61. data/ext/packaging/tasks/ship.rake +0 -36
  62. data/ext/packaging/tasks/sign.rake +0 -79
  63. data/ext/packaging/tasks/tag.rake +0 -8
  64. data/ext/packaging/tasks/tar.rake +0 -20
  65. data/ext/packaging/tasks/version.rake +0 -20
  66. data/ext/suse/fileserver.conf +0 -12
  67. data/ext/suse/logrotate +0 -10
  68. data/ext/suse/puppet.conf +0 -25
  69. data/lib/puppet/network/http/mongrel/rest.rb +0 -104
  70. 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
- begin
29
- @build_defaults ||= YAML.load_file('ext/build_defaults.yaml')
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
- rescue
33
- STDERR.puts 'Unable to read the packaging repo info from ext/build_defaults.yaml'
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
- desc "Bootstrap packaging automation, e.g. clone into packaging repo"
38
- task :bootstrap do
39
- if File.exist?("ext/#{@packaging_repo}")
40
- puts "It looks like you already have ext/#{@packaging_repo}. If you don't like it, blow it away with package:implode."
41
- else
42
- cd 'ext' do
43
- %x{git clone #{@packaging_url}}
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
- end
47
- desc "Remove all cloned packaging automation"
48
- task :implode do
49
- rm_rf "ext/#{@packaging_repo}"
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
@@ -1,10 +1,4 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- # Load rubygems so we can require gems
4
- begin
5
- require 'rubygems'
6
- rescue LoadError
7
- end
8
-
9
3
  require 'puppet/util/command_line'
10
4
  Puppet::Util::CommandLine.new.execute
@@ -7,4 +7,4 @@
7
7
  # sample-module demonstrates the use of a custom language function
8
8
  # included within the module bundle.
9
9
 
10
- include sample-module
10
+ include sample_module
@@ -3,7 +3,7 @@
3
3
  # Demonstration of a custom parser function and erb template within
4
4
  # a module, working in concert.
5
5
 
6
- class sample-module {
6
+ class sample_module {
7
7
  $fqdn_to_dn = hostname_to_dn($domain)
8
8
  $sample_template = template("sample-module/sample.erb")
9
9
 
@@ -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), or mongrel, both with a front-end
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 server type to run
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
- mkdir -p /var/run/puppet
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
- if [ "$SERVERTYPE" = "mongrel" ]
39
- then
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
- echo ""
55
- echo "puppetmaster not configured to start, please edit /etc/default/puppetmaster to enable"
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
- if [ "$SERVERTYPE" = "mongrel" ]
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
- if is_true "$START" ; then
110
- if [ "$SERVERTYPE" = "mongrel" ]
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
- echo ""
125
- echo "puppetmaster not configured to start"
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
- log_begin_msg "Starting $DESC"
133
- start_puppet_master
134
- log_end_msg $?
135
- ;;
109
+ log_begin_msg "Starting $DESC"
110
+ start_puppet_master
111
+ log_end_msg $?
112
+ ;;
136
113
  stop)
137
- log_begin_msg "Stopping $DESC"
138
- stop_puppet_master
139
- log_end_msg $?
140
- ;;
114
+ log_begin_msg "Stopping $DESC"
115
+ stop_puppet_master
116
+ log_end_msg $?
117
+ ;;
141
118
  reload)
142
- # Do nothing, as Puppetmaster rechecks its config automatically
119
+ # Do nothing, as Puppetmaster rechecks its config automatically
143
120
  ;;
144
121
  status)
145
- status_puppet_master
122
+ status_puppet_master
146
123
  ;;
147
124
  restart|force-reload)
148
- log_begin_msg "Restarting $DESC"
149
- stop_puppet_master
150
- sleep 1
151
- start_puppet_master
152
- log_end_msg $?
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
- echo "Usage: $0 {start|stop|status|restart|force-reload}" >&2
156
- exit 1
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
@@ -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: '>= 1.6.11'
19
- hiera: '>= 1.0.0rc'
18
+ facter: '~> 1.6.11'
19
+ hiera: '~> 1.0.0'
20
20
  gem_rdoc_options:
21
21
  - --title
22
22
  - "Puppet - Configuration Management"
@@ -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
 
@@ -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 to prevent
15
- # reading configuration from ~/.puppet/puppet.conf
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
@@ -4,7 +4,7 @@
4
4
  create 0644 puppet puppet
5
5
  sharedscripts
6
6
  postrotate
7
- pkill -USR2 -u puppet -f /usr/sbin/puppetmasterd || true
7
+ pkill -USR2 -u puppet -f 'puppet master' || true
8
8
  [ -e /etc/init.d/puppet ] && /etc/init.d/puppet reload > /dev/null 2>&1 || true
9
9
  endscript
10
10
  }
@@ -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
- if [ -n "$PUPPETMASTER_PORTS" ] && [ ${#PUPPETMASTER_PORTS[@]} -gt 1 ]; then
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
- if [ -n "$PUPPETMASTER_PORTS" ] && [ ${#PUPPETMASTER_PORTS[@]} -gt 1 ]; then
54
- for ((i=0; i<${#PUPPETMASTER_PORTS[@]}; i++)); do
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
- if [ -n "$PUPPETMASTER_PORTS" ] && [ ${#PUPPETMASTER_PORTS[@]} -gt 1 ]; then
76
- for ((i=0; i<${#PUPPETMASTER_PORTS[@]}; i++)); do
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
- stop
92
- start
82
+ stop
83
+ start
93
84
  }
94
85
 
95
86
  genconfig() {
96
- echo -n $"Generate configuration puppetmaster: "
97
- $PUPPETMASTER $PUPPETMASTER_OPTS --genconfig
87
+ echo -n $"Generate configuration puppetmaster: "
88
+ $PUPPETMASTER $PUPPETMASTER_OPTS --genconfig
98
89
  }
99
90
 
100
91
  rh_status() {
101
- if [ -n "$PUPPETMASTER_PORTS" ] && [ ${#PUPPETMASTER_PORTS[@]} -gt 1 ]; then
102
- for ((i=0; i<${#PUPPETMASTER_PORTS[@]}; i++)); do
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
- rh_status >/dev/null 2>&1
98
+ rh_status >/dev/null 2>&1
116
99
  }
117
100
 
118
101
  case "$1" in
119
- start)
120
- start
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