Skip to content

Instantly share code, notes, and snippets.

@chef
Created January 20, 2009 20:20

Revisions

  1. opscode created this gist Jan 20, 2009.
    16 changes: 16 additions & 0 deletions chef_rest_delete.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    #!/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'}")