Created
February 10, 2011 20:47
-
-
Save Aslan/821305 to your computer and use it in GitHub Desktop.
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
2011-02-10_21:12:17.81813 sh: Syntax error: "(" unexpected | |
2011-02-10_21:12:17.82319 sh: Syntax error: "(" unexpected | |
2011-02-10_21:12:17.82999 sh: Syntax error: "(" unexpected | |
2011-02-10_21:12:17.85169 sh: Syntax error: "(" unexpected | |
2011-02-10_21:12:17.88475 sh: Syntax error: "(" unexpected | |
2011-02-10_21:12:17.89229 sh: Syntax error: "(" unexpected | |
2011-02-10_21:12:17.89786 sh: Syntax error: "(" unexpected | |
2011-02-10_21:12:17.90354 sh: Syntax error: "(" unexpected | |
2011-02-10_21:12:17.90969 sh: Syntax error: "(" unexpected | |
2011-02-10_21:12:17.91580 sh: Syntax error: "(" unexpected | |
2011-02-10_21:12:17.92264 sh: Syntax error: "(" unexpected | |
2011-02-10_21:12:17.92931 sh: Syntax error: "(" unexpected | |
2011-02-10_21:12:17.93541 sh: Syntax error: "(" unexpected | |
2011-02-10_21:12:17.95399 sh: Syntax error: "(" unexpected | |
2011-02-10_21:12:17.96647 sh: Syntax error: "(" unexpected | |
2011-02-10_21:12:19.81673 sh: Syntax error: "(" unexpected | |
2011-02-10_21:12:19.81672 sh: Syntax error: "(" unexpected | |
2011-02-10_21:12:19.81672 sh: Syntax error: "(" unexpected | |
2011-02-10_21:12:19.81671 sh: Syntax error: "(" unexpected | |
2011-02-10_21:12:19.81671 sh: Syntax error: "(" unexpected | |
2011-02-10_21:12:19.81671 sh: Syntax error: "(" unexpected | |
2011-02-10_21:12:19.81670 sh: Syntax error: "(" unexpected | |
2011-02-10_21:12:19.81670 sh: Syntax error: "(" unexpected | |
2011-02-10_21:12:19.81669 sh: Syntax error: "(" unexpected | |
2011-02-10_21:12:19.81669 sh: Syntax error: "(" unexpected | |
2011-02-10_21:12:19.81669 sh: Syntax error: "(" unexpected | |
2011-02-10_21:12:19.81668 sh: Syntax error: "(" unexpected | |
2011-02-10_21:12:19.81665 sh: Syntax error: "(" unexpected | |
2011-02-10_21:12:19.81665 [Thu, 10 Feb 2011 13:12:17 -0800] WARN: ***************************************** | |
2011-02-10_21:12:19.81665 [Thu, 10 Feb 2011 13:12:17 -0800] WARN: Can not find config file: /etc/chef/client.rb, using defaults. | |
2011-02-10_21:12:19.81665 [Thu, 10 Feb 2011 13:12:17 -0800] WARN: undefined method `key?' for nil:NilClass | |
2011-02-10_21:12:19.81665 [Thu, 10 Feb 2011 13:12:17 -0800] WARN: ***************************************** | |
2011-02-10_21:12:19.81664 sh: Syntax error: "(" unexpected | |
2011-02-10_21:12:19.81663 sh: Syntax error: "(" unexpected | |
2011-02-10_21:12:19.81663 [Thu, 10 Feb 2011 13:12:19 -0800] INFO: Client key /etc/chef/client.pem is not present - registering | |
2011-02-10_21:12:19.81663 [Thu, 10 Feb 2011 13:12:19 -0800] FATAL: Failed to read the private key /etc/chef/validation.pem: #<Errno::ENOENT: No such file or directory - /etc/chef/validation.pem>, /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/rest/auth_credentials.rb:59:in `read'/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/rest/auth_credentials.rb:59:in `load_signing_key'/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/rest/auth_credentials.rb:33:in `initialize'/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/rest.rb:48:in `new'/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/rest.rb:48:in `initialize'/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/client.rb:240:in `new'/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/client.rb:240:in `register'/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/client.rb:144:in `run'/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/application/client.rb:222:in `run_application'/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/application/client.rb:212:in `loop'/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/application/client.rb:212:in `run_application'/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/application.rb:62:in `run'/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/chef-client:26/opt/ruby-enterprise/bin/chef-client:19:in `load'/opt/ruby-enterprise/bin/chef-client:19 | |
2011-02-10_21:12:19.81663 [Thu, 10 Feb 2011 13:12:19 -0800] ERROR: Chef::Exceptions::PrivateKeyMissing:I cannot read /etc/chef/validation.pem, which you told me to use to sign requests! | |
2011-02-10_21:12:19.81663 /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/rest/auth_credentials.rb:62:in `load_signing_key' | |
2011-02-10_21:12:19.81663 /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/rest/auth_credentials.rb:33:in `initialize' | |
2011-02-10_21:12:19.81663 /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/rest.rb:48:in `new' | |
2011-02-10_21:12:19.81663 /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/rest.rb:48:in `initialize' | |
2011-02-10_21:12:19.81663 /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/client.rb:240:in `new' | |
2011-02-10_21:12:19.81663 /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/client.rb:240:in `register' | |
2011-02-10_21:12:19.81663 /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/client.rb:144:in `run' | |
2011-02-10_21:12:19.81663 /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/application/client.rb:222:in `run_application' | |
2011-02-10_21:12:19.81663 /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/application/client.rb:212:in `loop' | |
2011-02-10_21:12:19.81663 /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/application/client.rb:212:in `run_application' | |
2011-02-10_21:12:19.81663 /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/application.rb:62:in `run' |
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
#!/opt/ruby-enterprise/bin/ruby | |
# Chef Client Config File | |
# Automatically grabs configuration from ohai ec2 metadata. | |
require 'ohai' | |
require 'json' | |
chef_config = nil | |
loop do | |
o = Ohai::System.new | |
o.all_plugins | |
if o.key?(:ec2) && o[:ec2].key?(:userdata) && !o[:ec2][:userdata].empty? | |
chef_config = JSON.parse(o[:ec2][:userdata]) | |
break | |
else | |
Chef::Log.info "No instance data yet..." | |
sleep 5 | |
end | |
end | |
#o = Ohai::System.new | |
#o.all_plugins | |
#chef_config = JSON.parse(o[:ec2][:userdata]) | |
#if chef_config.kind_of?(Array) | |
# chef_config = chef_config[o[:ec2][:ami_launch_index]] | |
#end | |
log_level :info | |
log_location STDOUT | |
chef_server_url chef_config["chef_server"] | |
registration_url chef_config["chef_server"] | |
openid_url chef_config["chef_server"] | |
template_url chef_config["chef_server"] | |
remotefile_url chef_config["chef_server"] | |
search_url chef_config["chef_server"] | |
role_url chef_config["chef_server"] | |
client_url chef_config["chef_server"] | |
node_name o[:ec2][:instance_id] | |
unless File.exists?("/etc/chef/client.pem") | |
File.open("/etc/chef/validation.pem", "w") do |f| | |
f.print(chef_config["validation_key"]) | |
end | |
end | |
if chef_config.has_key?("attributes") | |
File.open("/etc/chef/client-config.json", "w") do |f| | |
f.print(JSON.pretty_generate(chef_config["attributes"])) | |
end | |
json_attribs "/etc/chef/client-config.json" | |
end | |
validation_key "/etc/chef/validation.pem" | |
validation_client_name chef_config["validation_client_name"] | |
Mixlib::Log::Formatter.show_time = true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment