forked from chef-boneyard/cookbooks
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bring in support for a rpm based installation of chef server/client via bootstrap. This is done by adding a dist_only? attribute that, if passed to the bootstrap, would attempt to install packages via yum as opposed to the current gem+deb install. This commit also brings in init scripts for chef-client and chef-indexer as opposed to carrying them in rpms.
- Loading branch information
Showing
14 changed files
with
281 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
chef[:indexer_log] = "/var/log/chef/indexer.log" unless chef.has_key?(:indexer_log) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
#!/bin/bash | ||
# Startup script for chef-client. This version is deployed by chef itself. | ||
# | ||
# chkconfig: - 98 02 | ||
# description: Client component of the Chef systems integration framework. | ||
# processname: chef-client | ||
# | ||
# pidfile: <%= @node[:chef][:run_path] %>/chef-client.pid | ||
|
||
# Source function library | ||
. /etc/init.d/functions | ||
|
||
prog="chef-client" | ||
pidfile=<%= @node[:chef][:run_path] %>/chef-client.pid | ||
lockfile=/var/lock/subsys/$prog | ||
config=/etc/chef/client.rb | ||
|
||
start() { | ||
echo -n "Starting $prog:" | ||
daemon chef-client -d -c "$config" -i <%= @node[:chef][:client_interval] %> -s <%= @node[:chef][:client_splay] %> -L <%= @node[:chef][:client_log] %> "&>/dev/null" | ||
RETVAL=$? | ||
echo | ||
[ $RETVAL -eq 0 ] && touch ${lockfile} | ||
return $RETVAL | ||
} | ||
|
||
stop() { | ||
echo -n "Stopping $prog: " | ||
if [ -f $pidfile ]; then | ||
killproc chef-client | ||
RETVAL=$? | ||
if [ $RETVAL -ne 0 ]; then | ||
failure; | ||
fi; | ||
else | ||
RETVAL=1 | ||
failure; | ||
fi | ||
rm -f $lockfile | ||
echo | ||
return $RETVAL | ||
} | ||
|
||
case "$1" in | ||
start) | ||
start | ||
;; | ||
stop) | ||
stop | ||
;; | ||
restart) | ||
stop | ||
start | ||
;; | ||
condrestart) | ||
if [ -f $lockfile ]; then | ||
stop | ||
start | ||
fi | ||
;; | ||
status) | ||
status chef-client | ||
;; | ||
*) | ||
echo "Usage: $0 {start|stop|restart|condrestart|status}" | ||
exit 1 | ||
esac | ||
|
||
exit $RETVAL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
#!/bin/bash | ||
# Startup script for chef-indexer. This version is deployed by chef itself. | ||
# | ||
# chkconfig: - 75 25 | ||
# description: Server component of the Chef systems integration framework. | ||
# processname: chef-indexer | ||
# | ||
# pidfile: <%= @node[:chef][:run_path] %>/chef-indexer.pid | ||
|
||
# Source function library | ||
. /etc/init.d/functions | ||
|
||
prog="chef-indexer" | ||
pidfile=<%= @node[:chef][:run_path] %>/chef-client.pid | ||
lockfile=/var/lock/subsys/$prog | ||
config=/etc/chef/indexer.rb | ||
user="chef" | ||
group="chef" | ||
|
||
start() { | ||
echo -n "Starting $prog:" | ||
daemon chef-indexer -d -c "$config" -u "$user" -g "$group" -L <%= @node[:chef][:indexer_log] %> "&>/dev/null" | ||
RETVAL=$? | ||
echo | ||
[ $RETVAL -eq 0 ] && touch ${lockfile} | ||
return $RETVAL | ||
} | ||
|
||
stop() { | ||
echo -n "Stopping $prog: " | ||
if [ -f $pidfile ]; then | ||
killproc chef-indexer | ||
RETVAL=$? | ||
if [ $RETVAL -ne 0 ]; then | ||
failure; | ||
fi; | ||
else | ||
RETVAL=1 | ||
failure; | ||
fi | ||
rm -f $lockfile | ||
echo | ||
return $RETVAL | ||
} | ||
|
||
case "$1" in | ||
start) | ||
start | ||
;; | ||
stop) | ||
stop | ||
;; | ||
restart) | ||
stop | ||
start | ||
;; | ||
condrestart) | ||
if [ -f $lockfile ]; then | ||
stop | ||
start | ||
fi | ||
;; | ||
status) | ||
status chef-indexer | ||
;; | ||
*) | ||
echo "Usage: $0 {start|stop|restart|condrestart|status}" | ||
exit 1 | ||
esac | ||
|
||
exit $RETVAL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# | ||
# Chef Indxer Config File | ||
# | ||
# Dynamically generated by Chef - local modifications will be replaced | ||
# | ||
|
||
search_index_path "<%= @node[:chef][:path] %>/search_index" | ||
|
||
pid_file "<%= @node[:chef][:run_path] %>/chef-indexer.pid" | ||
|
||
Chef::Log::Formatter.show_time = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
packages Mash.new unless attribute?("packages") | ||
|
||
# Toggle for recipes to determine if we should rely on distribution packages | ||
# or gems. | ||
packages[:dist_only] = false unless packages.has_key?(:dist_only) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Yay for helpers! | ||
|
||
class Chef | ||
class Recipe | ||
def dist_only? | ||
@node[:packages][:dist_only] | ||
end | ||
end | ||
end |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.