rig 0.4.4 → 0.4.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,47 +1,73 @@
1
1
  # The region for this account.
2
2
  # Each account can have a different region, so you can
3
3
  # manage deployments in different regions easily.
4
- region: us-east-1
4
+ :region: us-east-1
5
5
 
6
6
  # The DNS zone to manage.
7
7
  # Generally this will be different for each account,
8
8
  # but it is possible to have all of your accounts
9
9
  # managed under a single zone... IF you are using
10
10
  # the same DNS provider for all of your accounts.
11
- dns_zone: blah.com
11
+ :dns_zone: blah.com
12
12
 
13
13
  # this is the key that you will use to SSH to the server
14
- keypair: keyname
14
+ :keypair: keyname
15
15
 
16
16
  # security groups to use when creating instances
17
17
  # groups configuration precedence:
18
18
  # template instances -> template -> account -> config
19
- # groups:
19
+ # :groups:
20
20
  # - default
21
21
 
22
+ # Userdata package to use
23
+ #
24
+ # Userdata packages allow you to further customize the way
25
+ # the servers are configured.
26
+ #
27
+ # You can find these packages in your rig directory (~/.rig by default)
28
+ # ~/.rig/userdata/default
29
+ #
30
+ # The following are provided:
31
+ # "default" is a vanilla install
32
+ # "chef" is designed to bootstrap a chef implementation
33
+ #
34
+ # See the corresponding userdata.yml for more information
35
+ :userdata: default
36
+
22
37
  # Common settings.
23
38
  # In most cases, you will be using the same provider
24
39
  # for all of the different components within your
25
40
  # infrastructure (Compute, DNS, Balancers, etc).
26
41
  # You can store the common keys and secrets here.
27
- common: &common
28
- aws_access_key_id: aws_key
29
- aws_secret_access_key: aws_secret
42
+ :common: &common
43
+ :aws_access_key_id: aws_key
44
+ :aws_secret_access_key: aws_secret
30
45
 
31
46
  # Compute settings
32
47
  # These are passed to Fog when creating a connection
33
- compute:
48
+ :compute:
34
49
  <<: *common
35
- provider: AWS
36
- region: *region
50
+ :provider: AWS
51
+ :region: *region
37
52
 
38
53
  # DNS settings
39
54
  # These are passed to Fog when creating a connection
40
- dns:
55
+ :dns:
41
56
  <<: *common
42
- provider: AWS
57
+ :provider: AWS
43
58
 
44
59
  # Balancer settings
45
60
  # These are passed to Fog when creating a connection
46
- balancer:
61
+ :balancer:
47
62
  <<: *common
