Project

gersberms

0.0
No commit activity in last 3 years
No release in over 3 years
Gersberms is a simple system for building AWS EC2 AMIs using Chef and Berkshelf
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 1.0
~> 3.2
~> 2.0
~> 1.2
~> 2.9
~> 10.4
~> 0.19
 Project Readme

Gersberms

Build AMIs the right way with chef-solo and Berkshelf.

Installation

$ gem install gersberms

Usage

Gersberms can be used via the CLI, as a library or as a Rake task.

All of the following are equivalent

CLI

To use the CLI you must create a YAML formatted config file.

ssh_user: ubuntu
base_ami: ami-950b62af
type: t2.micro
ami_name: example-ami
security_groups:
  - example_security_group
runlist:
  - example_cookbook::default
json:
  example_cookbook:
    example_attribute: example_value
files:
  - source: '.'
    destination: '/tmp/staging'

Which you can then use with the bake command like so:

$ gersberms bake --config=config.yml

Library

require 'gersberms'

config = {
  ssh_user: 'ubuntu',
  base_ami: 'ami-950b62af'
  instance_type: 't2.micro',
  ami_name: 'example-ami',
  security_groups: ['example_security_group'],
  runlist: ['example_cookbook::default'],
  json: {
    example_cookbook: {
      example_attribute: "example_value"
    }
  },
  files: [
    { source: '.', destination: '/tmp/staging' }
  ]
}

Gersberms.bake(config)

Rake Task

require 'gersberms/rake_task'

Gersberms::RakeTask.new(:ami) do |ami|
  ami.ssh_user = 'ubuntu'
  ami.base_ami = 'ami-950b62af'
  ami.instance_type = 't2.micro'
  ami.ami_name = 'example-ami'
  ami.security_groups = ['example_security_group']
  ami.runlist = ['example_cookbook::default']
  ami.json = {
    example_cookbook: {
      example_attribute: 'example_value'
    }
  }
  ami.files = [
    { source: '.', destination: '/tmp/staging' }
  ]
end