Skip to content

Instantly share code, notes, and snippets.

View iandelahorne's full-sized avatar

Ian Delahorne iandelahorne

  • San Francisco
  • 06:52 (UTC -07:00)
View GitHub Profile
* Basic scenario is that we want to hand out static IPs over DHCP
using hostnames provided by the clients. Ideally we could use the
hostname, but I haven't found dhcpd configuration that works, so I
used dhcp-client-identifier instead.
Our setup is:
* VMs get created in VMware by deploying from a template, which is a
base VM image. VMware has limited customization possibilities when
deploying, so it can only really set the hostname and configure
interfaces' IP address / use DHCP.
@iandelahorne
iandelahorne / vsphere_vm_listall.rb
Created March 12, 2012 10:56
knife vsphere vm listall
# Copyright (C) 2012, SCM Ventures AB
# Author: Ian Delahorne <ian@scmventures.se>
#
# Permission to use, copy, modify, and/or distribute this software for
# any purpose with or without fee is hereby granted, provided that the
# above copyright notice and this permission notice appear in all
# copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
# WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
cookbook_file "/opt/cntw/conf/create_cntw.pgsql" do
mode "0644"
owner "root"
group "root"
source "create_cntw.pgsql"
end
#include_recipe "database"
package "cntw-plsqlmodules" do
action [:install, :upgrade]
include_recipe "postgresql_database"
postgresql_database 'test' do
connection { :host => "127.0.0.1", :port => 5432, :username => 'postgres', :password => node['postgresql']['password']['postgres'] }
action :create
provider "postgresql_database"
end