63
+
64
+ # Database settings
65
+ # MongoDB and MySQL are supported
66
+ #:database:
67
+ # :provider: MongoDB # or MySQL
68
+ # :host: localhost
69
+ # :port: 27017
70
+ # :user: username
71
+ # :pass: password
72
+ # :admin_user: admin_username
73
+ # :admin_pass: admin_password
@@ -0,0 +1,63 @@
1
+ #!/bin/bash
2
+ set -e -x
3
+ exec > ~/userdata.log 2>&1
4
+ export DEBIAN_FRONTEND=noninteractive
5
+ apt-add-repository -y ppa:brightbox/ruby-ng-experimental
6
+
7
+ apt-get update
8
+ apt-get -y install <%= @dependencies.join(' ') %>
9
+ mkdir -p /var/log/chef
10
+ mkdir -p /var/backups/chef
11
+ mkdir -p /var/run/chef
12
+ mkdir -p /var/cache/chef
13
+ mkdir -p /var/lib/chef
14
+ mkdir /etc/chef
15
+
16
+ # set up hostname
17
+ hostname <%= @name %>.<%= @zone %>
18
+ echo "<%= @name %>.<%= @zone %>" > /etc/hostname
19
+ echo "127.0.0.1 <%= @name %>.<%= @zone %> <%= @name.split('.')[0] %> <%= @name %> # entered by userdata script" >> /etc/hosts
20
+
21
+ gem install rubygems-update --no-ri --no-rdoc
22
+ update_rubygems
23
+
24
+ <% @gems.each do |gem| %>
25
+ gem install <%= gem %> --no-ri --no-rdoc
26
+ <% end %>
27
+
28
+ cat <<FACTS > /etc/facts.yml
29
+ rig_name: <%= @name %>
30
+ rig_role: <%= @role %>
31
+ rig_environment: <%= @environment %>
32
+ FACTS
33
+
34
+ cat <<JSON > /etc/chef/bootstrap.json
35
+ {
36
+ "run_list": [
37
+ "role[<%= @role %>]"
38
+ ]
39
+ }
40
+ JSON
41
+
42
+ cat <<CLIENT > /etc/chef/client.rb
43
+ log_level :info
44
+ log_location "/var/log/chef/client.log"
45
+ ssl_verify_mode :verify_none
46
+ validation_client_name "chef-validator"
47
+ validation_key "/etc/chef/validation.pem"
48
+ client_key "/etc/chef/client.pem"
49
+ chef_server_url "http://chef.inqlabs.com:4000";
50
+ file_cache_path "/var/cache/chef"
51
+ file_backup_path "/var/backups/chef"
52
+ pid_file "/var/run/chef/client.pid"
53
+ node_name "<%= @name %>";
54
+ Chef::Log::Formatter.show_time = true
55
+ CLIENT
56
+
57
+ <% @files.each do |file|; local = file["local"]; remote = file["remote"] %>
58
+ cat << <%= local.upcase %> > <%= remote %>
59
+ <%= File.open("#@directory/#{local}").read %>
60
+ <%= local.upcase %>
61
+ <% end %>
62
+
63
+ chef-client -N <%= @name %> <%= @chef && @environment ? "-E " + @environment : "" %> --once -j /etc/chef/bootstrap.json 2>&1
@@ -0,0 +1,19 @@
1
+ erb: userdata.sh.erb
2
+ files:
3
+ - local: validation.pem
4
+ remote: /etc/chef/validation.pem
5
+ dependencies:
6
+ - build-essential
7
+ - wget
8
+ - curl
9
+ - ssl-cert
10
+ - ruby1.9.3
11
+ - ruby1.9.1-dev
12
+ - rubygems
13
+ - ruby-switch
14
+ - libopenssl-ruby1.9.1
15
+ - rdoc1.9.1
16
+ - ri1.9.1
17
+ - irb1.9.1
18
+ gems:
19
+ - chef
@@ -0,0 +1,27 @@
1
+ -----BEGIN RSA PRIVATE KEY-----
2
+ MIIEpgIBAAKCAQEAxFST0blraLl7mac91QzSxNNZQt7A4Mo4O297e+r6F5b1+Eae
3
+ RNAH9w4p9sctLttIT8rI77hWrgS04f6mbamSaY+pAyWje+MX2s5YXizEML1Fdyr6
4
+ hV1n/vIMOmhcVwGbF3fg6BKwjur7A1dS+aOM1sEYi77hfbY4NHhLCQiR4v2m4saC
5
+ C9SPX7uNIzKvGB2P/5U+HNPaJuo6GAUsrOrTA/YB53Bza4DPMpyp9+Hf/ZR9l6Hd
6
+ 4tCAp07dUNZ/LKKL4AmsnCqlT5EiYFIsaq2ezzPnS9t2FlFV60a2opbdEvq/QLbz
7
+ ouH6H+/4n/+BY9bVBCg1oBXHlLwbZmNl7Xl4wQIDAQABAoIBAQCFDIAkZ5C3psNx
8
+ bJoFkKwhQM1D+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VSNL8goTt8V01Q50x/y4Jf3QI
24
+ MDo2udYtAoGBAKk596lHuH5/LEjT5hfVrbarSvUjlXswJusZGnwbtEUERY7abUbG
25
+ 5mtI+Xme2q6T0Wjf6N977ecNYAi5VwpUzoziZUPeSCQUlRWSyX2o6+fVBngOFpLZ
26
+ tRv2ngXlc2sYh9RbnlWSdaK0g+U7V8l2wSsQjcPQ1J2vbIGjwBHDSzjc
27
+ -----END RSA PRIVATE KEY-----
@@ -0,0 +1,32 @@
1
+ #!/bin/bash
2
+ set -e -x
3
+ exec > ~/userdata.log 2>&1
4
+ export DEBIAN_FRONTEND=noninteractive
5
+ apt-add-repository -y ppa:brightbox/ruby-ng-experimental
6
+
7
+ apt-get update
8
+ apt-get -y install <%= @dependencies.join(' ') %>
9
+
10
+ # set up hostname
11
+ hostname <%= @name %>.<%= @zone %>
12
+ echo "<%= @name %>.<%= @zone %>" > /etc/hostname
13
+ echo "127.0.0.1 <%= @name %>.<%= @zone %> <%= @name.split('.')[0] %> <%= @name %> # entered by userdata script" >> /etc/hosts
14
+
15
+ gem install rubygems-update --no-ri --no-rdoc
16
+ update_rubygems
17
+
18
+ <% @gems.each do |gem| %>
19
+ gem install <%= gem %> --no-ri --no-rdoc
20
+ <% end %>
21
+
22
+ cat <<FACTS > /etc/facts.yml
23
+ rig_name: <%= @name %>
24
+ rig_role: <%= @role %>
25
+ rig_environment: <%= @environment %>
26
+ FACTS
27
+
28
+ <% @files.each do |file|; local = file["local"]; remote = file["remote"] %>
29
+ cat << <%= local.upcase %> > <%= remote %>
30
+ <%= File.open("#@directory/#{local}").read %>
31
+ <%= local.upcase %>
32
+ <% end %>
@@ -0,0 +1,14 @@
1
+ erb: userdata.sh.erb
2
+ dependencies:
3
+ - build-essential
4
+ - wget
5
+ - curl
6
+ - ssl-cert
7
+ - ruby1.9.3
8
+ - ruby1.9.1-dev
9
+ - rubygems
10
+ - ruby-switch
11
+ - libopenssl-ruby1.9.1
12
+ - rdoc1.9.1
13
+ - ri1.9.1
14
+ - irb1.9.1
@@ -34,6 +34,7 @@ module Rig
34
34
  if detailed
