aws-kicker 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NmI3MjY4OWM0OTE3NGE1MGMyMGZhNGVlODY1ZjZlZDFiMDVjYTQyZg==
4
+ NDhlOWQ3YzllOTdlZTQzNGI1YWQyMjkyYzY1ZDA1ZjE5OTg2NjU3Yw==
5
5
  data.tar.gz: !binary |-
6
- NWYyOGVlYzA4OTljNjE2MzZjNWIxNDIxNjhiOGMyMmVjMjk3YjYxMA==
6
+ MDk3ZWExMGE3MzlmYTA4MWU0NzlkODQ5YzdlNDA3MTQzOWExODAxZQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YWZmYzlhZTEwNzA5NTAwYWRkOTdiODJjN2YyYjVkNzE2NmEwYzAwNmZkMDg4
10
- OTA2OWFhYzQxYjNjZjU4MmI3YzYxNzM4MWRhMmI0ZWEyNTE3ZmJkOTVkYzcw
11
- NWYyMTFlYjM0MDcwM2NmZmQ3ZGQyNzNlMGI5MDE3NjQyMGVmZDM=
9
+ NDFkZTY2ZjY4NDljNDkxZDNlZjliMWY4ODFiZTQwMDk1NjE1YmU1MDI4NWZi
10
+ MjVmNTEyNTZjYWNmNjc4MmYzNzU3NjNmYzRlNTEwNjYyM2Y1ZDFiYjk0NWMx
11
+ MTNhNzQ0NTQ4NzA0ZjYwMTczZGQ3MjlhOWQ0YTQxMTc2NDdjZjU=
12
12
  data.tar.gz: !binary |-
13
- NzA3ZmQ2MzZkOTY1NDBiMGViMjBiYjgwYzM4MWIxZjM0YmZjYTQzMDdmNWVi
14
- ZTFjOTA5ZmNjNWNjZTgzMTU5ZmUwNWM3NzhhMTI0MjQ5MjU3MjZiYjEzNjEy
15
- YTIzOGNlNDk3NGYwNzAxN2EzZmMxNzZkY2RhYzVjOTljMmY3MTE=
13
+ ZWJmNjE3ZTNhOTRmODY4MjFmNmE0Y2M0NTA1ZjllMGUwMjBkMGMxZDIwYWI2
14
+ YjQ4ODAzYjFhNDg1MzA4YWFjZjBhMDRiOTI2NTg5OTY2ZGY3NjcwYjc1OWU1
15
+ MDc5MjYzZDY5NGIwYTE2MDM2M2FjMDQ1YmRiZGU4NzMxYTRkYzU=
data/README.md CHANGED
@@ -20,6 +20,48 @@ Or install it yourself as:
20
20
 
21
21
  TODO: Write usage instructions here
22
22
 
23
+ ## Stackfile
24
+ The Stackfile is a ruby based config that is eval'd at runtime. Here's a sample config:
25
+
26
+ module StackConfig
27
+ Stacks = {
28
+ # eu-west-1-simon-micro
29
+ 'rentpro-bmtw' => {
30
+ :provider => 'AWS',
31
+ :aws_access_key_id => ENV['AWS_ACCESS_KEY'],
32
+ :aws_secret_access_key => ENV['AWS_SECRET_KEY'],
33
+ :keypair => 'jobdoneright',
34
+ # generic
35
+ :region => 'eu-west-1',
36
+ :availability_zone => 'eu-west-1a',
37
+ :flavor_id => 't1.micro',
38
+ :image_id => 'ami-ffecde8b',
39
+ :dns_domain => 'bmtw.net',
40
+ :dns_id => 'Z2NT1FUYUEREUK',
41
+ :roles => {
42
+ 'rentpro-db' => {
43
+ :count => 1,
44
+ :publish_private_ip => true,
45
+ :flavor_id => 'm1.small'
46
+ },
47
+ 'rentpro-web' => {
48
+ :count => 1,
49
+ :dns_wildcard => true
50
+ }
51
+ }
52
+ }
53
+ }
54
+ end
55
+
56
+ 2 instances will be booted, rentpro-db & rentpro-web
57
+
58
+ ### Global Parameters
59
+ | Name | Type | Description |
60
+ |------|------|------------ |
61
+ | mime_encode_user_data | Boolean | Defaults to True. When set to False sends only the bootstrap script as user-data, useful for working around issues with Ubuntu Hardy's iffy EC2 Init handling |
62
+
63
+ #### Role Parameters
64
+
23
65
  ## Contributing
