Skip to content

Instantly share code, notes, and snippets.

@sodabrew
sodabrew / ec2_vpc.rb
Created December 16, 2013 21:34
Add EC2 VPC facts to Facter 1.7, drop this file into `/etc/facter/facts.d/`
require 'facter/ec2'
# We might be in a VPC, which fails the normal EC2 MAC address checks
if !Facter.value('ec2_instance_id') && Facter.value('virtual') =~ /xen/ && Facter::Util::EC2.can_connect?(0.2)
Facter.debug "This is an EC2 VPC instance"
metadata
userdata
# vpc-id is in a newer metadata api rev than the usual EC2 facts
Facter.add(:ec2_vpc_id) do
@irvingpop
irvingpop / ha_drbd.md
Last active July 16, 2021 10:18
Cloning a Chef Server 12 installation

Customer Scenario

A customer has a Chef Server 12 (HA - DRBD) in Production. They want to test an in-place upgrade (or maintenance) using their current OPC Production data and config. This gives us a good chance to make corrections if we find that their data is too broken for the migrations to handle, and gives the customer experience in managing the upgrade in Production.

The sequence of events will broadly be these:

  • Install the same version of Chef Server on the target HA Test cluster
  • Restore data from Production instance backup (LVM snapshot or full-stop backup)
  • Test