35
35
  r << server.private_ip_address.to_s
36
36
  end
37
+ r << server.availability_zone
37
38
  r << server.flavor_id.to_s
38
39
  r << server.id.to_s
39
40
  r << server.state.to_s.downcase
@@ -50,6 +51,7 @@ module Rig
50
51
  cols << "Protected"
51
52
  cols << "Public IP"
52
53
  cols << "Private IP" if detailed
54
+ cols << "AZ"
53
55
  cols << "Size"
54
56
  cols << "Instance ID"
55
57
  cols << "State"
@@ -16,6 +16,10 @@ module Rig
16
16
  lb.instances.each do |inst|
17
17
  puts " - #{inst}"
18
18
  end
19
+ puts "- zones"
20
+ lb.availability_zones.each do |z|
21
+ puts " - #{z}"
22
+ end
19
23
  end
20
24
  end
21
25
  end
@@ -17,9 +17,10 @@ module Rig
17
17
  rows = []
18
18
  envs.each do |e|
19
19
  env = Rig::Model::Environment.find(e)
20
- rows << [env.name, env.template, env.region, env.servers.count, env.balancers.count, env.protected?]
20
+ zones = env.servers.collect {|e| e.availability_zone }
21
+ rows << [env.name, env.template, env.region, env.servers.count, env.balancers.count, env.protected?, zones]
21
22
  end