24
66
 
25
67
  1. Fork it
data/aws-kicker.gemspec CHANGED
@@ -8,6 +8,7 @@ Gem::Specification.new do |gem|
8
8
  gem.version = Aws::Kicker::VERSION
9
9
  gem.authors = ["Simon McCartney"]
10
10
  gem.email = ["simon@mccartney.ie"]
11
+ gem.licenses = ['Apache']
11
12
  gem.description = %q{Utility for kicking an application stack into life on Amazon EC2}
12
13
  gem.summary = %q{Stacks are built from a collection of instances required to build an application stack.
13
14
  Each instance is described in the Stackfile & provisioned using variety of methods. Supported models include:
@@ -18,16 +19,16 @@ Amazon EC2 interaction is done through fog, so other providers should be easily
18
19
 
19
20
  The guiding principle is that your Stackfile should be shareable & re-useable by others, and support templates, so that other users can use the template and easily adjust items in the stack (such as the instance size used, DNS Domain updated during deploy, EC2 account & location)
20
21
  }
21
- gem.homepage = "https://github.com/simonmcc/kicker"
22
+ gem.homepage = "https://github.com/simonmcc/aws-kicker"
22
23
 
23
24
  gem.files = `git ls-files`.split($/)
24
25
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
25
26
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
26
27
  gem.require_paths = ["lib"]
27
- gem.add_development_dependency('rdoc')
28
- gem.add_development_dependency('aruba')
28
+ gem.add_development_dependency('rdoc', '~> 0')
29
+ gem.add_development_dependency('aruba', '~> 0')
29
30
  gem.add_development_dependency('rake', '~> 0.9.2')
30
- gem.add_development_dependency('gem-release')
31
- gem.add_dependency('methadone', '~> 1.2.4')
32
- gem.add_dependency('fog', '~> 1.12.1')
31
+ gem.add_development_dependency('gem-release', '~> 0.7')
32
+ gem.add_dependency('methadone', '~> 1.2')
33
+ gem.add_dependency('fog', '~> 1.12')
33
34
  end
@@ -1,5 +1,5 @@
1
1
  module Aws
2
2
  module Kicker
3
- VERSION = "0.0.5"
3
+ VERSION = "0.0.6"
4
4
  end
5
5
  end
data/lib/stack.rb CHANGED
@@ -32,6 +32,7 @@ module Stack
32
32
  def Stack.populate_config(config)
33
33
 
34
34
  config[:find_file_paths] = Array.new if config[:find_file_paths].nil?
35
+ config[:mime_encode_user_data] = true if config[:mime_encode_user_data].nil?
35
36
 
36
37
  # build out the full config for each node, supplying defaults from the
37
38
  # global config if explicitly supplied
@@ -85,8 +86,17 @@ module Stack
85
86
  bootstrap_abs = Stack.find_file(config, config[:node_details][fqdn][:bootstrap])
86
87
  cloud_config_yaml_abs = Stack.find_file(config, config[:node_details][fqdn][:cloud_config_yaml])
87
88
 
88
- multipart_cmd = "#{libdir}/write-mime-multipart #{bootstrap_abs} #{cloud_config_yaml_abs}"
89
- user_data = `#{multipart_cmd}`
89
+ if config[:mime_encode_user_data]
90
+ Logger.debug "mime encoding user-data..."
91
+ multipart_cmd = "#{libdir}/write-mime-multipart #{bootstrap_abs} #{cloud_config_yaml_abs}"
92
+ user_data = `#{multipart_cmd}`
93
+ else
94
+ # Ubuntu Hardy seems to struggle with some mime-encoded user-data
95
+ # so allow the user to forse submitting user-data un-mimed,
96
+ # in which case we can only pass one file & it must be the bootstrap script
97
+ Logger.debug "mime encoding user-data disabled, only sending the bootstrap script"
98
+ user_data = File.read(bootstrap_abs)
99
+ end
90
100
 
91
101
  user_data.gsub!(/rentpro-unconfigured/, hostname)
92
102
  user_data.gsub!(/rentpro-stage.local/, config[:dns_domain])
metadata CHANGED
@@ -1,41 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-kicker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon McCartney
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-30 00:00:00.000000000 Z
11
+ date: 2015-02-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rdoc
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ! '>='
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ! '>='
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: aruba
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ! '>='
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ! '>='
38
+ - - ~>
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
@@ -56,44 +56,44 @@ dependencies:
56
56
  name: gem-release
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ! '>='
59
+ - - ~>
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: '0.7'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ! '>='
66
+ - - ~>
67
67
  - !ruby/object:Gem::Version
