Skip to content

Instantly share code, notes, and snippets.

service "apache2" do
name value_for_platform(
[ "CentOS", "RedHat", "Fedora", "SuSE" ] => { "default" => "httpd" },
"Debian" => { "default" => "apache2" },
"Ubuntu" => { "default" => "apache2", "8.10" => "apache2_lolz" }
)
supports :restart => true
action :enable
end
bryanm@dev-ots02:/etc/ganglia$ sudo /var/lib/gems/1.8/bin/chef-client
[Wed, 21 Jan 2009 11:16:01 -0800] INFO: Starting Chef Run
[Wed, 21 Jan 2009 11:16:01 -0800] INFO: Loading plugin os
[Wed, 21 Jan 2009 11:16:01 -0800] INFO: Loading plugin ruby
[Wed, 21 Jan 2009 11:16:01 -0800] INFO: Loading plugin languages
[Wed, 21 Jan 2009 11:16:01 -0800] INFO: Loading plugin kernel
[Wed, 21 Jan 2009 11:16:01 -0800] INFO: Loading plugin keys
[Wed, 21 Jan 2009 11:16:01 -0800] INFO: Loading plugin ohai_time
[Wed, 21 Jan 2009 11:16:01 -0800] INFO: Loading plugin network
[Wed, 21 Jan 2009 11:16:01 -0800] INFO: Loading plugin hostname
def action_add
# check to see if load_current_resource found the route
unless @current_resource.gateway
if @new_resource.route_type == :net
command = "route add -net #{@new_resource.target}"
else
command = "route add #{@new_resource.target}"
end
command << " netmask #{@new_resource.netmask}" if @new_resource.netmask
command << " gw #{@new_resource.gateway}" if @new_resource.gateway
root@mon03:/etc/ganglia# nc web03 8649
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
<!DOCTYPE GANGLIA_XML [
<!ELEMENT GANGLIA_XML (GRID|CLUSTER|HOST)*>
<!ATTLIST GANGLIA_XML VERSION CDATA #REQUIRED>
<!ATTLIST GANGLIA_XML SOURCE CDATA #REQUIRED>
<!ELEMENT GRID (CLUSTER | GRID | HOSTS | METRICS)*>
<!ATTLIST GRID NAME CDATA #REQUIRED>
<!ATTLIST GRID AUTHORITY CDATA #REQUIRED>
<!ATTLIST GRID LOCALTIME CDATA #IMPLIED>
#
# Author:: Bryan McLellan (btm@loftninjas.org)
# Copyright:: Copyright (c) 2009 Bryan McLellan
# License:: Apache License, Version 2.0
#
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
<% require '/srv/icagent/lib/iclassify' -%>
<% ic = IClassify::Client.new("https://iclassify", iclassify_user, iclassify_password) -%>
<% nagios_nodes = ic.search(nagios_iclassify_search) -%>
<% all_hosts = Array.new -%>
<% vmware = Array.new -%>
<% kvm = Array.new -%>
<% test_hosts = Array.new -%>
<% windows_hosts = Array.new -%>
<% dell_hosts = Array.new -%>
<% ots_servers = Array.new -%>
# get vmware host servername via guestinfo (provided we've already set it) and create an attribute
require 'facter'
if File.file?("/usr/sbin/vmware-guestd")
vmwarehost = IO.popen("/usr/sbin/vmware-guestd --cmd 'info-get guestinfo.host'") { |io| io.gets }
if vmwarehost
replace_attrib("vmwarehost", vmwarehost.chomp)
end
end
package "dellomsa"
if node[:platform_version] == "8.04"
remote_file "/etc/pam.d/common-auth" do
source "common-auth"
end
remote_file "/etc/pam.d/common-password" do
source "common-password"
end
end
1)
'Ohai::System Linux virtualization platform should set xen host if /proc/xen/capabilities contains control_d' FAILED
expected "xen", got "kvm" (using .eql?)
./spec/ohai/plugins/linux/virtualization_spec.rb:32:
2)
NoMethodError in 'Ohai::System Linux virtualization platform should set xen guest if /proc/sys/xen/independent_wallclock exists'
undefined method `exists?' for File:Class
/home/btm/ohai/spec/../lib/ohai/mixin/from_file.rb:28:in `from_file'
/home/btm/ohai/spec/../lib/ohai/system.rb:117:in `_require_plugin'
@btm
btm / virt11
Created February 2, 2009 22:43
diff --git a/lib/ohai/plugins/virtualization.rb b/lib/ohai/plugins/virtualization.rb
index 9b82ae0..c06a367 100644
--- a/lib/ohai/plugins/virtualization.rb
+++ b/lib/ohai/plugins/virtualization.rb
@@ -70,7 +70,7 @@ unless virtualization.nil? || !(virtualization[:role].eql?("host"))
virtualization[:storage][pool][:volumes] = Mash.new
sp.list_volumes.each do |v|
virtualization[:storage][pool][:volumes][v] = Mash.new
- sv = virtconn.lookup_volume_by_name pool
+ sv = sp.lookup_volume_by_name v