Skip to content

Commit

Permalink
Merge pull request #52 from AngelInc/fixforupdatepasswords
Browse files Browse the repository at this point in the history
fixing issue where we don't supply the updated passwords
  • Loading branch information
KAllan357 committed Nov 1, 2013
2 parents 5644460 + 69531a0 commit 9e59b55
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,17 @@
default_credentials = data_bag_item["default_admin"]
updated_credentials = data_bag_item["updated_admin"]

#need to extract out the password before going onto the next step
#to prevent a compiliation error when the updated credentials aren't supplied
if(!updated_credentials)
updated_password = default_credentials["password"]
else
updated_password = updated_credentials["password"]
end

nexus_user "admin" do
old_password default_credentials["password"]
password updated_credentials["password"]
password updated_password
action :change_password
notifies :create, "ruby_block[set flag that default admin credentials were changed]", :immediately
only_if { updated_credentials }
Expand Down

0 comments on commit 9e59b55

Please sign in to comment.