microwave 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +4 -4
- data/bin/chef-solo +2 -0
- data/spec/spec_helper.rb +2 -0
- data/spec/unit/checksum/storage/filesystem_spec.rb +4 -4
- data/spec/unit/config_spec.rb +7 -4
- data/spec/unit/data_bag_spec.rb +11 -11
- data/spec/unit/formatters/error_inspectors/compile_error_inspector_spec.rb +8 -8
- data/spec/unit/formatters/error_inspectors/resource_failure_inspector_spec.rb +5 -5
- metadata +10 -124
- data/distro/README +0 -2
- data/distro/arch/etc/conf.d/chef-client.conf +0 -5
- data/distro/arch/etc/conf.d/chef-expander.conf +0 -8
- data/distro/arch/etc/conf.d/chef-server-webui.conf +0 -10
- data/distro/arch/etc/conf.d/chef-server.conf +0 -10
- data/distro/arch/etc/conf.d/chef-solr.conf +0 -8
- data/distro/arch/etc/rc.d/chef-client +0 -90
- data/distro/arch/etc/rc.d/chef-expander +0 -78
- data/distro/arch/etc/rc.d/chef-server +0 -78
- data/distro/arch/etc/rc.d/chef-server-webui +0 -78
- data/distro/arch/etc/rc.d/chef-solr +0 -78
- data/distro/common/html/chef-client.8.html +0 -145
- data/distro/common/html/chef-expander.8.html +0 -164
- data/distro/common/html/chef-expanderctl.8.html +0 -146
- data/distro/common/html/chef-server-webui.8.html +0 -185
- data/distro/common/html/chef-server.8.html +0 -182
- data/distro/common/html/chef-solo.8.html +0 -191
- data/distro/common/html/chef-solr.8.html +0 -165
- data/distro/common/html/knife-bootstrap.1.html +0 -241
- data/distro/common/html/knife-client.1.html +0 -219
- data/distro/common/html/knife-configure.1.html +0 -170
- data/distro/common/html/knife-cookbook-site.1.html +0 -241
- data/distro/common/html/knife-cookbook.1.html +0 -384
- data/distro/common/html/knife-data-bag.1.html +0 -238
- data/distro/common/html/knife-environment.1.html +0 -267
- data/distro/common/html/knife-exec.1.html +0 -134
- data/distro/common/html/knife-index.1.html +0 -125
- data/distro/common/html/knife-node.1.html +0 -250
- data/distro/common/html/knife-recipe.1.html +0 -92
- data/distro/common/html/knife-role.1.html +0 -200
- data/distro/common/html/knife-search.1.html +0 -288
- data/distro/common/html/knife-ssh.1.html +0 -156
- data/distro/common/html/knife-status.1.html +0 -128
- data/distro/common/html/knife-tag.1.html +0 -137
- data/distro/common/html/knife.1.html +0 -320
- data/distro/common/html/shef.1.html +0 -283
- data/distro/common/man/man1/knife-bootstrap.1 +0 -201
- data/distro/common/man/man1/knife-client.1 +0 -99
- data/distro/common/man/man1/knife-configure.1 +0 -88
- data/distro/common/man/man1/knife-cookbook-site.1 +0 -145
- data/distro/common/man/man1/knife-cookbook.1 +0 -345
- data/distro/common/man/man1/knife-data-bag.1 +0 -136
- data/distro/common/man/man1/knife-environment.1 +0 -178
- data/distro/common/man/man1/knife-exec.1 +0 -46
- data/distro/common/man/man1/knife-index.1 +0 -29
- data/distro/common/man/man1/knife-node.1 +0 -134
- data/distro/common/man/man1/knife-role.1 +0 -88
- data/distro/common/man/man1/knife-search.1 +0 -280
- data/distro/common/man/man1/knife-ssh.1 +0 -79
- data/distro/common/man/man1/knife-status.1 +0 -29
- data/distro/common/man/man1/knife-tag.1 +0 -43
- data/distro/common/man/man1/knife.1 +0 -288
- data/distro/common/man/man1/shef.1 +0 -256
- data/distro/common/man/man8/chef-client.8 +0 -104
- data/distro/common/man/man8/chef-expander.8 +0 -97
- data/distro/common/man/man8/chef-expanderctl.8 +0 -62
- data/distro/common/man/man8/chef-server-webui.8 +0 -155
- data/distro/common/man/man8/chef-server.8 +0 -147
- data/distro/common/man/man8/chef-solo.8 +0 -158
- data/distro/common/man/man8/chef-solr.8 +0 -122
- data/distro/common/markdown/README +0 -3
- data/distro/common/markdown/man1/knife-bootstrap.mkd +0 -141
- data/distro/common/markdown/man1/knife-client.mkd +0 -103
- data/distro/common/markdown/man1/knife-configure.mkd +0 -70
- data/distro/common/markdown/man1/knife-cookbook-site.mkd +0 -123
- data/distro/common/markdown/man1/knife-cookbook.mkd +0 -263
- data/distro/common/markdown/man1/knife-data-bag.mkd +0 -121
- data/distro/common/markdown/man1/knife-environment.mkd +0 -151
- data/distro/common/markdown/man1/knife-exec.mkd +0 -37
- data/distro/common/markdown/man1/knife-index.mkd +0 -30
- data/distro/common/markdown/man1/knife-node.mkd +0 -130
- data/distro/common/markdown/man1/knife-role.mkd +0 -85
- data/distro/common/markdown/man1/knife-search.mkd +0 -180
- data/distro/common/markdown/man1/knife-ssh.mkd +0 -69
- data/distro/common/markdown/man1/knife-status.mkd +0 -36
- data/distro/common/markdown/man1/knife-tag.mkd +0 -39
- data/distro/common/markdown/man1/knife.mkd +0 -218
- data/distro/common/markdown/man1/shef.mkd +0 -189
- data/distro/common/markdown/man8/chef-client.mkd +0 -74
- data/distro/common/markdown/man8/chef-expander.mkd +0 -82
- data/distro/common/markdown/man8/chef-expanderctl.mkd +0 -58
- data/distro/common/markdown/man8/chef-server-webui.mkd +0 -121
- data/distro/common/markdown/man8/chef-server.mkd +0 -121
- data/distro/common/markdown/man8/chef-solo.mkd +0 -107
- data/distro/common/markdown/man8/chef-solr.mkd +0 -89
- data/distro/debian/etc/default/chef-client +0 -4
- data/distro/debian/etc/default/chef-expander +0 -8
- data/distro/debian/etc/default/chef-server +0 -9
- data/distro/debian/etc/default/chef-server-webui +0 -9
- data/distro/debian/etc/default/chef-solr +0 -8
- data/distro/debian/etc/init.d/chef-client +0 -210
- data/distro/debian/etc/init.d/chef-expander +0 -176
- data/distro/debian/etc/init.d/chef-server +0 -122
- data/distro/debian/etc/init.d/chef-server-webui +0 -123
- data/distro/debian/etc/init.d/chef-solr +0 -176
- data/distro/debian/etc/init/chef-client.conf +0 -17
- data/distro/debian/etc/init/chef-expander.conf +0 -17
- data/distro/debian/etc/init/chef-server-webui.conf +0 -17
- data/distro/debian/etc/init/chef-server.conf +0 -17
- data/distro/debian/etc/init/chef-solr.conf +0 -17
- data/distro/redhat/etc/init.d/chef-client +0 -121
- data/distro/redhat/etc/init.d/chef-expander +0 -104
- data/distro/redhat/etc/init.d/chef-server +0 -112
- data/distro/redhat/etc/init.d/chef-server-webui +0 -112
- data/distro/redhat/etc/init.d/chef-solr +0 -104
- data/distro/redhat/etc/logrotate.d/chef-client +0 -8
- data/distro/redhat/etc/logrotate.d/chef-expander +0 -8
- data/distro/redhat/etc/logrotate.d/chef-server +0 -8
- data/distro/redhat/etc/logrotate.d/chef-server-webui +0 -8
- data/distro/redhat/etc/logrotate.d/chef-solr +0 -8
- data/distro/redhat/etc/sysconfig/chef-client +0 -15
- data/distro/redhat/etc/sysconfig/chef-expander +0 -7
- data/distro/redhat/etc/sysconfig/chef-server +0 -14
- data/distro/redhat/etc/sysconfig/chef-server-webui +0 -14
- data/distro/redhat/etc/sysconfig/chef-solr +0 -8
- data/distro/windows/service_manager.rb +0 -164
@@ -1,104 +0,0 @@
|
|
1
|
-
#!/bin/bash
|
2
|
-
#
|
3
|
-
# chef-solr Startup script for the SOLR search engine
|
4
|
-
#
|
5
|
-
# chkconfig: - 94 06
|
6
|
-
# description: SOLR search engine for the Chef Server.
|
7
|
-
|
8
|
-
### BEGIN INIT INFO
|
9
|
-
# Provides: chef-solr
|
10
|
-
# Required-Start: $local_fs $network $remote_fs
|
11
|
-
# Required-Stop: $local_fs $network $remote_fs
|
12
|
-
# Should-Start: $named $time
|
13
|
-
# Should-Stop: $named $time
|
14
|
-
# Short-Description: Startup script for the SOLR search engine
|
15
|
-
# Description: SOLR search engine for the Chef Server.
|
16
|
-
### END INIT INFO
|
17
|
-
|
18
|
-
# Source function library
|
19
|
-
. /etc/init.d/functions
|
20
|
-
|
21
|
-
exec="/usr/bin/chef-solr"
|
22
|
-
prog="chef-solr"
|
23
|
-
|
24
|
-
[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
|
25
|
-
|
26
|
-
config=${CONFIG-/etc/chef/solr.rb}
|
27
|
-
pidfile=${PIDFILE-/var/run/chef/solr.pid}
|
28
|
-
lockfile=${LOCKFILE-/var/lock/subsys/$prog}
|
29
|
-
logfile=${LOGFILE-/var/log/chef/solr.log}
|
30
|
-
options=${OPTIONS-}
|
31
|
-
|
32
|
-
start() {
|
33
|
-
[ -x $exec ] || exit 5
|
34
|
-
[ -f $config ] || exit 6
|
35
|
-
echo -n $"Starting $prog: "
|
36
|
-
daemon $prog -d -c "$config" -L "$logfile" -P "$pidfile" "$options"
|
37
|
-
retval=$?
|
38
|
-
echo
|
39
|
-
[ $retval -eq 0 ] && touch $lockfile
|
40
|
-
return $retval
|
41
|
-
}
|
42
|
-
|
43
|
-
stop() {
|
44
|
-
echo -n $"Stopping $prog: "
|
45
|
-
killproc -p $pidfile $prog
|
46
|
-
retval=$?
|
47
|
-
echo
|
48
|
-
[ $retval -eq 0 ] && rm -f $lockfile
|
49
|
-
return $retval
|
50
|
-
}
|
51
|
-
|
52
|
-
restart () {
|
53
|
-
stop
|
54
|
-
start
|
55
|
-
}
|
56
|
-
|
57
|
-
reload() {
|
58
|
-
restart
|
59
|
-
}
|
60
|
-
|
61
|
-
force_reload() {
|
62
|
-
restart
|
63
|
-
}
|
64
|
-
|
65
|
-
rh_status() {
|
66
|
-
# run checks to determine if the service is running or use generic status
|
67
|
-
status -p $pidfile $prog
|
68
|
-
}
|
69
|
-
|
70
|
-
rh_status_q() {
|
71
|
-
rh_status >/dev/null 2>&1
|
72
|
-
}
|
73
|
-
|
74
|
-
case "$1" in
|
75
|
-
start)
|
76
|
-
rh_status_q && exit 0
|
77
|
-
$1
|
78
|
-
;;
|
79
|
-
stop)
|
80
|
-
rh_status_q || exit 0
|
81
|
-
$1
|
82
|
-
;;
|
83
|
-
restart)
|
84
|
-
$1
|
85
|
-
;;
|
86
|
-
reload)
|
87
|
-
rh_status_q || exit 7
|
88
|
-
$1
|
89
|
-
;;
|
90
|
-
force-reload)
|
91
|
-
force_reload
|
92
|
-
;;
|
93
|
-
status)
|
94
|
-
rh_status
|
95
|
-
;;
|
96
|
-
condrestart|try-restart)
|
97
|
-
rh_status_q || exit 0
|
98
|
-
restart
|
99
|
-
;;
|
100
|
-
*)
|
101
|
-
echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
|
102
|
-
exit 2
|
103
|
-
esac
|
104
|
-
exit $?
|
@@ -1,15 +0,0 @@
|
|
1
|
-
# Configuration file for the chef-client service
|
2
|
-
|
3
|
-
#CONFIG=/etc/chef/client.rb
|
4
|
-
#PIDFILE=/var/run/chef/client.pid
|
5
|
-
#LOCKFILE=/var/lock/subsys/chef-client
|
6
|
-
#LOGFILE=/var/log/chef/client.log
|
7
|
-
# Sleep interval between runs.
|
8
|
-
# This value is in seconds.
|
9
|
-
#INTERVAL=1800
|
10
|
-
# Maximum amount of random delay before starting a run. Prevents every client
|
11
|
-
# from contacting the server at the exact same time.
|
12
|
-
# This value is in seconds.
|
13
|
-
#SPLAY=20
|
14
|
-
# Any additional chef-client options.
|
15
|
-
#OPTIONS=
|
@@ -1,14 +0,0 @@
|
|
1
|
-
# Configuration file for the chef-server service
|
2
|
-
|
3
|
-
#CONFIG=/etc/chef/server.rb
|
4
|
-
#PIDFILE=/var/run/chef/server.pid
|
5
|
-
#LOCKFILE=/var/lock/subsys/chef-server
|
6
|
-
#LOGFILE=/var/log/chef/server.log
|
7
|
-
#PORT=4000
|
8
|
-
#ENVIRONMENT=production
|
9
|
-
#ADAPTER=thin
|
10
|
-
#CHILDPIDFILES=/var/run/chef/server.%s.pid
|
11
|
-
#SERVER_USER=chef
|
12
|
-
#SERVER_GROUP=chef
|
13
|
-
# Any additional chef-server options.
|
14
|
-
#OPTIONS=
|
@@ -1,14 +0,0 @@
|
|
1
|
-
# Configuration file for the chef-server-webui service
|
2
|
-
|
3
|
-
#CONFIG=/etc/chef/webui.rb
|
4
|
-
#PIDFILE=/var/run/chef/server-webui.pid
|
5
|
-
#LOCKFILE=/var/lock/subsys/chef-server-webui
|
6
|
-
#LOGFILE=/var/log/chef/server-webui.log
|
7
|
-
#PORT=4040
|
8
|
-
#ENVIRONMENT=production
|
9
|
-
#ADAPTER=thin
|
10
|
-
#CHILDPIDFILES=/var/run/chef/server-webui.%s.pid
|
11
|
-
#SERVER_USER=chef
|
12
|
-
#SERVER_GROUP=chef
|
13
|
-
# Any additional chef-server-webui options.
|
14
|
-
#OPTIONS=
|
@@ -1,164 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# Author:: Seth Chisamore (<schisamo@opscode.com>)
|
3
|
-
# Copyright:: Copyright (c) 2011 Opscode, Inc.
|
4
|
-
# License:: Apache License, Version 2.0
|
5
|
-
#
|
6
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
-
# you may not use this file except in compliance with the License.
|
8
|
-
# You may obtain a copy of the License at
|
9
|
-
#
|
10
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
-
#
|
12
|
-
# Unless required by applicable law or agreed to in writing, software
|
13
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
-
# See the License for the specific language governing permissions and
|
16
|
-
# limitations under the License.
|
17
|
-
#
|
18
|
-
|
19
|
-
require 'win32/service'
|
20
|
-
require 'rbconfig'
|
21
|
-
require 'mixlib/cli'
|
22
|
-
|
23
|
-
class Chef
|
24
|
-
class Windows
|
25
|
-
class ServiceManager
|
26
|
-
include Config
|
27
|
-
include Mixlib::CLI
|
28
|
-
|
29
|
-
option :action,
|
30
|
-
:short => "-a ACTION",
|
31
|
-
:long => "--action ACTION",
|
32
|
-
:default => "start",
|
33
|
-
:description => "Action to carry out on the resource; one of 'install', 'uninstall', 'start', 'stop', 'pause', or 'resume'"
|
34
|
-
|
35
|
-
option :name,
|
36
|
-
:short => "-n NAME",
|
37
|
-
:long => "--name NAME",
|
38
|
-
:default => "chef-client",
|
39
|
-
:description => "The service name to use."
|
40
|
-
|
41
|
-
option :display_name,
|
42
|
-
:long => "--display_name NAME",
|
43
|
-
:default => "chef-client",
|
44
|
-
:description => "The display name to use for the service."
|
45
|
-
|
46
|
-
option :description,
|
47
|
-
:short => "-d DESCRIPTION",
|
48
|
-
:long => "--description DESCRIPTION",
|
49
|
-
:default => "chef-client",
|
50
|
-
:description => "The description for the service."
|
51
|
-
|
52
|
-
option :config_file,
|
53
|
-
:short => "-c CONFIG",
|
54
|
-
:long => "--config CONFIG",
|
55
|
-
:default => "#{ENV['SYSTEMDRIVE']}/chef/client.rb",
|
56
|
-
:description => "The configuration file to use"
|
57
|
-
|
58
|
-
option :log_location,
|
59
|
-
:short => "-L LOGLOCATION",
|
60
|
-
:long => "--logfile LOGLOCATION",
|
61
|
-
:description => "Set the log file location",
|
62
|
-
:default => "#{ENV['SYSTEMDRIVE']}/chef/client.log"
|
63
|
-
|
64
|
-
option :splay,
|
65
|
-
:short => "-s SECONDS",
|
66
|
-
:long => "--splay SECONDS",
|
67
|
-
:description => "The splay time for running at intervals, in seconds",
|
68
|
-
:proc => lambda { |s| s.to_i }
|
69
|
-
|
70
|
-
option :interval,
|
71
|
-
:short => "-i SECONDS",
|
72
|
-
:long => "--interval SECONDS",
|
73
|
-
:description => "Set the number of seconds to wait between chef-client runs",
|
74
|
-
:proc => lambda { |s| s.to_i }
|
75
|
-
|
76
|
-
option :help,
|
77
|
-
:short => "-h",
|
78
|
-
:long => "--help",
|
79
|
-
:description => "Show this message",
|
80
|
-
:on => :tail,
|
81
|
-
:boolean => true,
|
82
|
-
:show_options => true,
|
83
|
-
:exit => 0
|
84
|
-
|
85
|
-
def run
|
86
|
-
parse_options
|
87
|
-
|
88
|
-
case config[:action]
|
89
|
-
when 'install'
|
90
|
-
ruby = File.join(RbConfig::CONFIG['bindir'], 'ruby')
|
91
|
-
path = File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'lib', 'chef', 'application', 'windows_service.rb'))
|
92
|
-
|
93
|
-
opts = ""
|
94
|
-
opts << " -c #{config[:config_file]}" if config[:config_file]
|
95
|
-
opts << " -L #{config[:log_location]}" if config[:log_location]
|
96
|
-
opts << " -i #{config[:interval]}" if config[:interval]
|
97
|
-
opts << " -s #{config[:splay]}" if config[:splay]
|
98
|
-
|
99
|
-
# Quote the full paths to deal with possible spaces in the path name.
|
100
|
-
# Also ensure all forward slashes are backslashes
|
101
|
-
cmd = "\"#{ruby}\" \"#{path}\" #{opts}".gsub(File::SEPARATOR, File::ALT_SEPARATOR)
|
102
|
-
|
103
|
-
Win32::Service.new(
|
104
|
-
:service_name => config[:name],
|
105
|
-
:display_name => config[:display_name],
|
106
|
-
:description => config[:description],
|
107
|
-
:binary_path_name => cmd)
|
108
|
-
puts "Service '#{config[:name]}' has successfully been 'installed'."
|
109
|
-
when 'start'
|
110
|
-
# TODO: allow override of startup parameters here?
|
111
|
-
take_action('start', RUNNING) if Win32::Service.exists?(config[:name])
|
112
|
-
when 'stop'
|
113
|
-
take_action('stop', STOPPED) if Win32::Service.exists?(config[:name])
|
114
|
-
when 'uninstall', 'delete'
|
115
|
-
take_action('stop', STOPPED)
|
116
|
-
if Win32::Service.exists?(config[:name])
|
117
|
-
Win32::Service.delete(config[:name])
|
118
|
-
puts "Service #{config[:name]} deleted"
|
119
|
-
end
|
120
|
-
when 'pause'
|
121
|
-
take_action('pause', PAUSED)
|
122
|
-
when 'resume'
|
123
|
-
take_action('resume', RUNNING)
|
124
|
-
end
|
125
|
-
end
|
126
|
-
|
127
|
-
private
|
128
|
-
|
129
|
-
# Just some state constants
|
130
|
-
STOPPED = "stopped"
|
131
|
-
RUNNING = "running"
|
132
|
-
PAUSED = "paused"
|
133
|
-
|
134
|
-
def take_action(action=nil, desired_state=nil)
|
135
|
-
if Win32::Service.exists?(config[:name])
|
136
|
-
if current_state != desired_state
|
137
|
-
Win32::Service.send(action, config[:name])
|
138
|
-
wait_for_state(desired_state)
|
139
|
-
puts "Service '#{config[:name]}' is now '#{current_state}'."
|
140
|
-
else
|
141
|
-
puts "Service '#{config[:name]}' is already '#{desired_state}'."
|
142
|
-
end
|
143
|
-
else
|
144
|
-
puts "Cannot '#{action}' service '#{config[:name]}', service does not exist."
|
145
|
-
end
|
146
|
-
end
|
147
|
-
|
148
|
-
def current_state
|
149
|
-
Win32::Service.status(config[:name]).current_state
|
150
|
-
end
|
151
|
-
|
152
|
-
# Helper method that waits for a status to change its state since state
|
153
|
-
# changes aren't usually instantaneous.
|
154
|
-
def wait_for_state(desired_state)
|
155
|
-
while current_state != desired_state
|
156
|
-
puts "One moment... #{current_state}"
|
157
|
-
sleep 1
|
158
|
-
end
|
159
|
-
end
|
160
|
-
end
|
161
|
-
end
|
162
|
-
end
|
163
|
-
|
164
|
-
Chef::Windows::ServiceManager.new.run
|