Skip to content

Instantly share code, notes, and snippets.

View jonlives's full-sized avatar

Jon Cowie jonlives

View GitHub Profile
function tabc {
NAME=$1; if [ -z "$NAME" ]; then NAME="Default"; fi
osascript -e "tell application \"Terminal\" to set current settings of front window to settings set \"$NAME\""
}
function ssh {
tabc "Solarized Dark"
/usr/bin/ssh "$@"
tabc "Homebrew"
}
bash -c '
if [ ! -f /usr/bin/chef-client ]; then
echo "chef chef/chef_server_url string <%= Chef::Config[:chef_server_url] %>" | debconf-set-selections
[ -f /etc/apt/sources.list.d/opscode.list ] || echo "deb http://apt.opscode.com lenny main" > /etc/apt/sources.list.d/opscode.list
wget -O- http://apt.opscode.com/packages@opscode.com.gpg.key | apt-key add -
fi
apt-get update
apt-get install -y chef
<% unless Chef::Config[:validation_client_name] == "chef-validator" -%>
# cobbler module configuration file
# =================================
# authentication:
# what users can log into the WebUI and Read-Write XMLRPC?
# choices:
# authn_denyall -- no one (default)
# authn_configfile -- use /etc/cobbler/users.digest (for basic setups)
# authn_passthru -- ask Apache to handle it (used for kerberos)
# authn_ldap -- authenticate against LDAP
Tue Jul 26 14:43:12 2011 - INFO | Exception occured: <class 'cobbler.cexceptions.CX'>
Tue Jul 26 14:43:12 2011 - INFO | Exception value: 'login failed (joncowie)'
Tue Jul 26 14:43:12 2011 - INFO | Exception Info:
File "/usr/local/lib/python2.6/dist-packages/cobbler/remote.py", line 1743, in _dispatch
return method_handle(*params)
File "/usr/local/lib/python2.6/dist-packages/cobbler/remote.py", line 1572, in login
utils.die(self.logger, "login failed (%s)" % login_user)
File "/usr/local/lib/python2.6/dist-packages/cobbler/utils.py", line 130, in die
raise CX(msg)
package "memcached" do
action :upgrade
end
{
"apache2": {
"versions": [
{
"url": "https://api.opscode.com/organizations/mycrotch/cookbooks/apache2/1.0.1",
"version": "1.0.1"
},
{
"url": "https://api.opscode.com/organizations/mycrotch/cookbooks/apache2/1.0.0",
"version": "1.0.0"
In the app file
@helper = ChefHelper.new
@nodes = @helper.get_nodes
get '/' do
haml :index
end
....
@helper = ChefHelper.new
@nodes = @helper.get_nodes
get '/' do
haml :index
end
get '/node/:name' do
@node = params[:name]
haml :nodes
require 'rubygems' if RUBY_VERSION < "1.9"
require 'sinatra/base'
require 'Haml'
require 'chef'
require './chefhelper.rb'
class OpsTool < Sinatra::Base
@helper = ChefHelper.new
@nodes = @helper.get_nodes
views/layout.haml
= haml 'shared/shared'.to_sym
views/shared/shared.haml
= haml 'shared/head'.to_sym
= yield
= haml 'shared/footer'.to_sym