]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/accounts/recipes/default.rb
Make sure the Passwd ohai plugin is enabled
[chef.git] / cookbooks / accounts / recipes / default.rb
index ada3b08f8658148aac2955ee1a02118ab76864a1..250ca9e410a136b406a6c84848109b849d9a0032 100644 (file)
@@ -1,8 +1,8 @@
 #
-# Cookbook Name:: accounts
+# Cookbook:: accounts
 # Recipe:: default
 #
-# Copyright 2010, OpenStreetMap Foundation
+# Copyright:: 2010, OpenStreetMap Foundation
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -39,9 +39,15 @@ search(:accounts, "*:*").each do |account|
       user_shell = details[:shell] || account["shell"] || node[:accounts][:shell]
     end
 
+    available_users = if node[:etc]
+                        node[:etc][:passwd].keys
+                      else
+                        []
+                      end
+
     group name.to_s do
       gid account["uid"].to_i
-      members group_members & node[:etc][:passwd].keys
+      members group_members & available_users
     end
 
     user name.to_s do