22
- print_table(%w{Name Template Region Servers# Balancers# Protected?}, rows)
23
+ print_table(%w{Name Template Region Servers# Balancers# Protected? AZs}, rows)
23
24
  end
24
25
  end
25
26
  end
@@ -25,6 +25,17 @@ module Rig
25
25
  File.open(dest, "w") {|f| f.write(new.to_yaml)}
26
26
  end
27
27
 
28
+ subcommand "userdata", "test userdata" do
29
+ parameter "NAME", "name of server"
30
+ parameter "ROLE", "role of server"
31
+ parameter "ENVIRONMENT", "environment of server"
32
+
33
+ def execute
34
+ userdata = Rig::Model::Userdata.create(name, role, environment)
35
+ puts "USERDATA:\n#{userdata}"
36
+ end
37
+ end
38
+
28
39
  subcommand "init", "initialize configuration directory" do
29
40
  option %w{-f --force}, :flag, "force creation of files", :default => false
30
41
  option %w{-d --directory}, "DIRECTORY", "configuration directory", :default => "~/.rig"
@@ -34,7 +45,17 @@ module Rig
34
45
  back = "#{dir}.bak.#{Time.now.to_i}"
35
46
  conf = File.expand_path("../../../../conf", __FILE__)
36
47
 
37
- files = ["config.yml", "accounts/default.yml", "templates/solo.yml", "templates/multi.yml"]
48
+ files = %w{
49
+ config.yml
50
+ accounts/default.yml
51
+ templates/solo.yml
52
+ templates/multi.yml
53
+ userdata/default/userdata.sh.erb
54
+ userdata/default/userdata.yml
55
+ userdata/chef/userdata.sh.erb
56
+ userdata/chef/userdata.yml
57
+ userdata/chef/validation.pem
58
+ }
38
59
 
39
60
  unless dir
40
61
  puts "directory could not be found: tried environment variables RIG_CONFIG (#{ENV['RIG_CONFIG']}) and HOME (#{ENV['HOME']}"
@@ -50,12 +71,11 @@ module Rig
50
71
 
51
72
  puts "[create] #{dir}/"
52
73
  FileUtils.mkdir_p(dir)
53
- FileUtils.mkdir_p("#{dir}/accounts")
54
- FileUtils.mkdir_p("#{dir}/templates")
55
74
 
56
75
  files.each do |file|
57
76
  src = "#{conf}/#{file}"
58
77
  dest = "#{dir}/#{file}"
78
+ FileUtils.mkdir_p(File.dirname(dest))
59
79
  if File.exists?(dest) && !force?
60
80
  puts "[skip] #{dest}"
61
81
  else
@@ -8,18 +8,19 @@ module Rig
8
8
  Rig::Connection.balancer.load_balancers.all
9
9
  end
10
10
 
11
- def new(name, listeners=[])
11
+ def new(name, listeners=[], zones=[])
12
+ fog = Rig::Connection.balancer
12
13
  listeners.map! do |listener|
13
14
  ld = new_listener_description(listener)
14
15
  #ap ld
15
16
  ld
16
17
  end
17
18
  #ap listeners
18
- Rig::Connection.balancer.load_balancers.new({ :id => name, "ListenerDescriptions" => listeners })
19
+ fog.load_balancers.new({ :id => name, "ListenerDescriptions" => listeners, :availability_zones => zones })
19
20
  end
20
21
 
21
- def create(name, listeners=[])
22
- b = self.new(name, listeners)
22
+ def create(name, listeners=[], zones=[])
23
+ b = self.new(name, listeners, zones)
23
24
  b.save if b
24
25
  puts ".. created: #{name}"
25
26
  b
@@ -90,7 +90,8 @@ module Rig
90
90
 
91
91
  if tmpl[:balance]
92
92
  puts "creating balancer"
93
- balancer = Rig::Model::Balancer.create("#{name}-#{role}", tmpl[:listeners])
93
+ zones = setinstances.collect {|e| e.availability_zone }
94
+ balancer = Rig::Model::Balancer.create("#{name}-#{role}", tmpl[:listeners], zones)
94
95
  balancer.register_instances(setinstances.collect { |e| e.id })
95
96
  balancer.save
96
97
 
@@ -1,111 +1,30 @@
1
1
  require 'erubis'
2
+ require 'awesome_print'
2
3
 
3
4
  module Rig
4
5
  module Model
5
6
  class Userdata
6
7
  class << self
7
8
  def create(name, role, environment, opts={ })
8
- data = {
9
+ package = Rig.get_config(:userdata)
10
+ directory = "#{Rig.configdir}/userdata/#{package}"
11
+ config = YAML.load_file("#{directory}/userdata.yml")
12
+
13
+ data = {
9
14
  :name => name,
10
15
  :role => role,
11
16
  :environment => environment,
12
17
  :zone => Rig.get_config(:dns_zone),
13
- :dependencies => %w{ ruby1.9.3 ruby1.9.1-dev rubygems ruby-switch libopenssl-ruby1.9.1 rdoc1.9.1 ri1.9.1 irb1.9.1
14
- build-essential wget ssl-cert curl },
15
- :gems => %w{chef},
16
- :chef => false,
17
- }.merge(opts)
18
- template = <<-EOF
19
- #!/bin/bash
20
- set -e -x
21
- exec > ~/userdata.log 2>&1
22
- export DEBIAN_FRONTEND=noninteractive
23
- apt-add-repository -y ppa:brightbox/ruby-ng-experimental
24
-
25
- apt-get update && apt-get upgrade -y
26
- apt-get -y install <%= @dependencies.join(' ') %>
27
- mkdir -p /var/log/chef
28
- mkdir -p /var/backups/chef
29
- mkdir -p /var/run/chef
30
- mkdir -p /var/cache/chef
31
- mkdir -p /var/lib/chef
32
- mkdir /etc/chef
33
-
34
- # set up hostname
35
- hostname <%= @name %>.<%= @zone %>
36
- echo "<%= @name %>.<%= @zone %>" > /etc/hostname
37
- echo "127.0.0.1 <%= @name %>.<%= @zone %> <%= @name.split('.')[0] %> <%= @name %> # entered by userdata script" >> /etc/hosts
38
-
39
- gem install rubygems-update --no-ri --no-rdoc
40
- update_rubygems
41
-
42
- <% @gems.each do |gem| %>
43
- gem install <%= gem %> --no-ri --no-rdoc
44
- <% end %>
45
-
46
- cat <<FACTS > /etc/facts.yml
47
- inq_name: <%= @name %>
48
- inq_role: <%= @role %>
49
- inq_environment: <%= @environment %>
50
- FACTS
51
-
52
- cat <<JSON > /etc/chef/bootstrap.json
53
- {
54
- "run_list": [
55
- "role[<%= @role %>]"
56
- ]
57
- }
58
- JSON
59
-
60
- cat <<CLIENT > /etc/chef/client.rb
61
- log_level :info
62
- log_location "/var/log/chef/client.log"
63
- ssl_verify_mode :verify_none
64
- validation_client_name "chef-validator"
65
- validation_key "/etc/chef/validation.pem"
66
- client_key "/etc/chef/client.pem"
67
- chef_server_url "http://chef.inqlabs.com:4000";
68
- file_cache_path "/var/cache/chef"
69
- file_backup_path "/var/backups/chef"
70
- pid_file "/var/run/chef/client.pid"
71
- node_name "<%= @name %>";
72
- Chef::Log::Formatter.show_time = true
73
- CLIENT
74
-
75
- cat <<VALID > /etc/chef/validation.pem
76
- -----BEGIN RSA PRIVATE KEY-----
77
- MIIEpgIBAAKCAQEAxFST0blraLl7mac91QzSxNNZQt7A4Mo4O297e+r6F5b1+Eae
78
- RNAH9w4p9sctLttIT8rI77hWrgS04f6mbamSaY+pAyWje+MX2s5YXizEML1Fdyr6
79
- hV1n/vIMOmhcVwGbF3fg6BKwjur7A1dS+aOM1sEYi77hfbY4NHhLCQiR4v2m4saC
80
- C9SPX7uNIzKvGB2P/5U+HNPaJuo6GAUsrOrTA/YB53Bza4DPMpyp9+Hf/ZR9l6Hd
81
- 4tCAp07dUNZ/LKKL4AmsnCqlT5EiYFIsaq2ezzPnS9t2FlFV60a2opbdEvq/QLbz
82
- ouH6H+/4n/+BY9bVBCg1oBXHlLwbZmNl7Xl4wQIDAQABAoIBAQCFDIAkZ5C3psNx
83
- bJoFkKwhQM1D+OsjK0eSV8mKP8J+TAqi11CYd5Z+QbYEjBQ9pdNK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fVrbarSvUjlXswJusZGnwbtEUERY7abUbG
100
- 5mtI+Xme2q6T0Wjf6N977ecNYAi5VwpUzoziZUPeSCQUlRWSyX2o6+fVBngOFpLZ
101
- tRv2ngXlc2sYh9RbnlWSdaK0g+U7V8l2wSsQjcPQ1J2vbIGjwBHDSzjc
102
- -----END RSA PRIVATE KEY-----
103
- VALID
104
-
105
- chef-client -N <%= @name %> <%= @chef && @environment ? "-E " + @environment : "" %> --once -j /etc/chef/bootstrap.json 2>&1
106
- EOF
107
- erb = Erubis::Eruby.new(template)
108
- out = erb.evaluate(data)
18
+ :dependencies => [],
19
+ :gems => [],
20
+ :files => [],
21
+ :directory => directory,
22
+ :template => "userdata.sh.erb",
23
+ }.merge(config).merge(opts)
24
+
25
+ template = File.open("#{directory}/#{data[:template]}").read
26
+ erb = Erubis::Eruby.new(template)
27
+ out = erb.evaluate(data)
109
28
  end
110
29
  end
111
30
  end
@@ -3,7 +3,7 @@ unless defined?(Rig::Version)
3
3
  module Version
4
4
  MAJOR = 0
5
5
  MINOR = 4
6
- TINY = 4
6
+ TINY = 5
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rig
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.4.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-18 00:00:00.000000000 Z
12
+ date: 2012-05-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: clamp
@@ -126,6 +126,11 @@ files:
126
126
  - conf/config.yml
127
127
  - conf/templates/multi.yml
128
128
  - conf/templates/solo.yml
129
+ - conf/userdata/chef/userdata.sh.erb
130
+ - conf/userdata/chef/userdata.yml
131
+ - conf/userdata/chef/validation.pem
132
+ - conf/userdata/default/userdata.sh.erb
133
+ - conf/userdata/default/userdata.yml
129
134
  - lib/rig.rb
130
135
  - lib/rig/capistrano.rb
131
136
  - lib/rig/chef.rb