Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixes

  • Loading branch information...
commit 885edfd26ebb4f38eca3591778740e249d7a9d0d 1 parent ae85114
@joewilliams authored
View
22 LICENSE
@@ -0,0 +1,22 @@
+## Copyright 2012, Joe Williams <joe@joetify.com>
+##
+## Permission is hereby granted, free of charge, to any person
+## obtaining a copy of this software and associated documentation
+## files (the "Software"), to deal in the Software without
+## restriction, including without limitation the rights to use,
+## copy, modify, merge, publish, distribute, sublicense, and/or sell
+## copies of the Software, and to permit persons to whom the
+## Software is furnished to do so, subject to the following
+## conditions:
+##
+## The above copyright notice and this permission notice shall be
+## included in all copies or substantial portions of the Software.
+##
+## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+## EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+## OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+## NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+## HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+## WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+## FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+## OTHER DEALINGS IN THE SOFTWARE.
View
5 chef_cookbooks/example/attributes/default.rb
@@ -4,7 +4,12 @@
set[:example][:path] = "/opt/example"
set[:example][:log_dir] = "/var/log/example"
set[:example][:cookie] = "defaultcookie"
+
+set[:example][:uid] = 451
+set[:example][:gid] = 451
set[:example][:user] = "example"
+set[:example][:group] = "example"
+
set[:example][:host] = "0.0.0.0"
set[:example][:port] = "8000"
View
21 chef_cookbooks/example/recipes/default.rb
@@ -26,13 +26,14 @@
include_recipe "runit"
# setup the user and group for your erlang release to run as
-group node[:example][:user] do
- gid 451
+
+group node[:example][:group] do
+ gid node[:example][:gid]
end
user node[:example][:user] do
- uid 451
- gid 451
+ uid node[:example][:uid]
+ gid node[:example][:gid]
home node[:example][:path]
shell "/bin/bash"
system true
@@ -49,7 +50,7 @@
bash "install example" do
user "root"
- cwd "/opt"
+ cwd "/tmp"
code <<-EOH
(tar zxf /tmp/example.tar.gz -C #{node[:example][:install_dir]})
(chown -R #{node[:example][:user]}:#{node[:example][:user]} #{node[:example][:path]})
@@ -64,21 +65,21 @@
source "example_run.erb"
mode 0755
owner node[:example][:user]
- group node[:example][:user]
+ group node[:example][:group]
end
# create a log dir your release can write to
directory node[:example][:log_dir] do
owner node[:example][:user]
- group node[:example][:user]
+ group node[:example][:group]
end
# create a data dir your release can write to (not always needed)
directory node[:example][:data_dir] do
owner node[:example][:user]
- group node[:example][:user]
+ group node[:example][:group]
end
# setup the runit service to manage your release
@@ -96,7 +97,7 @@
source "sys.config.erb"
mode 655
owner node[:example][:user]
- group node[:example][:user]
+ group node[:example][:group]
notifies(:restart, resources(:service => "example"))
end
@@ -106,7 +107,7 @@
source "vm.args.erb"
mode 0644
owner node[:example][:user]
- group node[:example][:user]
+ group node[:example][:group]
notifies(:restart, resources(:service => "example"))
end
View
6 chef_cookbooks/example/recipes/hotupgrade.rb
@@ -26,7 +26,7 @@
remote_file "#{node[:example][:path]}/releases/example_#{node[:example][:version]}.tar.gz" do
source "#{node[:example][:repo_url]}/upgrades/example_#{node[:example][:version]}.tar.gz"
owner node[:example][:user]
- group node[:example][:user]
+ group node[:example][:group]
not_if "/usr/bin/test -d #{node[:example][:path]}/releases/#{node[:example][:version]}"
end
@@ -49,7 +49,7 @@
template "#{node[:example][:path]}/releases/#{node[:example][:version]}/sys.config" do
source "config.erb"
owner node[:example][:user]
- group node[:example][:user]
+ group node[:example][:group]
mode 0644
end
@@ -58,7 +58,7 @@
template "#{node[:example][:path]}/releases/#{node[:example][:version]}/vm.args" do
source "vm.args.erb"
owner node[:example][:user]
- group node[:example][:user]
+ group node[:example][:group]
mode 0644
end
Please sign in to comment.
Something went wrong with that request. Please try again.