-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ami Rahav
committed
Dec 14, 2014
1 parent
e105703
commit 07693d6
Showing
14 changed files
with
278 additions
and
223 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/.bundle |
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,14 @@ | ||
Changes | ||
======= | ||
|
||
1.0.1 | ||
----- | ||
- Add missing `stopwaitsecs` setting. | ||
|
||
1.0.0 | ||
----- | ||
|
||
- foodcritic / chefspec tests | ||
- simplify providers (don't use "linked service") | ||
- docs | ||
- support all supervisord.conf options |
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,6 @@ | ||
source 'https://rubygems.org/' | ||
|
||
gem 'chef', '~> 11.8' | ||
gem 'chefspec', '~> 3.0' | ||
gem 'foodcritic', '~> 3.0' | ||
gem 'strainer' |
This file was deleted.
Oops, something went wrong.
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,35 @@ | ||
Supervisord cookbook | ||
==================== | ||
|
||
This cookbook installs | ||
[Supervisord](http://supervisord.org/configuration.html) and provides | ||
a resource to supervise programs. | ||
|
||
Usage | ||
----- | ||
|
||
Include `recipe[supervisord]` in your run list, and | ||
`supervisord_program` resource to configure individual programs. See | ||
`See recipes/example.rb` for sample usage | ||
|
||
Resources | ||
--------- | ||
|
||
## `supervisord_program` | ||
|
||
### Actions | ||
|
||
- `:supervise` (default): add program to supervisord config | ||
- `:start`, `:stop`, `:restart`: manage service | ||
|
||
### Attribute parameters | ||
|
||
- `:name` (name attribute) | ||
- `:command` (required) | ||
- all settings of a `[program:X]` section of supervisord config | ||
|
||
Authors | ||
------- | ||
|
||
* Maciej Pasternacki | ||
* Dan Crosta |
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,3 @@ | ||
knife test: bundle exec knife cookbook test $COOKBOOK | ||
foodcritic: bundle exec foodcritic -f any $SANDBOX/$COOKBOOK | ||
chefspec: bundle exec rspec $SANDBOX/$COOKBOOK |
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,31 @@ | ||
{ | ||
"name": "supervisord", | ||
"description": "Installs/Configures supervisord", | ||
"long_description": "Supervisord cookbook\n====================\n\nThis cookbook installs\n[Supervisord](http://supervisord.org/configuration.html) and provides\na resource to supervise programs.\n\nUsage\n-----\n\nInclude `recipe[supervisord]` in your run list, and\n`supervisord_program` resource to configure individual programs. See\n`See recipes/example.rb` for sample usage\n\nResources\n---------\n\n## `supervisord_program` \n\n### Actions\n\n- `:supervise` (default): add program to supervisord config\n- `:start`, `:stop`, `:restart`: manage service\n\n### Attribute parameters\n\n- `:name` (name attribute)\n- `:command` (required)\n- all settings of a `[program:X]` section of supervisord config\n\nAuthors\n-------\n\n* Maciej Pasternacki\n* Dan Crosta\n", | ||
"maintainer": "Maciej Pasternacki", | ||
"maintainer_email": "maciej@pasternacki.net", | ||
"license": "WTFPL", | ||
"platforms": { | ||
"ubuntu": ">= 0.0.0", | ||
"debian": ">= 6.0" | ||
}, | ||
"dependencies": { | ||
}, | ||
"recommendations": { | ||
}, | ||
"suggestions": { | ||
}, | ||
"conflicting": { | ||
}, | ||
"providing": { | ||
}, | ||
"replacing": { | ||
}, | ||
"attributes": { | ||
}, | ||
"groupings": { | ||
}, | ||
"recipes": { | ||
}, | ||
"version": "1.0.1" | ||
} |
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,10 @@ | ||
name "supervisord" | ||
maintainer "Maciej Pasternacki" | ||
maintainer_email "maciej@pasternacki.net" | ||
license "WTFPL" | ||
description "Installs/Configures supervisord" | ||
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) | ||
version "1.0.1" | ||
|
||
supports "ubuntu" | ||
supports "debian", ">= 6.0" |
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,29 @@ | ||
require 'chef/mixin/shell_out' | ||
|
||
include Chef::Mixin::ShellOut | ||
|
||
def initialize(*args) | ||
super | ||
@run_context.include_recipe "supervisord" | ||
end | ||
|
||
|
||
action :supervise do | ||
template "/etc/supervisor/conf.d/#{new_resource.name}.conf" do | ||
source "supervised-program.conf.erb" | ||
cookbook "supervisord" | ||
owner "root" | ||
group "root" | ||
mode "0600" | ||
variables :program => new_resource | ||
notifies :reload, resources("service[supervisor]") | ||
end | ||
new_resource.updated_by_last_action(true) | ||
end | ||
|
||
[:start, :stop, :restart].each do |act| | ||
action act do | ||
shell_out! "supervisorctl #{act} #{new_resource.name}" | ||
new_resource.updated_by_last_action(true) | ||
end | ||
end |
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,6 @@ | ||
package "supervisor" # FIXME: work with custom debian package | ||
|
||
service "supervisor" do | ||
reload_command "supervisorctl reload" | ||
action [ :enable, :start ] | ||
end |
Oops, something went wrong.