View gist:6647881
1 2 3 4 5
openstack_base_patch "ui.js" do
cwd "/usr/share/novnc"
 
notifies :restart, "service[nova-novncproxy]", :immediately
end
View gist:6647272
1 2 3 4 5 6 7 8 9 10
#!/bin/sh
 
CHECKSUM=$1
FILE=$2
 
if [[ -z "$CHECKSUM" ]]; then
echo "Usage: $0 md5 file"
exit 1
elif [[ -z "$FILE" ]]; then
echo "Usage: $0 md5 file"
View network_addr.rb
1 2 3 4 5 6 7 8 9 10
#
# Author:: Joshua Timberman (<joshua@opscode.com>)
# Copyright:: Copyright (c) 2011 Opscode, Inc.
# 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
View gist:4004735
1 2 3 4 5 6 7 8 9
execute "create swapfile" do
command <<-eof
dd if=/dev/zero of=#{swap_location} bs=1M count=#{swap_size_megs} &&
chmod 600 #{swap_location} &&
mkswap #{swap_location}
eof
 
not_if { File.exists?("#{swap_location}") }
end
View gist:3996907
1 2 3 4 5
describe "gems" do
it "has chef installed" do
Gem::Specification.find_by_name('chef').name.must_equal "chef"
end
end
View gist:3837277
1 2 3 4 5 6 7 8 9 10
# Trying to get tests in this cookbook to work... https://github.com/retr0h/cookbook-sol
 
emopop:sol(master)☭% ls cookbooks
chef_handler reboot-handler
 
# Doesn't look at ./cookbooks/
describe "sol::default" do
let(:chef_run) { ChefSpec::ChefRunner.new.converge "sol::default" }
 
describe "ttyS1" do
View gist:3809094
1 2 3 4 5 6 7 8 9 10
IFACE=$( ip addr show |grep UP |grep -v lo |cut -d' ' -f2 |sed 's/://' )
MAC=$( ip addr show ${IFACE} |grep 'link/ether' |cut -d" " -f6 )
 
cat <<EOF > /etc/udev/rules.d/70-persistent-net.rules
# This file was generated by substructure.
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="${MAC}", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
EOF
 
sed -i "s/${IFACE}/eth0/" /etc/network/interfaces
View gist:3808196
1 2 3 4 5 6
# In default.rb from cookbook being tested
# node.run_state['reboot'] = true
 
it "flags system to reboot" do
chef_run.node.run_state['reboot'].should_be true
end
View gist:3803315
1 2 3 4 5 6 7 8 9 10
Array.new.tap do |a|
# Break the directory into pieces for recursive creation.
# ["/opt", "MegaRAID", "MegaCli"]
parts = node['megaraidcli']['dir'].scan(/^\/(?:[a-zA-Z]+)|(?:[a-zA-Z]+)/)
 
parts.each do |parts|
a << parts
directory a.join(::File::SEPARATOR) do
owner "root"
group "root"
Something went wrong with that request. Please try again.