-
-
Save steveberryman/64358 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
require 'chef' | |
require 'chef/rest' | |
Chef::Log.debug("Authenticating via openid") | |
response = @rest.post_rest('openid/consumer/start', { | |
"openid_identifier" => "#{Chef::Config[:openid_url]}/openid/server/node/program_auth", | |
"submit" => "Verify" | |
}) | |
@rest.post_rest( | |
"#{Chef::Config[:openid_url]}#{response["action"]}", | |
{ "password" => 'your_pw' } | |
) | |
Chef::REST.delete_rest("#{Chef::Config[:registration_url]}/nodes/#{'your node name'}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment