ironfan 5.0.11 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. data/.gitignore +4 -0
  2. data/.gitmodules +3 -0
  3. data/Gemfile +8 -26
  4. data/Gemfile.lock +38 -41
  5. data/NOTES-REALM.md +172 -0
  6. data/Rakefile +19 -77
  7. data/config/ubuntu12.04-ironfan.erb +7 -0
  8. data/ironfan.gemspec +28 -225
  9. data/lib/chef/cluster_knife.rb +26 -0
  10. data/lib/chef/knife/bootstrap/ubuntu12.04-ironfan.erb +7 -0
  11. data/lib/chef/knife/cluster_bootstrap.rb +1 -3
  12. data/lib/chef/knife/cluster_diff.rb +2 -8
  13. data/lib/chef/knife/cluster_kick.rb +1 -3
  14. data/lib/chef/knife/cluster_kill.rb +1 -2
  15. data/lib/chef/knife/cluster_launch.rb +17 -34
  16. data/lib/chef/knife/cluster_list.rb +6 -5
  17. data/lib/chef/knife/cluster_proxy.rb +1 -3
  18. data/lib/chef/knife/cluster_pry.rb +1 -2
  19. data/lib/chef/knife/cluster_show.rb +6 -7
  20. data/lib/chef/knife/cluster_ssh.rb +10 -8
  21. data/lib/chef/knife/cluster_start.rb +1 -2
  22. data/lib/chef/knife/cluster_stop.rb +1 -2
  23. data/lib/chef/knife/cluster_sync.rb +2 -3
  24. data/lib/chef/knife/ironfan_knife_common.rb +58 -18
  25. data/lib/chef/knife/ironfan_script.rb +0 -3
  26. data/lib/ironfan/broker/computer.rb +14 -11
  27. data/lib/ironfan/broker.rb +17 -12
  28. data/lib/ironfan/cookbook_requirements.rb +155 -0
  29. data/lib/ironfan/dsl/cloud.rb +2 -0
  30. data/lib/ironfan/dsl/cluster.rb +25 -15
  31. data/lib/ironfan/dsl/component.rb +12 -15
  32. data/lib/ironfan/dsl/compute.rb +10 -8
  33. data/lib/ironfan/dsl/ec2.rb +2 -26
  34. data/lib/ironfan/dsl/facet.rb +16 -14
  35. data/lib/ironfan/dsl/openstack.rb +147 -0
  36. data/lib/ironfan/dsl/realm.rb +23 -16
  37. data/lib/ironfan/dsl/security_group.rb +29 -0
  38. data/lib/ironfan/dsl/server.rb +14 -5
  39. data/lib/ironfan/dsl/static.rb +63 -0
  40. data/lib/ironfan/dsl/vsphere.rb +1 -0
  41. data/lib/ironfan/dsl.rb +1 -134
  42. data/lib/ironfan/headers.rb +19 -0
  43. data/lib/ironfan/provider/chef/node.rb +3 -2
  44. data/lib/ironfan/provider/ec2/machine.rb +10 -14
  45. data/lib/ironfan/provider/ec2/security_group.rb +58 -43
  46. data/lib/ironfan/provider/openstack/elastic_ip.rb +96 -0
  47. data/lib/ironfan/provider/openstack/keypair.rb +78 -0
  48. data/lib/ironfan/provider/openstack/machine.rb +371 -0
  49. data/lib/ironfan/provider/openstack/security_group.rb +224 -0
  50. data/lib/ironfan/provider/openstack.rb +69 -0
  51. data/lib/ironfan/provider/static/machine.rb +192 -0
  52. data/lib/ironfan/provider/static.rb +23 -0
  53. data/lib/ironfan/provider.rb +58 -1
  54. data/lib/ironfan/requirements.rb +17 -1
  55. data/lib/ironfan/version.rb +3 -0
  56. data/lib/ironfan.rb +107 -172
  57. data/spec/chef/cluster_bootstrap_spec.rb +2 -7
  58. data/spec/chef/cluster_launch_spec.rb +1 -2
  59. data/spec/fixtures/realms/samurai.rb +26 -0
  60. data/spec/integration/minimal-chef-repo/clusters/.gitkeep +0 -0
  61. data/spec/integration/minimal-chef-repo/config/.gitkeep +0 -0
  62. data/spec/integration/minimal-chef-repo/knife/credentials/.gitignore +1 -0
  63. data/spec/integration/minimal-chef-repo/knife/credentials/certificates/.gitkeep +0 -0
  64. data/spec/integration/minimal-chef-repo/knife/credentials/client_keys/.gitkeep +0 -0
  65. data/spec/integration/minimal-chef-repo/knife/credentials/data_bag_keys/.gitkeep +0 -0
  66. data/spec/integration/minimal-chef-repo/knife/credentials/ec2_certs/.gitkeep +0 -0
  67. data/spec/integration/minimal-chef-repo/knife/credentials/ec2_keys/.gitkeep +0 -0
  68. data/spec/integration/minimal-chef-repo/knife/credentials/ironfantest-validator.pem +27 -0
  69. data/spec/integration/minimal-chef-repo/knife/credentials/ironfantester.pem +27 -0
  70. data/spec/integration/minimal-chef-repo/tasks/.gitkeep +0 -0
  71. data/spec/ironfan/cluster_spec.rb +1 -2
  72. data/spec/ironfan/diff_spec.rb +0 -2
  73. data/spec/ironfan/dsl_spec.rb +6 -3
  74. data/spec/ironfan/ec2/cloud_provider_spec.rb +17 -18
  75. data/spec/ironfan/ec2/elb_spec.rb +44 -41
  76. data/spec/ironfan/ec2/security_group_spec.rb +45 -47
  77. data/spec/ironfan/manifest_spec.rb +0 -1
  78. data/spec/ironfan/plugin_spec.rb +55 -40
  79. data/spec/ironfan/realm_spec.rb +42 -30
  80. data/spec/spec_helper.rb +17 -31
  81. data/spec/{spec_helper → support}/dummy_chef.rb +0 -0
  82. data/spec/{spec_helper → support}/dummy_diff_drawer.rb +0 -0
  83. metadata +78 -155
  84. data/.rspec +0 -2
  85. data/.yardopts +0 -19
  86. data/VERSION +0 -2
  87. data/chefignore +0 -41
  88. data/notes/Future-development-proposals.md +0 -266
  89. data/notes/Home.md +0 -55
  90. data/notes/INSTALL-cloud_setup.md +0 -103
  91. data/notes/INSTALL.md +0 -134
  92. data/notes/Ironfan-Roadmap.md +0 -70
  93. data/notes/Upgrading-to-v4.md +0 -66
  94. data/notes/advanced-superpowers.md +0 -16
  95. data/notes/aws_servers.jpg +0 -0
  96. data/notes/aws_user_key.png +0 -0
  97. data/notes/cookbook-versioning.md +0 -11
  98. data/notes/core_concepts.md +0 -200
  99. data/notes/declaring_volumes.md +0 -3
  100. data/notes/design_notes-aspect_oriented_devops.md +0 -36
  101. data/notes/design_notes-ci_testing.md +0 -169
  102. data/notes/design_notes-cookbook_event_ordering.md +0 -249
  103. data/notes/design_notes-meta_discovery.md +0 -59
  104. data/notes/ec2-pricing_and_capacity.md +0 -75
  105. data/notes/ec2-pricing_and_capacity.numbers +0 -0
  106. data/notes/homebase-layout.txt +0 -102
  107. data/notes/knife-cluster-commands.md +0 -21
  108. data/notes/named-cloud-objects.md +0 -11
  109. data/notes/opscode_org_key.png +0 -0
  110. data/notes/opscode_user_key.png +0 -0
  111. data/notes/philosophy.md +0 -13
  112. data/notes/rake_tasks.md +0 -24
  113. data/notes/renamed-recipes.txt +0 -142
  114. data/notes/silverware.md +0 -85
  115. data/notes/style_guide.md +0 -300
  116. data/notes/tips_and_troubleshooting.md +0 -92
  117. data/notes/walkthrough-hadoop.md +0 -168
  118. data/notes/walkthrough-web.md +0 -166
  119. data/spec/fixtures/gunbai.rb +0 -24
  120. data/spec/test_config.rb +0 -20
  121. data/tasks/chef_config.rake +0 -38
data/.gitignore CHANGED
@@ -41,6 +41,10 @@ pkg
41
41
  .rvmrc
42
42
  .vendor
43
43
  .bundle
44
+ .rspec
45
+ .yardopts
46
+ Gemfile.lock
47
+ chefignore
44
48
 
45
49
  .rake_test_cache
46
50
  metadata.json
data/.gitmodules ADDED
@@ -0,0 +1,3 @@
1
+ [submodule "notes"]
2
+ path = notes
3
+ url = https://github.com/infochimps-labs/ironfan.wiki.git
data/Gemfile CHANGED
@@ -1,40 +1,22 @@
1
- source "http://rubygems.org"
1
+ source 'https://rubygems.org'
2
2
 
3
- gem 'chef', "~> 10.16"
4
- gem 'fog', "~> 1.2"
5
- gem 'excon', "~> 0.21.0" # v0.22 breaks EC2 calls
6
- gem 'formatador', "~> 0.2"
7
- gem 'gorillib', "~> 0.5.0"
8
- gem 'rbvmomi'
9
- gem 'diff-lcs', "~> 1.2.5"
10
3
 
11
- # Everything in the world is being a stupid dick about JSON versions. Pin it
12
- # to the one that doesn't seem to angrify everyone.
13
- gem 'json', "= 1.5.4"
4
+ gemspec
14
5
 
15
6
  group :development do
16
- gem 'bundler', "~> 1.0"
17
7
  gem 'rake'
18
- gem 'rspec', "~> 2.8"
19
- gem 'yard', ">= 0.7"
20
- #
21
- gem 'redcarpet', ">= 2.1"
22
- gem 'oj', ">= 1.2"
23
- end
24
-
25
- group :support do
26
- gem 'jeweler', ">= 1.6"
27
- gem 'pry'
8
+ gem 'rspec', '~> 2.8'
9
+ gem 'yard', '>= 0.7'
10
+ gem 'redcarpet', '>= 2.1'
11
+ gem 'oj', '>= 1.2'
28
12
  end
29
13
 
30
14
  group :test do
31
- gem 'simplecov', ">= 0.5", :platform => :ruby_19
32
- #
33
- gem 'guard', "~> 1"
15
+ gem 'simplecov', '>= 0.5'
16
+ gem 'guard', '~> 1'
34
17
  gem 'guard-rspec'
35
18
  gem 'guard-yard'
36
19
  gem 'ruby_gntp'
37
20
  gem 'ruby-debug19'
38
- #
39
21
  gem 'chef-zero'
40
22
  end
data/Gemfile.lock CHANGED
@@ -1,23 +1,37 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ ironfan (6.0.0)
5
+ chef (= 10.30.4)
6
+ diff-lcs (= 1.2.5)
7
+ excon (= 0.21.0)
8
+ fog (= 1.10.1)
9
+ formatador (= 0.2.4)
10
+ gorillib (= 0.5.0)
11
+ json (= 1.5.4)
12
+ rbvmomi (= 1.8.1)
13
+
1
14
  GEM
2
- remote: http://rubygems.org/
15
+ remote: https://rubygems.org/
3
16
  specs:
4
17
  archive-tar-minitar (0.5.2)
5
18
  builder (3.2.2)
6
19
  bunny (0.7.9)
7
- chef (10.26.0)
20
+ chef (10.30.4)
8
21
  bunny (>= 0.6.0, < 0.8.0)
9
22
  erubis
10
- highline (>= 1.6.9)
23
+ highline (~> 1.6, >= 1.6.9)
11
24
  json (>= 1.4.4, <= 1.7.7)
