Skip to content

Commit

Permalink
refactor user/group creation
Browse files Browse the repository at this point in the history
  • Loading branch information
webcoyote committed Jun 11, 2014
1 parent 6c39fb1 commit 4e521cd
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions recipes/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,20 @@
end

# Create service user
unless consul_user == 'root'
user "consul service user: #{consul_user}" do
username consul_user
home "/dev/null"
shell "/bin/false"
comment "consul service user"
end
user "consul service user: #{consul_user}" do
not_if { consul_user == 'root' }
username consul_user
home "/dev/null"
shell "/bin/false"
comment "consul service user"
end

# Create service group
unless consul_group == 'root'
group "consul service group: #{consul_group}" do
group_name consul_group
members consul_user
append true
end
group "consul service group: #{consul_group}" do
not_if { consul_group == 'root' }
group_name consul_group
members consul_user
append true
end

# Create service directories
Expand Down

0 comments on commit 4e521cd

Please sign in to comment.