alex-harvey-z3q / troposphere-test

A proof of concept using Troposphere and Jerakia

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Troposphere + Jerakia example

This repo contains a proof of concept Troposphere with Jerakia as an external Hiera-like data store.

Usage

Clone this repo. Cd into it.

Test Jerakia

$ bundle install
$ JERAKIA_CONFIG=./jerakia.yaml bundle exec jerakia lookup foo
bar

Test Troposphere

Set up a virtualenv:

virtualenv ./virtualenv
source ./virtualenv/bin/activate
pip install -r requirements.txt

Run the ec2_instance.py script:

python ec2_instance.py > ec2.json

This writes out a Cloudformation JSON file.

Create stack

aws cloudformation create-stack --template-body file://ec2.json

python-jerakia

At the time of writing, a python client python-jerakia exists, but I found there was no PIP package available and it seemed to require a Jerakia Server to be running, whereas I wanted this all to run in a Python Virtualenv/Bundle. For now, I've just used subprocess in Python to call Bundler.

Known issues

At the time of writing, the latest Jerakia available at Rubygems.org was version 2.5.0 which seems to have a bug in the option handling logic. I worked around this by reading the code and setting the $JERAKIA_CONFIG environment variable rather than passing --config=./jerakia.yaml.

About

A proof of concept using Troposphere and Jerakia


Languages

Language:Python 89.3%Language:Ruby 10.7%