summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn McCrae <jmccrae@chef.io>2021-05-06 18:43:08 -0700
committerJohn McCrae <jmccrae@chef.io>2021-05-06 18:43:08 -0700
commitedafada540cc4e7e83e1ac4698bc6e7d4809144c (patch)
tree20c723d60b31df1dc467594705d94b313bcc2ee4
parent849cebc0436345b8441cc5fe662d5c7f3192ff14 (diff)
downloadchef-edafada540cc4e7e83e1ac4698bc6e7d4809144c.tar.gz
messed up a squash. correcting the code
Signed-off-by: John McCrae <jmccrae@chef.io>
-rw-r--r--cspell.json1
-rw-r--r--lib/chef/resource/hostname.rb15
2 files changed, 5 insertions, 11 deletions
diff --git a/cspell.json b/cspell.json
index 84dbe1a786..4f620ffdf9 100644
--- a/cspell.json
+++ b/cspell.json
@@ -286,6 +286,7 @@
"createhomedir",
"Createobject",
"creds",
+ "Credentials",
"Cribbs",
"crlfile",
"crlnum",
diff --git a/lib/chef/resource/hostname.rb b/lib/chef/resource/hostname.rb
index 68f7729b5b..017a5d37a8 100644
--- a/lib/chef/resource/hostname.rb
+++ b/lib/chef/resource/hostname.rb
@@ -58,8 +58,8 @@ class Chef
```ruby
hostname 'renaming a domain-joined computer' do
hostname 'Foo'
- windows_domain_username 'Domain\Someone'
- windows_user_password 'SomePassword'
+ domain_user 'Domain\Someone'
+ domain_password 'SomePassword'
end
```
DOC
@@ -89,10 +89,10 @@ class Chef
description: "Determines whether or not Windows should be reboot after changing the hostname, as this is required for the change to take effect.",
default: true
- property :windows_domain_username, String,
+ property :domain_user, String,
description: "The domain username with permissions to change the local hostname. Specified in the form of 'Domain\User'"
- property :windows_user_password, String,
+ property :domain_password, String,
description: "The password associated with the domain user account"
action_class do
@@ -273,17 +273,10 @@ class Chef
Rename-Computer -NewName #{new_resource.hostname}
}
else {
-<<<<<<< HEAD
- $user = #{new_resource.windows_domain_username}
- $securepassword = #{new_resource.windows_user_password} | Convertto-SecureString -AsPlainText -Force
- $Credentials = New-Object System.Management.Automation.PSCredential -Argumentlist ($user, $securepassword)
- Rename-Computer -NewName #{new_resource.hostname} -DomainCredential $Credemtials
-=======
$user = #{new_resource.domain_user}
$secure_password = #{new_resource.domain_password} | Convertto-SecureString -AsPlainText -Force
$Credentials = New-Object System.Management.Automation.PSCredential -Argumentlist ($user, $secure_password)
Rename-Computer -NewName #{new_resource.hostname} -DomainCredential $Credentials
->>>>>>> a9412d86d0... the spelling mistakes are killing me. Corrected calling the correct property names for the Windows domain user
}
EOH
end