summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@opscode.com>2021-03-15 19:13:16 -0700
committerGitHub <noreply@github.com>2021-03-15 19:13:16 -0700
commitd7ce73fdec304b68b635dcf673f922ef79fc4a87 (patch)
tree1202ef435fdbf235ee9ccd4c57cfdfdadcf87f2a
parent8e61d36b259ad4b359570731a34e46925f74ef76 (diff)
parenteb83cfeefd4beba070a2b0d90db5b202d269a806 (diff)
downloadchef-d7ce73fdec304b68b635dcf673f922ef79fc4a87.tar.gz
Merge pull request #11181 from ramereth/fix-users-manage
-rw-r--r--kitchen-tests/cookbooks/end_to_end/recipes/linux.rb3
-rw-r--r--kitchen-tests/cookbooks/end_to_end/recipes/macos.rb4
-rw-r--r--kitchen-tests/cookbooks/end_to_end/recipes/windows.rb29
-rw-r--r--kitchen-tests/data_bags/users/adam.json2
4 files changed, 25 insertions, 13 deletions
diff --git a/kitchen-tests/cookbooks/end_to_end/recipes/linux.rb b/kitchen-tests/cookbooks/end_to_end/recipes/linux.rb
index 7f72c0b76a..cd8c9c4d27 100644
--- a/kitchen-tests/cookbooks/end_to_end/recipes/linux.rb
+++ b/kitchen-tests/cookbooks/end_to_end/recipes/linux.rb
@@ -44,8 +44,11 @@ resolver_config "/etc/resolv.conf" do
search [ "chef.io" ]
end
+users_from_databag = search("users", "*:*")
+
users_manage "sysadmin" do
group_id 2300
+ users users_from_databag
action [:create]
end
diff --git a/kitchen-tests/cookbooks/end_to_end/recipes/macos.rb b/kitchen-tests/cookbooks/end_to_end/recipes/macos.rb
index 9dac062a87..1fb76adb5e 100644
--- a/kitchen-tests/cookbooks/end_to_end/recipes/macos.rb
+++ b/kitchen-tests/cookbooks/end_to_end/recipes/macos.rb
@@ -28,15 +28,19 @@ resolver_config "/etc/resolv.conf" do
search [ "chef.io" ]
end
+users_from_databag = search("users", "*:*")
+
users_manage "remove sysadmin" do
group_name "sysadmin"
group_id 2300
+ users users_from_databag
action [:remove]
end
users_manage "create sysadmin" do
group_name "sysadmin"
group_id 2300
+ users users_from_databag
action [:create]
end
diff --git a/kitchen-tests/cookbooks/end_to_end/recipes/windows.rb b/kitchen-tests/cookbooks/end_to_end/recipes/windows.rb
index 2558639df6..6e7ebf08a7 100644
--- a/kitchen-tests/cookbooks/end_to_end/recipes/windows.rb
+++ b/kitchen-tests/cookbooks/end_to_end/recipes/windows.rb
@@ -86,18 +86,23 @@ windows_audit_policy "Update Some Advanced Audit Policies to No Auditing" do
failure false
end
-users_manage "remove sysadmin" do
- group_name "sysadmin"
- group_id 2300
- action [:remove]
-end
-
-# FIXME: create is not idempotent. it fails with a windows error if this already exists.
-users_manage "create sysadmin" do
- group_name "sysadmin"
- group_id 2300
- action [:create]
-end
+# FIXME: upstream users cookbooks is currently broken on windows
+# users_from_databag = search("users", "*:*")
+#
+# users_manage "remove sysadmin" do
+# group_name "sysadmin"
+# group_id 2300
+# users users_from_databag
+# action [:remove]
+# end
+#
+# # FIXME: create is not idempotent. it fails with a windows error if this already exists.
+# users_manage "create sysadmin" do
+# group_name "sysadmin"
+# group_id 2300
+# users users_from_databag
+# action [:create]
+# end
include_recipe "::_chef_client_config"
include_recipe "::_chef_client_trusted_certificate"
diff --git a/kitchen-tests/data_bags/users/adam.json b/kitchen-tests/data_bags/users/adam.json
index f96d7c213f..ecd4b73e74 100644
--- a/kitchen-tests/data_bags/users/adam.json
+++ b/kitchen-tests/data_bags/users/adam.json
@@ -5,5 +5,5 @@
"shell": "/bin/zsh",
"groups": [ "sysadmin" ],
"comment": "Adam Jacob",
- "password": "*"
+ "password": "$6$QQk10qmDjMv.o$wHIjLH9JOxUmaJTsxYFttFhP1jZZtTk/ovhpasmQJS5mfimeFs8HMRWGWM8uBB5dhEmP6svqhRdJE5k1oWRPF1"
}