diff options
author | Derek Groh <derekgroh@gmail.com> | 2018-09-04 12:07:16 -0500 |
---|---|---|
committer | Derek Groh <derekgroh@gmail.com> | 2018-09-04 12:07:23 -0500 |
commit | eada76335bcf43478b9b3a3d9727c0b127c8bc06 (patch) | |
tree | 1c6da2f63e713f3556352e4e8b02b56f4cd19ffe /lib/chef | |
parent | 1b6dc7655a4ba5930157eb0b5e5984e1ffdfb3bd (diff) | |
download | chef-eada76335bcf43478b9b3a3d9727c0b127c8bc06.tar.gz |
chefstyle edits
Signed-off-by: Derek Groh <derekgroh@github.io>
Diffstat (limited to 'lib/chef')
-rw-r--r-- | lib/chef/resource/windows_workgroup.rb | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/chef/resource/windows_workgroup.rb b/lib/chef/resource/windows_workgroup.rb index dc9cfad087..d7589c3c61 100644 --- a/lib/chef/resource/windows_workgroup.rb +++ b/lib/chef/resource/windows_workgroup.rb @@ -36,10 +36,10 @@ class Chef name_property: true property :user, String, - description: "The local administrator user to use to change the workgroup.", + description: "The local administrator user to use to change the workgroup." property :password, String, - description: "The password for the local administrator user.", + description: "The password for the local administrator user." property :reboot, Symbol, equal_to: [:immediate, :delayed, :never, :request_reboot, :reboot_now], @@ -60,10 +60,11 @@ class Chef cmd << "Add-Computer -WorkgroupName #{new_resource.workgroup_name}" cmd << " -Credential $credential" if new_resource.password cmd << " -Force" - workgroup_member? - converge_by("join workstation workgroup #{new_resource.workgroup_name}") do - ps_run = powershell_out(cmd) + + converge_by("join workstation workgroup #{new_resource.workgroup_name}") do + ps_run = powershell_out(cmd) raise "Failed to join the workgroup #{new_resource.workgroup_name}: #{ps_run.stderr}}" if ps_run.error? + unless new_resource.reboot == :never reboot "Reboot to join workgroup #{new_resource.workgroup_name}" do action clarify_reboot(new_resource.reboot) |