12
- mixlib-authentication (>= 1.3.0)
13
- mixlib-cli (>= 1.1.0)
14
- mixlib-config (>= 1.1.2)
15
- mixlib-log (>= 1.3.0)
16
- mixlib-shellout
25
+ mime-types (~> 1.16)
26
+ mixlib-authentication (~> 1.3)
27
+ mixlib-cli (~> 1.1)
28
+ mixlib-config (~> 1.1, >= 1.1.2)
29
+ mixlib-log (~> 1.3)
30
+ mixlib-shellout (~> 1.3)
17
31
  moneta (< 0.7.0)
18
32
  net-ssh (~> 2.6)
19
33
  net-ssh-multi (~> 1.1.0)
20
- ohai (>= 0.6.0)
34
+ ohai (>= 0.6.0, < 7.0.0)
21
35
  rest-client (>= 1.0.4, < 1.7.0)
22
36
  treetop (~> 1.4.9)
23
37
  uuidtools
@@ -48,7 +62,6 @@ GEM
48
62
  nokogiri (~> 1.5.0)
49
63
  ruby-hmac
50
64
  formatador (0.2.4)
51
- git (1.2.5)
52
65
  gorillib (0.5.0)
53
66
  configliere (>= 0.4.13)
54
67
  json
@@ -66,13 +79,8 @@ GEM
66
79
  guard (>= 1.1.0)
67
80
  yard (>= 0.7.0)
68
81
  hashie (2.0.5)
69
- highline (1.6.19)
82
+ highline (1.6.21)
70
83
  ipaddress (0.8.0)
71
- jeweler (1.8.4)
72
- bundler (~> 1.0)
73
- git (>= 1.2.5)
74
- rake
75
- rdoc
76
84
  json (1.5.4)
77
85
  linecache19 (0.5.12)
78
86
  ruby_core_source (>= 0.1.4)
@@ -82,34 +90,34 @@ GEM
82
90
  rb-kqueue (>= 0.2)
83
91
  lumberjack (1.0.3)
84
92
  method_source (0.8.1)
85
- mime-types (1.23)
93
+ mime-types (1.25.1)
86
94
  mixlib-authentication (1.3.0)
87
95
  mixlib-log
88
- mixlib-cli (1.3.0)
96
+ mixlib-cli (1.4.0)
89
97
  mixlib-config (1.1.2)
90
98
  mixlib-log (1.6.0)
91
- mixlib-shellout (1.1.0)
99
+ mixlib-shellout (1.3.0)
92
100
  moneta (0.6.0)
93
- multi_json (1.7.7)
94
- net-scp (1.1.1)
101
+ multi_json (1.8.2)
102
+ net-scp (1.1.2)
95
103
  net-ssh (>= 2.6.5)
96
- net-ssh (2.6.7)
104
+ net-ssh (2.7.0)
97
105
  net-ssh-gateway (1.2.0)
98
106
  net-ssh (>= 2.6.5)
99
107
  net-ssh-multi (1.1)
100
108
  net-ssh (>= 2.1.4)
101
109
  net-ssh-gateway (>= 0.99.0)
102
- nokogiri (1.5.10)
103
- ohai (6.16.0)
110
+ nokogiri (1.5.11)
111
+ ohai (6.20.0)
104
112
  ipaddress
105
113
  mixlib-cli
106
114
  mixlib-config
107
115
  mixlib-log
108
116
  mixlib-shellout
109
- systemu
117
+ systemu (~> 2.5.2)
110
118
  yajl-ruby
111
119
  oj (2.1.2)
112
- polyglot (0.3.3)
120
+ polyglot (0.3.4)
113
121
  pry (0.9.12.2)
114
122
  coderay (~> 1.0.5)
115
123
  method_source (~> 0.8)
@@ -123,12 +131,10 @@ GEM
123
131
  ffi (>= 0.5.0)
124
132
  rb-kqueue (0.2.0)
125
133
  ffi (>= 0.5.0)
126
- rbvmomi (1.6.0)
134
+ rbvmomi (1.8.1)
127
135
  builder
128
136
  nokogiri (>= 1.4.1)
129
137
  trollop
