Skip to content
This repository has been archived by the owner on Jul 11, 2020. It is now read-only.

Commit

Permalink
remove users that exists but don't have access to the node's environment
Browse files Browse the repository at this point in the history
Sam Kottler committed Mar 14, 2015
1 parent 5d8ffa6 commit 1cda061
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions cookbooks/rubygems-people/recipes/default.rb
Original file line number Diff line number Diff line change
@@ -13,9 +13,8 @@
users.each do |user_name|
user = data_bag_item('users', user_name)

next unless user['environments'].include?(node.chef_environment)

if user['action'] && user['action'] == 'remove'
if (user['action'] && user['action'] == 'remove') || \
(!user['environments'].include?(node.chef_environment))
user_account user['username'] do
action :remove
only_if "/usr/bin/id -u #{user['username']}"

0 comments on commit 1cda061

Please sign in to comment.