Skip to content

Instantly share code, notes, and snippets.

View mdfranz's full-sized avatar

Matt Franz mdfranz

  • Lutherville Timonium MD
  • 00:44 (UTC -04:00)
View GitHub Profile
@mdfranz
mdfranz / gist:6147964
Created August 3, 2013 21:01
VPC Region Fun with Boto
# Not sure why I had to do this, seems like I shouldn't have to
def region_from_str(s):
regions = boto.ec2.regions()
for r in regions:
if s == r.name:
return r
vpc_conn = VPCConnection(region=region_from_str(region))
@mdfranz
mdfranz / gist:6073985
Created July 24, 2013 19:58
How to specify hosts in variables for stuff like access control lists
$ ansible-playbook -i hosts -c local access.yaml
PLAY [all] ********************************************************************
GATHERING FACTS ***************************************************************
ok: [127.0.0.1]
TASK: [template src=./access.j2 dest=./access.conf] ***************************
changed: [127.0.0.1]
@mdfranz
mdfranz / gist:3260992
Created August 5, 2012 01:22
Azure Linux Agent
POST /machine?comp=health HTTP/1.1
Host: 10.76.84.160
Accept-Encoding: identity
Content-Length: 439
Content-Type: text/xml; charset=utf-8
x-ms-version: 2011-12-31
x-ms-agent-name: WALinuxAgent
<?xml version="1.0" encoding="utf-8"?><Health xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><GoalStateIncarnation>1</GoalStateIncarnation><Container><ContainerId>f5940043-dbed-419c-9122-d77a4ac854b7</ContainerId><RoleInstanceList><Role><InstanceId>79247837105c4470b89352eda4b10942.firstone</InstanceId><Health><State>Ready</State></Health></Role></RoleInstanceList></Container></Health>HTTP/1.1 200 OK
Content-Length: 0