This file contains hidden or 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
require 'chef' | |
require 'chef/node' | |
require 'chef/rest' | |
# A registration for your API access | |
api_user = "monkey" | |
# A password for the API access | |
api_pass = "pants" | |
# A validation token, if you use them | |
validation_token = nil |
This file contains hidden or 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
# | |
# Cookbook Name:: CHEF-37 | |
# Recipe:: default | |
# | |
# Copyright 2009, Example Com | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# |
This file contains hidden or 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
if node[:platform_version].to_f < 8.04 | |
remote_file "/etc/event.d/runsvdir" do | |
only_if do Dir.exists?("/etc/event.d") end | |
end | |
end |
This file contains hidden or 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
begin | |
Timeout.timeout(Chef::Config[:run_command_stdout_timeout]) do | |
while stdout.ready? == nil | |
Chef::Log.debug("Waiting for STDOUT to be ready..") | |
sleep 1 | |
end | |
end | |
rescue Timeout::Error => e | |
Chef::Log.error("#{args[:command]} timed out reading STDOUT") | |
else |
This file contains hidden or 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" | |
}) |
This file contains hidden or 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
# | |
# Attribute file/per-node hash | |
xen_vms = Mash.new | |
xen_vms[:my_vm] = { | |
:ip => '10.8.2.204', | |
:disk => '5Gb', | |
:memory => '2048Mb' | |
} | |
## |
NewerOlder