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

allow using pre-existing user/group #94

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
3 changes: 3 additions & 0 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
default['consul_template']['service_user'] = 'consul-template'
default['consul_template']['service_group'] = 'consul-template'
default['consul_template']['template_mode'] = 0600
default['consul_template']['create_service_user'] = true
default['consul_template']['create_service_group'] = true


# Config attributes
default['consul_template']['config'] = Hash.new
Expand Down
2 changes: 2 additions & 0 deletions recipes/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
# Create service user
user consul_template_user do
not_if { consul_template_user == 'root' }
not_if { node['consul_template']['create_service_user'] == false }
home '/dev/null'
shell '/bin/false'
comment 'consul-template service user'
Expand All @@ -47,6 +48,7 @@
# Create service group
group consul_template_group do
not_if { consul_template_group == 'root' }
not_if { node['consul_template']['create_service_group'] == false }
members consul_template_user
append true
end
Expand Down