68
- version: '0'
68
+ version: '0.7'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: methadone
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - ~>
74
74
  - !ruby/object:Gem::Version
75
- version: 1.2.4
75
+ version: '1.2'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - ~>
81
81
  - !ruby/object:Gem::Version
82
- version: 1.2.4
82
+ version: '1.2'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: fog
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - ~>
88
88
  - !ruby/object:Gem::Version
89
- version: 1.12.1
89
+ version: '1.12'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - ~>
95
95
  - !ruby/object:Gem::Version
96
- version: 1.12.1
96
+ version: '1.12'
97
97
  description: Utility for kicking an application stack into life on Amazon EC2
98
98
  email:
99
99
  - simon@mccartney.ie
@@ -103,7 +103,6 @@ extensions: []
103
103
  extra_rdoc_files: []
104
104
  files:
105
105
  - .gitignore
106
- - .rvmrc
107
106
  - Gemfile
108
107
  - LICENSE.txt
109
108
  - README.md
@@ -119,8 +118,9 @@ files:
119
118
  - lib/stack.rb
120
119
  - lib/write-mime-multipart
121
120
  - test/tc_something.rb
122
- homepage: https://github.com/simonmcc/kicker
123
- licenses: []
121
+ homepage: https://github.com/simonmcc/aws-kicker
122
+ licenses:
123
+ - Apache
124
124
  metadata: {}
125
125
  post_install_message:
126
126
  rdoc_options: []
@@ -138,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
138
138
  version: '0'
139
139
  requirements: []
140
140
  rubyforge_project:
141
- rubygems_version: 2.2.2
141
+ rubygems_version: 2.4.6
142
142
  signing_key:
143
143
  specification_version: 4
144
144
  summary: ! 'Stacks are built from a collection of instances required to build an application
data/.rvmrc DELETED
@@ -1,48 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- # This is an RVM Project .rvmrc file, used to automatically load the ruby
4
- # development environment upon cd'ing into the directory
5
-
6
- # First we specify our desired <ruby>[@<gemset>], the @gemset name is optional,
7
- # Only full ruby name is supported here, for short names use:
8
- # echo "rvm use 1.9.3" > .rvmrc
9
- environment_id="ruby-1.9.3@aws-kicker"
10
-
11
- # Uncomment the following lines if you want to verify rvm version per project
12
- # rvmrc_rvm_version="1.17.3 (stable)" # 1.10.1 seams as a safe start
13
- # eval "$(echo ${rvm_version}.${rvmrc_rvm_version} | awk -F. '{print "[[ "$1*65536+$2*256+$3" -ge "$4*65536+$5*256+$6" ]]"}' )" || {
14
- # echo "This .rvmrc file requires at least RVM ${rvmrc_rvm_version}, aborting loading."
15
- # return 1
16
- # }
17
-
18
- # First we attempt to load the desired environment directly from the environment
19
- # file. This is very fast and efficient compared to running through the entire
20
- # CLI and selector. If you want feedback on which environment was used then
21
- # insert the word 'use' after --create as this triggers verbose mode.
22
- if [[ -d "${rvm_path:-$HOME/.rvm}/environments"
23
- && -s "${rvm_path:-$HOME/.rvm}/environments/$environment_id" ]]
24
- then
25
- \. "${rvm_path:-$HOME/.rvm}/environments/$environment_id"
26
- [[ -s "${rvm_path:-$HOME/.rvm}/hooks/after_use" ]] &&
27
- \. "${rvm_path:-$HOME/.rvm}/hooks/after_use" || true
28
- else
29
- # If the environment file has not yet been created, use the RVM CLI to select.
30
- rvm --create "$environment_id" || {
31
- echo "Failed to create RVM environment '${environment_id}'."
32
- return 1
33
- }
34
- fi
35
-
36
- # If you use bundler, this might be useful to you:
37
- # if [[ -s Gemfile ]] && {
38
- # ! builtin command -v bundle >/dev/null ||
39
- # builtin command -v bundle | GREP_OPTIONS= \grep $rvm_path/bin/bundle >/dev/null
40
- # }
41
- # then
42
- # printf "%b" "The rubygem 'bundler' is not installed. Installing it now.\n"
43
- # gem install bundler
44
- # fi
45
- # if [[ -s Gemfile ]] && builtin command -v bundle >/dev/null
46
- # then
47
- # bundle install | GREP_OPTIONS= \grep -vE '^Using|Your bundle is complete'
48
- # fi