Skip to content

Commit

Permalink
Update default recipe to remove user/group resources.
Browse files Browse the repository at this point in the history
  • Loading branch information
johnbellone committed Feb 14, 2015
1 parent 6387c6d commit 11adc9c
Showing 1 changed file with 9 additions and 18 deletions.
27 changes: 9 additions & 18 deletions recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,8 @@
#
# Copyright 2014, 2015 Bloomberg Finance L.P.
#
user node['consul']['service_user'] do
system true
home '/dev/null'
shell '/bin/false'
not_if { username == 'root' }
end

group node['consul']['service_group'] do
system true
members node['consul']['service_user']
not_if { group_name == 'root' }
end

consul_config node['consul']['config_dir'] do
run_user node['consul']['service_user']
run_group node['consul']['service_group']
end

consul_client Chef::Consul.install_path(node) do
client = consul_client Chef::Consul.install_path(node) do
filename Chef::Consul.remote_filename(node)
url Chef::Consul.remote_url(node)
checksum Chef::Consul.remote_checksum(node)
Expand All @@ -32,6 +15,14 @@
run_group node['consul']['service_group']
end

config = consul_config File.join(node['consul']['config_dir'], 'default.json') do
run_user client.run_user
run_group client.run_group
end

consul_service 'consul' do
run_user client.run_user
run_group client.run_group

action :start
end

0 comments on commit 11adc9c

Please sign in to comment.