130
- rdoc (4.0.1)
131
- json (~> 1.4)
132
138
  redcarpet (2.3.0)
133
139
  rest-client (1.6.7)
134
140
  mime-types (>= 1.16)
@@ -159,12 +165,12 @@ GEM
159
165
  slop (3.4.5)
160
166
  systemu (2.5.2)
161
167
  thor (0.18.1)
162
- treetop (1.4.14)
168
+ treetop (1.4.15)
163
169
  polyglot
164
170
  polyglot (>= 0.3.1)
165
171
  trollop (2.0)
166
172
  uuidtools (2.1.4)
167
- yajl-ruby (1.1.0)
173
+ yajl-ruby (1.2.0)
168
174
  yard (0.8.6.1)
169
175
 
170
176
  PLATFORMS
@@ -172,22 +178,13 @@ PLATFORMS
172
178
 
173
179
  DEPENDENCIES
174
180
  bundler (~> 1.0)
175
- chef (~> 10.16)
176
181
  chef-zero
177
- diff-lcs (~> 1.2.5)
178
- excon (~> 0.21.0)
179
- fog (~> 1.2)
180
- formatador (~> 0.2)
181
- gorillib (~> 0.5.0)
182
182
  guard (~> 1)
183
183
  guard-rspec
184
184
  guard-yard
185
- jeweler (>= 1.6)
186
- json (= 1.5.4)
185
+ ironfan!
187
186
  oj (>= 1.2)
188
- pry
189
187
  rake
190
- rbvmomi
191
188
  redcarpet (>= 2.1)
192
189
  rspec (~> 2.8)
193
190
  ruby-debug19
