Skip to content

Instantly share code, notes, and snippets.

View lfrancois's full-sized avatar

Ludovic Francois lfrancois

View GitHub Profile
@lfrancois
lfrancois / jumpcloudtag.sh
Created July 22, 2015 01:58
jumpcloud tag system
#!/bin/bash
##
## This example demonstrates how to auto assign a system to a tag
## using the System Context API. This script should be run after
## running the Kickstart script [https://kickstart.jumpcloud.com/Kickstart]
## and can be used in your chef cookbooks or puppet manifests.
##
# check if the jumpcloud agent conf has an assigned systemKey
@lfrancois
lfrancois / aws2jumpcloud_tag.py
Created July 22, 2015 02:01
get the hostname tag from aws and assign it to jumpcloud tag
#! /usr/bin/env python
import boto.ec2
conn = boto.ec2.connect_to_region("us-east-1")
reservations = conn.get_all_instances()
for res in reservations:
for inst in res.instances:
if 'hostname' in inst.tags:
print "%s (%s) [%s]" % (inst.tags['hostname'], inst.id, inst.state)