giraffesoft-chef 0.7.15
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +201 -0
- data/README.rdoc +135 -0
- data/bin/chef-client +26 -0
- data/bin/chef-solo +26 -0
- data/distro/debian/etc/init.d/chef-client +175 -0
- data/distro/debian/etc/init.d/chef-indexer +175 -0
- data/distro/debian/etc/init.d/chef-server +120 -0
- data/distro/debian/man/man1/chef-indexer.1 +42 -0
- data/distro/debian/man/man1/chef-server.1 +108 -0
- data/distro/debian/man/man8/chef-client.8 +61 -0
- data/distro/debian/man/man8/chef-solo.8 +58 -0
- data/distro/redhat/etc/chef/client.rb +16 -0
- data/distro/redhat/etc/chef/indexer.rb +10 -0
- data/distro/redhat/etc/chef/server.rb +22 -0
- data/distro/redhat/etc/init.d/chef-client +74 -0
- data/distro/redhat/etc/init.d/chef-indexer +76 -0
- data/distro/redhat/etc/init.d/chef-server +77 -0
- data/lib/chef.rb +49 -0
- data/lib/chef/application.rb +98 -0
- data/lib/chef/application/agent.rb +18 -0
- data/lib/chef/application/client.rb +209 -0
- data/lib/chef/application/indexer.rb +141 -0
- data/lib/chef/application/server.rb +18 -0
- data/lib/chef/application/solo.rb +214 -0
- data/lib/chef/client.rb +421 -0
- data/lib/chef/compile.rb +170 -0
- data/lib/chef/config.rb +141 -0
- data/lib/chef/cookbook.rb +171 -0
- data/lib/chef/cookbook/metadata.rb +407 -0
- data/lib/chef/cookbook/metadata/version.rb +87 -0
- data/lib/chef/cookbook_loader.rb +180 -0
- data/lib/chef/couchdb.rb +176 -0
- data/lib/chef/daemon.rb +170 -0
- data/lib/chef/exceptions.rb +36 -0
- data/lib/chef/file_cache.rb +205 -0
- data/lib/chef/log.rb +39 -0
- data/lib/chef/mixin/check_helper.rb +31 -0
- data/lib/chef/mixin/checksum.rb +37 -0
- data/lib/chef/mixin/command.rb +386 -0
- data/lib/chef/mixin/convert_to_class_name.rb +48 -0
- data/lib/chef/mixin/create_path.rb +56 -0
- data/lib/chef/mixin/deep_merge.rb +36 -0
- data/lib/chef/mixin/find_preferred_file.rb +92 -0
- data/lib/chef/mixin/from_file.rb +50 -0
- data/lib/chef/mixin/generate_url.rb +49 -0
- data/lib/chef/mixin/language.rb +79 -0
- data/lib/chef/mixin/params_validate.rb +197 -0
- data/lib/chef/mixin/recipe_definition_dsl_core.rb +77 -0
- data/lib/chef/mixin/template.rb +84 -0
- data/lib/chef/node.rb +406 -0
- data/lib/chef/node/attribute.rb +412 -0
- data/lib/chef/openid_registration.rb +181 -0
- data/lib/chef/platform.rb +254 -0
- data/lib/chef/provider.rb +101 -0
- data/lib/chef/provider/cron.rb +187 -0
- data/lib/chef/provider/deploy.rb +281 -0
- data/lib/chef/provider/deploy/revision.rb +70 -0
- data/lib/chef/provider/deploy/timestamped.rb +33 -0
- data/lib/chef/provider/directory.rb +72 -0
- data/lib/chef/provider/execute.rb +58 -0
- data/lib/chef/provider/file.rb +191 -0
- data/lib/chef/provider/git.rb +198 -0
- data/lib/chef/provider/group.rb +120 -0
- data/lib/chef/provider/group/gpasswd.rb +50 -0
- data/lib/chef/provider/group/groupadd.rb +78 -0
- data/lib/chef/provider/group/pw.rb +88 -0
- data/lib/chef/provider/group/usermod.rb +57 -0
- data/lib/chef/provider/http_request.rb +102 -0
- data/lib/chef/provider/ifconfig.rb +131 -0
- data/lib/chef/provider/link.rb +157 -0
- data/lib/chef/provider/mount.rb +117 -0
- data/lib/chef/provider/mount/mount.rb +208 -0
- data/lib/chef/provider/package.rb +160 -0
- data/lib/chef/provider/package/apt.rb +110 -0
- data/lib/chef/provider/package/dpkg.rb +109 -0
- data/lib/chef/provider/package/freebsd.rb +153 -0
- data/lib/chef/provider/package/macports.rb +105 -0
- data/lib/chef/provider/package/portage.rb +124 -0
- data/lib/chef/provider/package/rpm.rb +99 -0
- data/lib/chef/provider/package/rubygems.rb +136 -0
- data/lib/chef/provider/package/yum-dump.py +106 -0
- data/lib/chef/provider/package/yum.rb +175 -0
- data/lib/chef/provider/remote_directory.rb +126 -0
- data/lib/chef/provider/remote_file.rb +141 -0
- data/lib/chef/provider/route.rb +118 -0
- data/lib/chef/provider/ruby_block.rb +15 -0
- data/lib/chef/provider/script.rb +42 -0
- data/lib/chef/provider/service.rb +135 -0
- data/lib/chef/provider/service/debian.rb +64 -0
- data/lib/chef/provider/service/freebsd.rb +157 -0
- data/lib/chef/provider/service/gentoo.rb +54 -0
- data/lib/chef/provider/service/init.rb +71 -0
- data/lib/chef/provider/service/redhat.rb +62 -0
- data/lib/chef/provider/service/simple.rb +115 -0
- data/lib/chef/provider/subversion.rb +148 -0
- data/lib/chef/provider/template.rb +143 -0
- data/lib/chef/provider/user.rb +170 -0
- data/lib/chef/provider/user/pw.rb +113 -0
- data/lib/chef/provider/user/useradd.rb +107 -0
- data/lib/chef/queue.rb +145 -0
- data/lib/chef/recipe.rb +144 -0
- data/lib/chef/resource.rb +380 -0
- data/lib/chef/resource/apt_package.rb +34 -0
- data/lib/chef/resource/bash.rb +33 -0
- data/lib/chef/resource/cron.rb +179 -0
- data/lib/chef/resource/csh.rb +33 -0
- data/lib/chef/resource/deploy.rb +350 -0
- data/lib/chef/resource/deploy_revision.rb +35 -0
- data/lib/chef/resource/directory.rb +76 -0
- data/lib/chef/resource/dpkg_package.rb +34 -0
- data/lib/chef/resource/execute.rb +127 -0
- data/lib/chef/resource/file.rb +84 -0
- data/lib/chef/resource/gem_package.rb +41 -0
- data/lib/chef/resource/git.rb +36 -0
- data/lib/chef/resource/group.rb +70 -0
- data/lib/chef/resource/http_request.rb +52 -0
- data/lib/chef/resource/ifconfig.rb +134 -0
- data/lib/chef/resource/link.rb +78 -0
- data/lib/chef/resource/macports_package.rb +29 -0
- data/lib/chef/resource/mount.rb +135 -0
- data/lib/chef/resource/package.rb +80 -0
- data/lib/chef/resource/perl.rb +33 -0
- data/lib/chef/resource/portage_package.rb +33 -0
- data/lib/chef/resource/python.rb +33 -0
- data/lib/chef/resource/remote_directory.rb +91 -0
- data/lib/chef/resource/remote_file.rb +60 -0
- data/lib/chef/resource/route.rb +135 -0
- data/lib/chef/resource/ruby.rb +33 -0
- data/lib/chef/resource/ruby_block.rb +20 -0
- data/lib/chef/resource/scm.rb +129 -0
- data/lib/chef/resource/script.rb +51 -0
- data/lib/chef/resource/service.rb +134 -0
- data/lib/chef/resource/subversion.rb +33 -0
- data/lib/chef/resource/template.rb +60 -0
- data/lib/chef/resource/timestamped_deploy.rb +31 -0
- data/lib/chef/resource/user.rb +98 -0
- data/lib/chef/resource_collection.rb +204 -0
- data/lib/chef/resource_definition.rb +67 -0
- data/lib/chef/rest.rb +238 -0
- data/lib/chef/role.rb +231 -0
- data/lib/chef/run_list.rb +156 -0
- data/lib/chef/runner.rb +130 -0
- data/lib/chef/search.rb +88 -0
- data/lib/chef/search/result.rb +64 -0
- data/lib/chef/search_index.rb +77 -0
- data/lib/chef/tasks/chef_repo.rake +347 -0
- data/lib/chef/util/file_edit.rb +125 -0
- data/lib/chef/util/fileedit.rb +121 -0
- metadata +293 -0
@@ -0,0 +1,61 @@
|
|
1
|
+
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.36.
|
2
|
+
.TH CHEF-CLIENT: "8" "August 2009" "chef-client 0.7.8" "System Administration Utilities"
|
3
|
+
.SH NAME
|
4
|
+
chef-client: \- Runs a client node connecting to a chef-server.
|
5
|
+
.SH SYNOPSIS
|
6
|
+
.B chef-client
|
7
|
+
\fI(options)\fR
|
8
|
+
.SH DESCRIPTION
|
9
|
+
.TP
|
10
|
+
\fB\-S\fR, \fB\-\-server\fR CHEFSERVERURL
|
11
|
+
The chef server URL
|
12
|
+
.TP
|
13
|
+
\fB\-c\fR, \fB\-\-config\fR CONFIG
|
14
|
+
The configuration file to use
|
15
|
+
.TP
|
16
|
+
\fB\-d\fR, \fB\-\-daemonize\fR
|
17
|
+
Daemonize the process
|
18
|
+
.TP
|
19
|
+
\fB\-g\fR, \fB\-\-group\fR GROUP
|
20
|
+
Group to set privilege to
|
21
|
+
.TP
|
22
|
+
\fB\-i\fR, \fB\-\-interval\fR SECONDS
|
23
|
+
Run chef\-client periodically, in seconds
|
24
|
+
.TP
|
25
|
+
\fB\-j\fR JSON_ATTRIBS
|
26
|
+
Load attributes from a JSON file or URL
|
27
|
+
.HP
|
28
|
+
\fB\-\-json\-attributes\fR
|
29
|
+
.TP
|
30
|
+
\fB\-l\fR, \fB\-\-log_level\fR LEVEL
|
31
|
+
Set the log level (debug, info, warn, error, fatal)
|
32
|
+
.TP
|
33
|
+
\fB\-L\fR, \fB\-\-logfile\fR LOGLOCATION
|
34
|
+
Set the log file location, defaults to STDOUT \- recommended for daemonizing
|
35
|
+
.TP
|
36
|
+
\fB\-N\fR, \fB\-\-node\-name\fR NODE_NAME
|
37
|
+
The node name for this client
|
38
|
+
.TP
|
39
|
+
\fB\-s\fR, \fB\-\-splay\fR SECONDS
|
40
|
+
The splay time for running at intervals, in seconds
|
41
|
+
.TP
|
42
|
+
\fB\-u\fR, \fB\-\-user\fR USER
|
43
|
+
User to set privilege to
|
44
|
+
.TP
|
45
|
+
\fB\-t\fR, \fB\-\-token\fR TOKEN
|
46
|
+
Set the openid validation token
|
47
|
+
.TP
|
48
|
+
\fB\-v\fR, \fB\-\-version\fR
|
49
|
+
Show chef version
|
50
|
+
.TP
|
51
|
+
\fB\-h\fR, \fB\-\-help\fR
|
52
|
+
Show this message
|
53
|
+
.SH "SEE ALSO"
|
54
|
+
Full documentation for Chef and chef-client is located on the Chef wiki, http://wiki.opscode.com/display/chef/Home.
|
55
|
+
.SH AUTHOR
|
56
|
+
Chef was written by Adam Jacob <adam@ospcode.com> of Opscode (http://www.opscode.com), with contributions from the community.
|
57
|
+
This manual page was written by Joshua Timberman <joshua@opscode.com> with help2man. Permission is granted
|
58
|
+
to copy, distribute and / or modify this document under the terms of the Apache 2.0 License.
|
59
|
+
|
60
|
+
On Debian systems, the complete text of the Apache 2.0 License can be found in
|
61
|
+
/usr/share/common-licenses/Apache-2.0.
|
@@ -0,0 +1,58 @@
|
|
1
|
+
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.36.
|
2
|
+
.TH CHEF-SOLO: "8" "August 2009" "chef-solo 0.7.8" "System Administration Utilities"
|
3
|
+
.SH NAME
|
4
|
+
chef-solo: \- Runs chef in solo mode against a specified cookbook location.
|
5
|
+
.SH SYNOPSIS
|
6
|
+
.B chef-solo
|
7
|
+
\fI(options)\fR
|
8
|
+
.SH DESCRIPTION
|
9
|
+
.TP
|
10
|
+
\fB\-c\fR, \fB\-\-config\fR CONFIG
|
11
|
+
The configuration file to use
|
12
|
+
.TP
|
13
|
+
\fB\-d\fR, \fB\-\-daemonize\fR
|
14
|
+
Daemonize the process
|
15
|
+
.TP
|
16
|
+
\fB\-g\fR, \fB\-\-group\fR GROUP
|
17
|
+
Group to set privilege to
|
18
|
+
.TP
|
19
|
+
\fB\-i\fR, \fB\-\-interval\fR SECONDS
|
20
|
+
Run chef\-client periodically, in seconds
|
21
|
+
.TP
|
22
|
+
\fB\-j\fR JSON_ATTRIBS
|
23
|
+
Load attributes from a JSON file or URL
|
24
|
+
.HP
|
25
|
+
\fB\-\-json\-attributes\fR
|
26
|
+
.TP
|
27
|
+
\fB\-l\fR, \fB\-\-log_level\fR LEVEL
|
28
|
+
Set the log level (debug, info, warn, error, fatal)
|
29
|
+
.TP
|
30
|
+
\fB\-L\fR, \fB\-\-logfile\fR LOGLOCATION
|
31
|
+
Set the log file location, defaults to STDOUT
|
32
|
+
.TP
|
33
|
+
\fB\-N\fR, \fB\-\-node\-name\fR NODE_NAME
|
34
|
+
The node name for this client
|
35
|
+
.TP
|
36
|
+
\fB\-r\fR, \fB\-\-recipe\-url\fR RECIPE_URL
|
37
|
+
Pull down a remote gzipped tarball of recipes and untar it to the cookbook cache.
|
38
|
+
.TP
|
39
|
+
\fB\-s\fR, \fB\-\-splay\fR SECONDS
|
40
|
+
The splay time for running at intervals, in seconds
|
41
|
+
.TP
|
42
|
+
\fB\-u\fR, \fB\-\-user\fR USER
|
43
|
+
User to set privilege to
|
44
|
+
.TP
|
45
|
+
\fB\-v\fR, \fB\-\-version\fR
|
46
|
+
Show chef version
|
47
|
+
.TP
|
48
|
+
\fB\-h\fR, \fB\-\-help\fR
|
49
|
+
Show this message
|
50
|
+
.SH "SEE ALSO"
|
51
|
+
Full documentation for Chef and chef-solo is located on the Chef wiki, http://wiki.opscode.com/display/chef/Home.
|
52
|
+
.SH AUTHOR
|
53
|
+
Chef was written by Adam Jacob <adam@ospcode.com> of Opscode (http://www.opscode.com), with contributions from the community.
|
54
|
+
This manual page was written by Joshua Timberman <joshua@opscode.com> with help2man. Permission is granted
|
55
|
+
to copy, distribute and / or modify this document under the terms of the Apache 2.0 License.
|
56
|
+
|
57
|
+
On Debian systems, the complete text of the Apache 2.0 License can be found in
|
58
|
+
/usr/share/common-licenses/Apache-2.0.
|
@@ -0,0 +1,16 @@
|
|
1
|
+
#
|
2
|
+
# Chef Client Config File
|
3
|
+
#
|
4
|
+
|
5
|
+
log_level :info
|
6
|
+
ssl_verify_mode :verify_none
|
7
|
+
registration_url "http://127.0.0.1:4000"
|
8
|
+
openid_url "http://127.0.0.1:4001"
|
9
|
+
template_url "http://127.0.0.1:4000"
|
10
|
+
remotefile_url "http://127.0.0.1:4000"
|
11
|
+
search_url "http://127.0.0.1:4000"
|
12
|
+
|
13
|
+
pid_file "/var/run/chef/chef-client.pid"
|
14
|
+
|
15
|
+
#interval 1800
|
16
|
+
#splay 0
|
@@ -0,0 +1,22 @@
|
|
1
|
+
#
|
2
|
+
# Chef Server Config File
|
3
|
+
#
|
4
|
+
|
5
|
+
log_level :info
|
6
|
+
ssl_verify_mode :verify_none
|
7
|
+
registration_url "http://cserver:4000"
|
8
|
+
openid_url "http://cserver:4001"
|
9
|
+
template_url "http://cserver:4000"
|
10
|
+
remotefile_url "http://cserver:4000"
|
11
|
+
search_url "http://cserver:4000"
|
12
|
+
cookbook_path [ "/var/lib/chef/site-cookbooks", "/var/lib/chef/cookbooks" ]
|
13
|
+
|
14
|
+
merb_root "/var/lib/chef/merb"
|
15
|
+
node_path "/etc/chef/node"
|
16
|
+
file_store_path "/var/lib/chef/store"
|
17
|
+
search_index_path "/var/lib/chef/search_index"
|
18
|
+
openid_store_path "/var/lib/chef/openid/db"
|
19
|
+
openid_cstore_path "/var/lib/chef/openid/cstore"
|
20
|
+
file_cache_path "/var/lib/chef/cache"
|
21
|
+
|
22
|
+
Chef::Log::Formatter.show_time = false
|
@@ -0,0 +1,74 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
# Startup script for chef-client
|
3
|
+
#
|
4
|
+
# chkconfig: - 98 02
|
5
|
+
# description: Client component of the Chef systems integration framework.
|
6
|
+
# processname: chef-client
|
7
|
+
#
|
8
|
+
# config: /etc/sysconfig/chef-client
|
9
|
+
# pidfile: /var/run/chef/chef-client.pid
|
10
|
+
|
11
|
+
# Source function library
|
12
|
+
. /etc/init.d/functions
|
13
|
+
|
14
|
+
[ -f /etc/sysconfig/chef-client ] && . /etc/sysconfig/chef-client
|
15
|
+
|
16
|
+
prog="chef-client"
|
17
|
+
pidfile=${PIDFILE-/var/run/chef/chef-client.pid}
|
18
|
+
lockfile=${LOCKFILE-/var/lock/subsys/$prog}
|
19
|
+
config=${CONFIG-/etc/chef/client.rb}
|
20
|
+
logfile=${LOGFILE-/var/log/chef/chef-client.log}
|
21
|
+
OPTIONS=
|
22
|
+
|
23
|
+
start() {
|
24
|
+
echo -n "Starting $prog:"
|
25
|
+
daemon chef-client -d -c "$config" -L "$logfile" "$OPTIONS" ">/dev/null"
|
26
|
+
RETVAL=$?
|
27
|
+
echo
|
28
|
+
[ $RETVAL -eq 0 ] && touch ${lockfile}
|
29
|
+
return $RETVAL
|
30
|
+
}
|
31
|
+
|
32
|
+
stop() {
|
33
|
+
echo -n "Stopping $prog: "
|
34
|
+
if [ -f $pidfile ]; then
|
35
|
+
killproc chef-client
|
36
|
+
RETVAL=$?
|
37
|
+
if [ $RETVAL -ne 0 ]; then
|
38
|
+
failure;
|
39
|
+
fi;
|
40
|
+
else
|
41
|
+
RETVAL=1
|
42
|
+
failure;
|
43
|
+
fi
|
44
|
+
rm -f $lockfile
|
45
|
+
echo
|
46
|
+
return $RETVAL
|
47
|
+
}
|
48
|
+
|
49
|
+
case "$1" in
|
50
|
+
start)
|
51
|
+
start
|
52
|
+
;;
|
53
|
+
stop)
|
54
|
+
stop
|
55
|
+
;;
|
56
|
+
restart)
|
57
|
+
stop
|
58
|
+
start
|
59
|
+
;;
|
60
|
+
condrestart)
|
61
|
+
if [ -f $lockfile ]; then
|
62
|
+
stop
|
63
|
+
start
|
64
|
+
fi
|
65
|
+
;;
|
66
|
+
status)
|
67
|
+
status chef-client
|
68
|
+
;;
|
69
|
+
*)
|
70
|
+
echo "Usage: $0 {start|stop|restart|condrestart|status}"
|
71
|
+
exit 1
|
72
|
+
esac
|
73
|
+
|
74
|
+
exit $RETVAL
|
@@ -0,0 +1,76 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
# Startup script for chef-indexer
|
3
|
+
#
|
4
|
+
# chkconfig: - 75 25
|
5
|
+
# description: Server component of the Chef systems integration framework.
|
6
|
+
# processname: chef-indexer
|
7
|
+
#
|
8
|
+
# config: /etc/sysconfig/chef-indexer
|
9
|
+
# pidfile: /var/run/chef/chef-indexer.pid
|
10
|
+
|
11
|
+
# Source function library
|
12
|
+
. /etc/init.d/functions
|
13
|
+
|
14
|
+
[ -f /etc/sysconfig/chef-indexer ] && . /etc/sysconfig/chef-indexer
|
15
|
+
|
16
|
+
prog="chef-indexer"
|
17
|
+
PIDFILE=/var/run/chef/chef-indexer.pid
|
18
|
+
LOCKFILE=/var/lock/subsys/$prog
|
19
|
+
CONFIG=/etc/chef/indexer.rb
|
20
|
+
USER="chef"
|
21
|
+
GROUP="chef"
|
22
|
+
LOGFILE=/var/log/chef/chef-indexer.log
|
23
|
+
OPTIONS=
|
24
|
+
|
25
|
+
start() {
|
26
|
+
echo -n "Starting $prog:"
|
27
|
+
daemon chef-indexer -d -c "$CONFIG" -u "$USER" -g "$GROUP" -L "$LOGFILE" "$OPTIONS" ">/dev/null"
|
28
|
+
RETVAL=$?
|
29
|
+
echo
|
30
|
+
[ $RETVAL -eq 0 ] && touch ${LOCKFILE}
|
31
|
+
return $RETVAL
|
32
|
+
}
|
33
|
+
|
34
|
+
stop() {
|
35
|
+
echo -n "Stopping $prog: "
|
36
|
+
if [ -f $PIDFILE ]; then
|
37
|
+
killproc chef-indexer
|
38
|
+
RETVAL=$?
|
39
|
+
if [ $RETVAL -ne 0 ]; then
|
40
|
+
failure;
|
41
|
+
fi;
|
42
|
+
else
|
43
|
+
RETVAL=1
|
44
|
+
failure;
|
45
|
+
fi
|
46
|
+
rm -f $LOCKFILE
|
47
|
+
echo
|
48
|
+
return $RETVAL
|
49
|
+
}
|
50
|
+
|
51
|
+
case "$1" in
|
52
|
+
start)
|
53
|
+
start
|
54
|
+
;;
|
55
|
+
stop)
|
56
|
+
stop
|
57
|
+
;;
|
58
|
+
restart)
|
59
|
+
stop
|
60
|
+
start
|
61
|
+
;;
|
62
|
+
condrestart)
|
63
|
+
if [ -f $LOCKFILE ]; then
|
64
|
+
stop
|
65
|
+
start
|
66
|
+
fi
|
67
|
+
;;
|
68
|
+
status)
|
69
|
+
status chef-indexer
|
70
|
+
;;
|
71
|
+
*)
|
72
|
+
echo "Usage: $0 {start|stop|restart|condrestart|status}"
|
73
|
+
exit 1
|
74
|
+
esac
|
75
|
+
|
76
|
+
exit $RETVAL
|
@@ -0,0 +1,77 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
# Startup script for chef-server
|
3
|
+
#
|
4
|
+
# chkconfig: - 65 35
|
5
|
+
# description: Server component of the Chef systems integration framework.
|
6
|
+
# processname: chef-server
|
7
|
+
#
|
8
|
+
# config: /etc/sysconfig/chef-server
|
9
|
+
# pidfile: /var/run/chef/chef-server.pid
|
10
|
+
|
11
|
+
# Source function library
|
12
|
+
. /etc/init.d/functions
|
13
|
+
|
14
|
+
[ -f /etc/sysconfig/chef-server ] && . /etc/sysconfig/chef-server
|
15
|
+
|
16
|
+
prog="chef-server"
|
17
|
+
PIDFILE=/var/run/chef/chef-server.pid
|
18
|
+
LOCKFILE=/var/lock/subsys/$prog
|
19
|
+
CONFIG=/etc/chef/server.rb
|
20
|
+
USER="chef"
|
21
|
+
GROUP="chef"
|
22
|
+
CLUSTER_NODES=2
|
23
|
+
LOGFILE=/var/log/chef/chef-server-merb.log
|
24
|
+
OPTIONS=
|
25
|
+
|
26
|
+
start() {
|
27
|
+
echo -n "Starting $prog:"
|
28
|
+
daemon chef-server -d -c "$CLUSTER_NODES" -C "$CONFIG" -u "$USER" -G "$GROUP" -L "$LOGFILE" -P "$PIDFILE" "$OPTIONS" ">/dev/null"
|
29
|
+
RETVAL=$?
|
30
|
+
echo
|
31
|
+
[ $RETVAL -eq 0 ] && touch ${LOCKFILE}
|
32
|
+
return $RETVAL
|
33
|
+
}
|
34
|
+
|
35
|
+
stop() {
|
36
|
+
echo -n "Stopping $prog: "
|
37
|
+
if [ -f $PIDFILE ]; then
|
38
|
+
killproc chef-server
|
39
|
+
RETVAL=$?
|
40
|
+
if [ $RETVAL -ne 0 ]; then
|
41
|
+
failure;
|
42
|
+
fi;
|
43
|
+
else
|
44
|
+
RETVAL=1
|
45
|
+
failure;
|
46
|
+
fi
|
47
|
+
rm -f $LOCKFILE
|
48
|
+
echo
|
49
|
+
return $RETVAL
|
50
|
+
}
|
51
|
+
|
52
|
+
case "$1" in
|
53
|
+
start)
|
54
|
+
start
|
55
|
+
;;
|
56
|
+
stop)
|
57
|
+
stop
|
58
|
+
;;
|
59
|
+
restart)
|
60
|
+
stop
|
61
|
+
start
|
62
|
+
;;
|
63
|
+
condrestart)
|
64
|
+
if [ -f $LOCKFILE ]; then
|
65
|
+
stop
|
66
|
+
start
|
67
|
+
fi
|
68
|
+
;;
|
69
|
+
status)
|
70
|
+
status chef-server
|
71
|
+
;;
|
72
|
+
*)
|
73
|
+
echo "Usage: $0 {start|stop|restart|condrestart|status}"
|
74
|
+
exit 1
|
75
|
+
esac
|
76
|
+
|
77
|
+
exit $RETVAL
|
data/lib/chef.rb
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
#
|
2
|
+
# Author:: Adam Jacob (<adam@opscode.com>)
|
3
|
+
# Copyright:: Copyright (c) 2008 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
|
+
$:.unshift(File.dirname(__FILE__)) unless
|
20
|
+
$:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
|
21
|
+
|
22
|
+
require 'rubygems'
|
23
|
+
require 'extlib'
|
24
|
+
require 'chef/exceptions'
|
25
|
+
require 'chef/log'
|
26
|
+
require 'chef/config'
|
27
|
+
Dir[File.join(File.dirname(__FILE__), 'chef/mixin/**/*.rb')].sort.each { |lib| require lib }
|
28
|
+
|
29
|
+
class Chef
|
30
|
+
VERSION = '0.7.15'
|
31
|
+
end
|
32
|
+
|
33
|
+
# Adds a Dir.glob to Ruby 1.8.5, for compat
|
34
|
+
if RUBY_VERSION < "1.8.6"
|
35
|
+
class Dir
|
36
|
+
class << self
|
37
|
+
alias_method :glob_, :glob
|
38
|
+
def glob(pattern, flags=0)
|
39
|
+
raise ArgumentError unless (
|
40
|
+
!pattern.nil? and (
|
41
|
+
pattern.is_a? Array and !pattern.empty?
|
42
|
+
) or pattern.is_a? String
|
43
|
+
)
|
44
|
+
[pattern].flatten.inject([]) { |r, p| r + glob_(p, flags) }
|
45
|
+
end
|
46
|
+
alias_method :[], :glob
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|