data/NOTES-REALM.md ADDED
@@ -0,0 +1,172 @@
1
+ # Ironfan Realms
2
+
3
+ Realms in Ironfan are designed to provide us with a logical grouping for clusters (in a similar way
4
+ that clusters provide a logical grouping of facets).
5
+
6
+ ## Scope
7
+
8
+ Following the Principle of Least Surprise, it would make sense that attributes declared in the realm scope,
9
+ apply to all clusters unless overridden. The same should go for roles, environment, cloud, and plugins.
10
+
11
+ ```ruby
12
+ Ironfan.realm(:foo) do
13
+ environment :dev
14
+
15
+ role :rick
16
+
17
+ cluster(:bar) do
18
+
19
+ role :over
20
+
21
+ facet(:baz) do
22
+ environment :prod
23
+ end
24
+
25
+ facet(:qix) do
26
+ role :out
27
+ end
28
+ end
29
+ end
30
+
31
+ baz_facet = Ironfan.realm(:foo).cluster(:bar).facet(:baz)
32
+ baz_facet.environment.should eq(:prod)
33
+ baz_facet.run_list.should include_roles(:rick, :over)
34
+
35
+ qix_facet = Ironfan.realm(:foo).cluster(:bar).facet(:qix)
36
+ qix_facet.environment.should eq(:dev)
37
+ qix_facet.run_list.should include_roles(:rick, :over, :out)
38
+ ```
39
+
40
+ You can also assign realms from within a cluster definition using the method `:realm_name`.
41
+ This value defaults to the environment.
42
+
43
+ ```ruby
44
+ Ironfan.cluster(:jib) do
45
+
46
+ environment :dev
47
+
48
+ realm_name :yo
49
+
50
+ end
51
+
52
+ Ironfan.cluster(:jab) do
53
+
54
+ environment :dev
55
+
56
+ end
57
+
58
+ jib_cluster = Ironfan.cluster(:jib)
59
+ jib_cluster.realm_name.should eq(:yo)
60
+
61
+ jab_cluster = Ironfan.cluster(:jab)
62
+ jab_cluster.realm_name.should eq(:dev)
63
+ ```
64
+
65
+ ## Security Groups
66
+
67
+ Currently, Ironfan creates default security groups for clusters and cluster-facets and authorizes clusters
68
+ to allow communication within itself. Because there may be cases where a particular cluster definition may
69
+ show up in more than one realm, this behavior will have to be extended to include the realm name as well.
70
+ Something that *wont'* be necessary is creating a realm only security group. This is partly because the need
71
+ to open access to entire realms *seems* unlikely, and partly because there is a VPC security group limitation
72
+ of five per machine.
73
+
74
+ ```
75
+ Ironfan.realm(:cybertron) do
76
+
77
+ cluster(:autobot) do
78
+ facet(:ratchet) do
79
+ instances 1
80
+ end
81
+
82
+ facet(:bumblebee) do
83
+ instances 1
84
+ end
85
+ end
86
+
87
+ cluster(:decepticon) do
88
+ facet(:shockwave) do
89
+ instances 1
90
+ end
91
+
92
+ facet(:starscream) do
93
+ instances 1
94
+ end
95
+ end
96
+ end
97
+
98
+ bumblebee_facet = Ironfan.realm(:cybertron).cluster(:autobot).facet(:bumblebee)
99
+ bumblebee_facet.security_groups should eq(%w[ systemwide cybertron-autobot cybertron-autobot-bumblebee ])
100
+
101
+ shockwave_facet = Ironfan.realm(:cybertron).cluster(:decepticon).facet(:shockwave)
102
+ starscream_facet = Ironfan.realm(:cybertron).cluster(:decepticon).facet(:starscream)
103
+
104
+ shockwave_facet.machine.should have_access_to(starscream_facet.machine)
105
+ shockwave_facet.machine.should_not have_access_to(bumblebee_facet.machine)
106
+ ```
107
+
108
+ ## Knife Commands
109
+
110
+ Because of the possibility of cluster names not being unique across realms, the cluster commands will now have to be scoped
111
+ by realm as well. This does have a nice side effect of allowing realms to be issued commands as a collective.
112
+
113
+ By making the knife command explicitly call out the realm, only that realm file will be loaded (again to mitigate
114
+ potential collisions in cluster definitions shared across realms), then all cluster files will be loaded.
115
+
116
+ ```bash
117
+ knife cluster show p1-control-vcd
118
+ +------------------+-------+---------+----------+------------+-------------+------------+-------------+--------------+------------+
119
+ | Name | Chef? | State | Flavor | AZ | Env | MachineID | Public IP | Private IP | Created On |
120
+ +------------------+-------+---------+----------+------------+-------------+------------+-------------+--------------+------------+
121
+ | p1-control-vcd-0 | yes | running | m1.large | us-east-1d | development | i-1ba48935 | 23.20.69.99 | 10.137.18.89 | 2014-02-26 |
122
+ +------------------+-------+---------+----------+------------+-------------+------------+-------------+--------------+------------+
123
+
124
+ knife cluster show p1-control
125
+ +------------------+-------+---------+----------+------------+-------------+------------+-------------+--------------+------------+
126
+ | Name | Chef? | State | Flavor | AZ | Env | MachineID | Public IP | Private IP | Created On |
127
+ +------------------+-------+---------+----------+------------+-------------+------------+-------------+--------------+------------+
128
+ | p1-control-vcd-0 | yes | running | m1.large | us-east-1d | development | i-1cd09387 | 69.14.23.44 | 10.114.10.12 | 2014-02-26 |
129
+ | p1-control-zbx-0 | yes | running | m1.large | us-east-1d | development | i-1ba48935 | 23.20.69.99 | 10.137.18.89 | 2014-02-26 |
130
+ +------------------+-------+---------+----------+------------+-------------+------------+-------------+--------------+------------+
131
+
132
+ knife cluster show p1
133
+ +------------------+-------+---------+----------+------------+-------------+------------+-------------+--------------+------------+
134
+ | Name | Chef? | State | Flavor | AZ | Env | MachineID | Public IP | Private IP | Created On |
135
+ +------------------+-------+---------+----------+------------+-------------+------------+-------------+--------------+------------+
136
+ | p1-kfk-broker-0 | yes | running | m1.large | us-east-1d | development | i-1io37214 | 52.31.45.9 | 10.88.54.36 | 2014-02-26 |
137
+ | p1-kfk-broker-0 | yes | running | m1.large | us-east-1d | development | i-1ws75110 | 56.90.76.10 | 10.121.27.64 | 2014-02-26 |
138
+ | p1-control-vcd-0 | yes | running | m1.large | us-east-1d | development | i-1cd09387 | 69.14.23.44 | 10.114.10.12 | 2014-02-26 |
139
+ | p1-control-zbx-0 | yes | running | m1.large | us-east-1d | development | i-1ba48935 | 23.20.69.99 | 10.137.18.89 | 2014-02-26 |
140
+ +------------------+-------+---------+----------+------------+-------------+------------+-------------+--------------+------------+
141
+ ```
142
+
143
+ ## Announce/Discovery
144
+
145
+ When announcing and discovering using silverware, realms will need to be properly taken into account.
146
+ Nothing much should change for announcements; you will still announce the system-subsystem pair and the realm
147
+ will be provided from the node itself. You will not be able to announce outside of your realm or cluster. Discovery remains
148
+ unchanged for the most part as well. Discover with system-subsystem pairs, and it will, by default look in your cluster first,
149
+ then in your realm. This behavior can be overridden with options.
150
+
151
+ ```ruby
152
+ node['new-phyrexia-sphere-0'].announce(:storm, :master)
153
+ # {
154
+ # announces: {
155
+ # storm: {
156
+ # master: {
157
+ # cluster: 'phyrexia',
158
+ # realm: 'new'
159
+ # }
160
+ # }
161
+ # }
162
+ # }
163
+
164
+ storm_master = node['new-benalia-clan-0'].discover(:storm, :master)
165
+ storm_master.name.should eq('new-phyrexia-sphere-0')
166
+
167
+ storm_master = node['alara-bant-sigil-0'].discover(:storm, :master)
168
+ storm_master.should be_nil
169
+
170
+ storm_master = node['alara-bant-sigil-0'].discover(:storm, :master, realm: 'new')
171
+ storm_master.name.should eq('new-phyrexia-sphere-0')
172
+ ```
data/Rakefile CHANGED
@@ -1,91 +1,33 @@
1
- #
2
- # Rakefile for Cluster Chef Knife plugins
3
- #
4
- # Author:: Adam Jacob (<adam@opscode.com>)
5
- # Copyright:: Copyright (c) 2008 Opscode, Inc.
6
- # License:: Apache License, Version 2.0
7
- #
8
- # Licensed under the Apache License, Version 2.0 (the "License");
9
- # you may not use this file except in compliance with the License.
10
- # You may obtain a copy of the License at
11
- #
12
- # http://www.apache.org/licenses/LICENSE-2.0
13
- #
14
- # Unless required by applicable law or agreed to in writing, software
15
- # distributed under the License is distributed on an "AS IS" BASIS,
16
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
- # See the License for the specific language governing permissions and
18
- # limitations under the License.
19
- #
1
+ require 'bundler/gem_tasks'
20
2
 
