Skip to content

Instantly share code, notes, and snippets.

View autotune's full-sized avatar

Brian Adams autotune

View GitHub Profile

How to setup your VMWare Fusion images to use static IP addresses on Mac OS X

At Crush + Lovely, we use Railsmachine's Moonshine to automate the configuration of our servers. When writing our deployment recipes, VMWare Fusion's ability to take snapshots and rollback to these snapshots is a huge timesaver because it takes just seconds to roll a server image to it's original state.

When you're just configuring a single server, having a static IP address for your server image isn't too important, but when you're configuring multi-server setups, it can be useful to duplicate a number of server images and give each a static IP address so you can consistently deploy to them. While not documented well at all, it turns out that this is relatively easy to accomplish in four simple steps.

1. Determine the MAC address of your guest machine

Let's say you have a guest machine with the name ubuntu-lucid-lynx-base a

subnet 172.16.252.0 netmask 255.255.255.0 {
range 172.16.252.128 172.16.252.254;
option broadcast-address 172.16.252.255;
option domain-name-servers 172.16.252.2;
option domain-name localdomain;
default-lease-time 1800; # default is 30 minutes
max-lease-time 7200; # default is 2 hours
option netbios-name-servers 172.16.252.2;
option routers 172.16.252.2;
}
---
driver:
name: vagrant
provisioner:
name: chef_solo
platforms:
- name: centos65
---
driver:
name: rackspace
rackspace_username: ""
rackspace_api_key: ""
require_chef_omnibus: "latest"
rackspace_region: "ORD"
provisioner:
name: "chef_solo"
autotune/centos65
@autotune
autotune / gist:b03aadf32f9e79c00309
Created May 28, 2014 23:35
Gemfile - test-kitchen
source 'https://rubygems.org'
gem 'berkshelf'
group :plugins do
gem "vagrant-berkshelf", github: "berkshelf/vagrant-berkshelf"
gem "vagrant-omnibus", github: "schisamo/vagrant-omnibus"
end
gem 'test-kitchen'
gem 'kitchen-vagrant'
#---------------------------------------------------------------------
# Example configuration for a possible web application. See the
# full configuration options online.
#
# http://haproxy.1wt.eu/download/1.4/doc/configuration.txt
#
#---------------------------------------------------------------------
#---------------------------------------------------------------------
# Global settings
package main
import (
"fmt"
"os"
"time"
"github.com/fakovacic/amadeus"
)
func main() {
@autotune
autotune / commands.txt
Last active June 3, 2023 01:44
Hipster Shop Argo Rollouts
# we take the frontend hipster shop at https://github.com/GoogleCloudPlatform/microservices-demo/blob/main/helm-chart/templates/frontend.yaml
# and demonstrate how to deploy it through helm in Argo Rollouts
helm install sockshop ./ -nsockshop --set images.tag=v0.6.0
helm upgrade sockshop ./ -nsockshop --set images.tag=v0.7.0
kubectl argo rollouts get rollout frontend -nsockshop --watch
# confirm current version of site running in external elb
@autotune
autotune / commands.sh
Created June 3, 2023 01:48
hipster shop
# we take the frontend hipster shop at https://github.com/GoogleCloudPlatform/microservices-demo/blob/main/helm-chart/templates/frontend.yaml
# and demonstrate how to deploy it through helm in Argo Rollouts
helm install sockshop ./ -nsockshop --set images.tag=v0.6.0
helm upgrade sockshop ./ -nsockshop --set images.tag=v0.7.0
kubectl argo rollouts get rollout frontend -nsockshop --watch
# confirm current version of site running in external elb