Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updates #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@
license "Apache 2.0"
description "Installs and configures god and provides a define for monitoring"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "1.0.5"
version "2.0.0"

recipe "god", "Installs god and starts it"
recipe "god", "Installs god and starts it as a runit service"

%w{debian ubuntu}.each do |os|
supports os
end

depends "runit"
24 changes: 10 additions & 14 deletions recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

gem_package "god" do
action :install
gem_binary "/usr/bin/gem"
end

directory "/etc/god/conf.d" do
Expand All @@ -36,18 +35,15 @@
mode 0755
end

if node['god']['init_style'] == 'runit'
include_recipe "runit"
runit_service "god"
elsif node['god']['init_style'] == 'init'
template "/etc/init.d/god" do
source "god.init.erb"
owner "root"
group "root"
mode 0755
end
template "/etc/init.d/god" do
source "god.erb"
owner "root"
group "root"
mode 0755
end

service "god" do
action :start
end
service 'god' do
supports reload: false
action [:start, :enable]
end

37 changes: 37 additions & 0 deletions templates/default/god.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash
#
# God
#
# chkconfig: - 85 15
# description: start, stop, restart, status for God
#

RETVAL=0

case "$1" in
start)
god -P /var/run/god.pid -l /var/log/god.log
god load /etc/god/master.god
RETVAL=$?
;;
stop)
kill `cat /var/run/god.pid`
RETVAL=$?
;;
restart)
kill `cat /var/run/god.pid`
god -P /var/run/god.pid -l /var/log/god.log
god load /etc/god/master.god
RETVAL=$?
;;
status)
/usr/bin/god status
RETVAL=$?
;;
*)
echo "Usage: god {start|stop|restart|status}"
exit 1
;;
esac

exit $RETVAL
42 changes: 0 additions & 42 deletions templates/default/god.init.erb

This file was deleted.

27 changes: 1 addition & 26 deletions templates/default/master.god.erb
Original file line number Diff line number Diff line change
@@ -1,30 +1,5 @@
#
# Generated by Chef for <%= node[:hostname] %>
#
God::Contacts::Email.defaults do |d|
d.from_email = "<%= node['god']['email']['from'] %>"
d.from_name = "God"

d.delivery_method = :<%= node['god']['email']['server']['delivery_method'] %>

d.server_host = "<%= node['god']['email']['server']['server_host'] %>"
d.server_port = <%= node['god']['email']['server']['server_port'] %>

<%- if node['god']['email']['server']['server_config'] != false %>
d.server_domain = "<%= node['god']['email']['server']['server_domain'] %>"
d.server_auth = "<%= node['god']['email']['server']['server_auth'] %>"
d.server_user = "<%= node['god']['email']['server']['server_user'] %>"
d.server_password = "<%= node['god']['email']['server']['server_password'] %>"
<%- end %>
end

<% node[:god][:email][:contacts].each do |name,email,group| %>
God.contact(:email) do |c|
c.name = "<%= name %>"
c.to_email = "<%= email %>"
c.group = "<%= group %>"
end

<% end %>

God.load "/etc/god/conf.d/*.god"

2 changes: 0 additions & 2 deletions templates/default/sv-god-log-run.erb

This file was deleted.

6 changes: 0 additions & 6 deletions templates/default/sv-god-run.erb

This file was deleted.