21
- require 'rubygems' unless defined?(Gem)
22
- require 'bundler'
23
- begin
24
- Bundler.setup(:default, :development, :support)
25
- rescue Bundler::BundlerError => e
26
- $stderr.puts e.message
27
- $stderr.puts "Run `bundle install` to install missing gems"
28
- exit e.status_code
29
- end
30
- require 'json'
31
- require 'jeweler'
32
3
  require 'rspec/core/rake_task'
33
- require 'yard'
34
-
35
- # Load constants from rake config file.
36
- $LOAD_PATH.unshift('tasks')
37
- Dir[File.join('tasks', '*.rake')].sort.each{|f| load(f) }
38
-
39
- # ---------------------------------------------------------------------------
40
- #
41
- # Jeweler -- release ironfan as a gem
42
- #
43
-
44
- Jeweler::Tasks.new do |gem|
45
- gem.name = 'ironfan'
46
- gem.homepage = "http://infochimps.com/labs"
47
- gem.license = NEW_COOKBOOK_LICENSE.to_s
48
- gem.summary = %Q{Infochimps' lightweight cloud orchestration toolkit, built on top of Chef.}
49
- gem.description = %Q{Ironfan allows you to orchestrate not just systems but clusters of machines. It includes a powerful layer on top of knife and a collection of cloud cookbooks.}
50
- gem.email = SSL_EMAIL_ADDRESS
51
- gem.authors = ["Infochimps"]
52
-
53
- ignores = File.readlines(".gitignore").grep(/^[^#]\S+/).map{|s| s.chomp }
54
- dotfiles = [".gemtest", ".gitignore", ".rspec", ".yardopts"]
55
- gem.files = dotfiles + Dir["**/*"].
56
- reject{|f| File.directory?(f) }.
57
- reject{|f| ignores.any?{|i| File.fnmatch(i, f) || File.fnmatch(i+'/*', f) || File.fnmatch(i+'/**/*', f) } }
58
- gem.test_files = gem.files.grep(/^spec\//)
59
- gem.require_paths = ['lib']
60
- end
61
- Jeweler::RubygemsDotOrgTasks.new
62
-
63
- # ---------------------------------------------------------------------------
64
- #
65
- # RSpec -- testing
66
- #
67
4
  RSpec::Core::RakeTask.new(:spec) do |spec|
68
5
  spec.pattern = 'spec/{ironfan,chef,ironfan/*}/*_spec.rb'
69
6
  end
70
7
 
71
- RSpec::Core::RakeTask.new(:rcov) do |spec|
72
- spec.pattern = 'spec/**/*_spec.rb'
73
- spec.rcov = true
74
- spec.rcov_opts = %w[ --exclude .rvm --no-comments --text-summary ]
8
+ desc 'Run RSpec code examples with SimpleCov'
9
+ task :coverage do
10
+ ENV['IRONFAN_COV'] = 'true'
11
+ Rake::Task[:spec].invoke
75
12
  end
76
13
 
14
+ desc 'Run RSpec integration code examples'
77
15
  RSpec::Core::RakeTask.new(:integration) do |spec|
78
16
  spec.pattern = 'spec/integration/**/*_spec.rb'
79
17
  end
80
18
 
81
- # ---------------------------------------------------------------------------
82
- #
83
- # Yard -- documentation
84
- #
85
- YARD::Rake::YardocTask.new
86
- desc "Alias for 'rake yard'"
87
- task :doc => :yard
19
+ require 'yard'
20
+ YARD::Rake::YardocTask.new do |t|
21
+ additional_docs = %w[ CHANGELOG.md LICENSE.md README.md notes/INSTALL.md
22
+ notes/core_concepts.md notes/knife-cluster-commands.md
23
+ notes/philosophy.md notes/silverware.md notes/style_guide.md
24
+ notes/tips_and_troubleshooting.md notes/walkthrough-hadoop.md
25
+ notes/homebase-layout.txt notes/*.md notes/*.txt ]
26
+ t.files = ['lib/**/*.rb', '-'] + additional_docs
27
+ t.options = ['--readme=README.md', '--markup=markdown', '--verbose']
28
+ end
88
29
 
89
- # ---------------------------------------------------------------------------
30
+ desc 'Generate YARD Documentation'
31
+ task doc: [:yard]
90
32
 
91
- task :default => :spec
33
+ task default: [:spec]
@@ -14,6 +14,13 @@ set -e
14
14
 
15
15
  <%= (@config[:verbosity].to_i > 1 ? 'set -v' : '') %>
16
16
 
17
+ echo "deb http://apt.opscode.com/ `lsb_release -cs`-0.10 main" | sudo tee /etc/apt/sources.list.d/opscode.list
18
+
19
+ # Make sure that opscode chef is on the apt repo list.
20
+ sudo mkdir -p /etc/apt/trusted.gpg.d
21
+ gpg --keyserver keys.gnupg.net --recv-keys 83EF826A
22
+ gpg --export packages@opscode.com | sudo tee /etc/apt/trusted.gpg.d/opscode-keyring.gpg > /dev/null
23
+
17
24
  date > /etc/box_build_time
18
25
 
19
26
  echo -e "`date` \n\n**** \n**** apt update:\n****\n"