corl 0.5.1 → 0.5.2

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 (241) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/Gemfile.lock +8 -6
  4. data/VERSION +1 -1
  5. data/bootstrap/os/ubuntu/00_base.sh +2 -2
  6. data/bootstrap/os/ubuntu/05_ruby.sh +14 -2
  7. data/corl.gemspec +175 -5
  8. data/lib/CORL/builder/identity.rb +1 -1
  9. data/lib/CORL/builder/package.rb +1 -1
  10. data/lib/CORL/configuration/file.rb +7 -13
  11. data/lib/CORL/machine/physical.rb +1 -1
  12. data/lib/CORL/machine/vagrant.rb +12 -4
  13. data/lib/CORL/network/CORL.rb +1 -1
  14. data/lib/CORL/node/AWS.rb +25 -23
  15. data/lib/CORL/node/local.rb +1 -1
  16. data/lib/CORL/node/rackspace.rb +13 -15
  17. data/lib/CORL/node/vagrant.rb +1 -1
  18. data/lib/CORL/provisioner/puppetnode.rb +1 -1
  19. data/lib/core/mixin/action/keypair.rb +6 -6
  20. data/lib/core/mixin/action/registration.rb +39 -11
  21. data/lib/core/mod/fog_aws_server.rb +1 -3
  22. data/lib/core/plugin/builder.rb +1 -1
  23. data/lib/core/plugin/cloud_action.rb +59 -49
  24. data/lib/core/plugin/configuration.rb +4 -3
  25. data/lib/core/plugin/fog_machine.rb +10 -2
  26. data/lib/core/plugin/fog_node.rb +10 -4
  27. data/lib/core/plugin/machine.rb +2 -8
  28. data/lib/core/plugin/network.rb +9 -3
  29. data/lib/core/plugin/node.rb +30 -31
  30. data/lib/core/plugin/provisioner.rb +1 -1
  31. data/lib/core/vagrant/Vagrantfile +4 -1
  32. data/lib/core/vagrant/plugins.rb +6 -4
  33. data/lib/corl.rb +1 -1
  34. data/lib/nucleon/action/cloud/config.rb +167 -100
  35. data/lib/nucleon/action/cloud/create.rb +5 -1
  36. data/lib/nucleon/action/cloud/images.rb +10 -7
  37. data/lib/nucleon/action/cloud/inspect.rb +8 -6
  38. data/lib/nucleon/action/cloud/machines.rb +10 -7
  39. data/lib/nucleon/action/cloud/regions.rb +13 -8
  40. data/lib/nucleon/action/cloud/remote.rb +68 -0
  41. data/lib/nucleon/action/cloud/settings.rb +33 -47
  42. data/lib/nucleon/action/cloud/vagrantfile.rb +34 -17
  43. data/lib/nucleon/action/node/IP.rb +2 -2
  44. data/lib/nucleon/action/node/SSH.rb +3 -3
  45. data/lib/nucleon/action/node/authorize.rb +2 -2
  46. data/lib/nucleon/action/node/bootstrap.rb +17 -30
  47. data/lib/nucleon/action/node/build.rb +4 -4
  48. data/lib/nucleon/action/node/cache.rb +2 -4
  49. data/lib/nucleon/action/node/destroy.rb +25 -26
  50. data/lib/nucleon/action/node/exec.rb +2 -2
  51. data/lib/nucleon/action/node/fact.rb +10 -5
  52. data/lib/nucleon/action/node/group.rb +10 -5
  53. data/lib/nucleon/action/node/identity.rb +6 -8
  54. data/lib/nucleon/action/node/image.rb +3 -3
  55. data/lib/nucleon/action/node/keypair.rb +2 -2
  56. data/lib/nucleon/action/node/lookup.rb +2 -4
  57. data/lib/nucleon/action/node/provision.rb +2 -2
  58. data/lib/nucleon/action/node/reboot.rb +3 -3
  59. data/lib/nucleon/action/node/revoke.rb +2 -2
  60. data/lib/nucleon/action/node/seed.rb +28 -43
  61. data/lib/nucleon/action/node/spawn.rb +19 -14
  62. data/lib/nucleon/action/node/start.rb +3 -3
  63. data/lib/nucleon/action/node/status.rb +8 -8
  64. data/lib/nucleon/action/node/stop.rb +3 -3
  65. data/lib/nucleon/action/plugin/create.rb +10 -13
  66. data/lib/nucleon/action/plugin/list.rb +7 -7
  67. data/lib/nucleon/action/plugin/template/nucleon.action.erb +2 -2
  68. data/lib/nucleon/action/plugins.rb +12 -1
  69. data/lib/nucleon/event/puppet.rb +1 -1
  70. data/lib/nucleon/extension/corl_config.rb +26 -0
  71. data/lib/nucleon/template/environment.rb +1 -1
  72. data/locales/en.yml +483 -90
  73. data/rdoc/site/0.5.1/CORL/Build.html +781 -0
  74. data/rdoc/site/0.5.1/CORL/Builder/Identity.html +596 -0
  75. data/rdoc/site/0.5.1/CORL/Builder/Package.html +600 -0
  76. data/rdoc/site/0.5.1/CORL/Builder.html +384 -0
  77. data/rdoc/site/0.5.1/CORL/Configuration/File.html +1186 -0
  78. data/rdoc/site/0.5.1/CORL/Configuration.html +383 -0
  79. data/rdoc/site/0.5.1/CORL/Errors.html +383 -0
  80. data/rdoc/site/0.5.1/CORL/Facade.html +927 -0
  81. data/rdoc/site/0.5.1/CORL/Machine/AWS.html +777 -0
  82. data/rdoc/site/0.5.1/CORL/Machine/Fog.html +1313 -0
  83. data/rdoc/site/0.5.1/CORL/Machine/Physical.html +1083 -0
  84. data/rdoc/site/0.5.1/CORL/Machine/Rackspace.html +558 -0
  85. data/rdoc/site/0.5.1/CORL/Machine/Vagrant.html +1344 -0
  86. data/rdoc/site/0.5.1/CORL/Machine.html +387 -0
  87. data/rdoc/site/0.5.1/CORL/Mixin/Action/Keypair.html +616 -0
  88. data/rdoc/site/0.5.1/CORL/Mixin/Action/Registration.html +469 -0
  89. data/rdoc/site/0.5.1/CORL/Mixin/Action.html +384 -0
  90. data/rdoc/site/0.5.1/CORL/Mixin/Builder/Global.html +628 -0
  91. data/rdoc/site/0.5.1/CORL/Mixin/Builder/Instance.html +720 -0
  92. data/rdoc/site/0.5.1/CORL/Mixin/Builder.html +383 -0
  93. data/rdoc/site/0.5.1/CORL/Mixin/Lookup.html +1315 -0
  94. data/rdoc/site/0.5.1/CORL/Mixin/Machine/SSH.html +699 -0
  95. data/rdoc/site/0.5.1/CORL/Mixin/Machine.html +383 -0
  96. data/rdoc/site/0.5.1/CORL/Mixin/Macro/NetworkSettings.html +508 -0
  97. data/rdoc/site/0.5.1/CORL/Mixin/Macro.html +383 -0
  98. data/rdoc/site/0.5.1/CORL/Mixin.html +388 -0
  99. data/rdoc/site/0.5.1/CORL/Network/CORL.html +435 -0
  100. data/rdoc/site/0.5.1/CORL/Network.html +383 -0
  101. data/rdoc/site/0.5.1/CORL/Node/AWS.html +760 -0
  102. data/rdoc/site/0.5.1/CORL/Node/Fog.html +1268 -0
  103. data/rdoc/site/0.5.1/CORL/Node/Local.html +468 -0
  104. data/rdoc/site/0.5.1/CORL/Node/Rackspace.html +753 -0
  105. data/rdoc/site/0.5.1/CORL/Node/Vagrant.html +1497 -0
  106. data/rdoc/site/0.5.1/CORL/Node.html +387 -0
  107. data/rdoc/site/0.5.1/CORL/Plugin/Builder.html +524 -0
  108. data/rdoc/site/0.5.1/CORL/Plugin/Configuration.html +1294 -0
  109. data/rdoc/site/0.5.1/CORL/Plugin/Machine.html +1323 -0
  110. data/rdoc/site/0.5.1/CORL/Plugin/Network.html +1766 -0
  111. data/rdoc/site/0.5.1/CORL/Plugin/Node.html +4263 -0
  112. data/rdoc/site/0.5.1/CORL/Plugin/Provisioner.html +1139 -0
  113. data/rdoc/site/0.5.1/CORL/Plugin.html +673 -0
  114. data/rdoc/site/0.5.1/CORL/Provisioner/Puppetnode.html +1201 -0
  115. data/rdoc/site/0.5.1/CORL/Provisioner.html +383 -0
  116. data/rdoc/site/0.5.1/CORL/Util/Puppet/Resource.html +1082 -0
  117. data/rdoc/site/0.5.1/CORL/Util/Puppet/ResourceGroup.html +964 -0
  118. data/rdoc/site/0.5.1/CORL/Util/Puppet.html +1131 -0
  119. data/rdoc/site/0.5.1/CORL/Util.html +385 -0
  120. data/rdoc/site/0.5.1/CORL/Vagrant/Config.html +967 -0
  121. data/rdoc/site/0.5.1/CORL/Vagrant.html +462 -0
  122. data/rdoc/site/0.5.1/CORL.html +496 -0
  123. data/rdoc/site/0.5.1/Fog/Compute/AWS/Server.html +467 -0
  124. data/rdoc/site/0.5.1/Fog/Compute/AWS.html +389 -0
  125. data/rdoc/site/0.5.1/Fog/Compute/RackspaceV2/Server.html +452 -0
  126. data/rdoc/site/0.5.1/Fog/Compute/RackspaceV2.html +389 -0
  127. data/rdoc/site/0.5.1/Fog/Compute.html +384 -0
  128. data/rdoc/site/0.5.1/Fog.html +384 -0
  129. data/rdoc/site/0.5.1/Hiera/Backend.html +466 -0
  130. data/rdoc/site/0.5.1/Hiera/Corl_logger.html +493 -0
  131. data/rdoc/site/0.5.1/Hiera.html +390 -0
  132. data/rdoc/site/0.5.1/Nucleon/Action/Cloud/Config.html +978 -0
  133. data/rdoc/site/0.5.1/Nucleon/Action/Cloud/Create.html +562 -0
  134. data/rdoc/site/0.5.1/Nucleon/Action/Cloud/Images.html +596 -0
  135. data/rdoc/site/0.5.1/Nucleon/Action/Cloud/Inspect.html +567 -0
  136. data/rdoc/site/0.5.1/Nucleon/Action/Cloud/Machines.html +591 -0
  137. data/rdoc/site/0.5.1/Nucleon/Action/Cloud/Regions.html +591 -0
  138. data/rdoc/site/0.5.1/Nucleon/Action/Cloud/Settings.html +878 -0
  139. data/rdoc/site/0.5.1/Nucleon/Action/Cloud/Vagrantfile.html +539 -0
  140. data/rdoc/site/0.5.1/Nucleon/Action/Cloud.html +390 -0
  141. data/rdoc/site/0.5.1/Nucleon/Action/Node/Authorize.html +567 -0
  142. data/rdoc/site/0.5.1/Nucleon/Action/Node/Bootstrap.html +628 -0
  143. data/rdoc/site/0.5.1/Nucleon/Action/Node/Build.html +550 -0
  144. data/rdoc/site/0.5.1/Nucleon/Action/Node/Cache.html +773 -0
  145. data/rdoc/site/0.5.1/Nucleon/Action/Node/Destroy.html +597 -0
  146. data/rdoc/site/0.5.1/Nucleon/Action/Node/Exec.html +554 -0
  147. data/rdoc/site/0.5.1/Nucleon/Action/Node/Fact.html +733 -0
  148. data/rdoc/site/0.5.1/Nucleon/Action/Node/Facts.html +505 -0
  149. data/rdoc/site/0.5.1/Nucleon/Action/Node/Group.html +729 -0
  150. data/rdoc/site/0.5.1/Nucleon/Action/Node/Groups.html +505 -0
  151. data/rdoc/site/0.5.1/Nucleon/Action/Node/IP.html +477 -0
  152. data/rdoc/site/0.5.1/Nucleon/Action/Node/Identity.html +614 -0
  153. data/rdoc/site/0.5.1/Nucleon/Action/Node/Image.html +597 -0
  154. data/rdoc/site/0.5.1/Nucleon/Action/Node/Keypair.html +596 -0
  155. data/rdoc/site/0.5.1/Nucleon/Action/Node/Lookup.html +579 -0
  156. data/rdoc/site/0.5.1/Nucleon/Action/Node/Provision.html +577 -0
  157. data/rdoc/site/0.5.1/Nucleon/Action/Node/Reboot.html +597 -0
  158. data/rdoc/site/0.5.1/Nucleon/Action/Node/Revoke.html +565 -0
  159. data/rdoc/site/0.5.1/Nucleon/Action/Node/SSH.html +607 -0
  160. data/rdoc/site/0.5.1/Nucleon/Action/Node/Seed.html +626 -0
  161. data/rdoc/site/0.5.1/Nucleon/Action/Node/Spawn.html +699 -0
  162. data/rdoc/site/0.5.1/Nucleon/Action/Node/Start.html +597 -0
  163. data/rdoc/site/0.5.1/Nucleon/Action/Node/Status.html +615 -0
  164. data/rdoc/site/0.5.1/Nucleon/Action/Node/Stop.html +597 -0
  165. data/rdoc/site/0.5.1/Nucleon/Action/Node.html +406 -0
  166. data/rdoc/site/0.5.1/Nucleon/Action/Plugin/Create.html +736 -0
  167. data/rdoc/site/0.5.1/Nucleon/Action/Plugin/List.html +570 -0
  168. data/rdoc/site/0.5.1/Nucleon/Action/Plugin.html +384 -0
  169. data/rdoc/site/0.5.1/Nucleon/Action/Plugins.html +435 -0
  170. data/rdoc/site/0.5.1/Nucleon/Action.html +417 -0
  171. data/rdoc/site/0.5.1/Nucleon/Config.html +401 -0
  172. data/rdoc/site/0.5.1/Nucleon/Event/Puppet.html +717 -0
  173. data/rdoc/site/0.5.1/Nucleon/Event.html +383 -0
  174. data/rdoc/site/0.5.1/Nucleon/Plugin/Base.html +389 -0
  175. data/rdoc/site/0.5.1/Nucleon/Plugin/CloudAction.html +894 -0
  176. data/rdoc/site/0.5.1/Nucleon/Plugin.html +384 -0
  177. data/rdoc/site/0.5.1/Nucleon/Template/Environment.html +572 -0
  178. data/rdoc/site/0.5.1/Nucleon/Template.html +383 -0
  179. data/rdoc/site/0.5.1/Nucleon.html +421 -0
  180. data/rdoc/site/0.5.1/Object.html +402 -0
  181. data/rdoc/site/0.5.1/Puppet/DataBinding/Corl.html +389 -0
  182. data/rdoc/site/0.5.1/Puppet/DataBinding.html +382 -0
  183. data/rdoc/site/0.5.1/Puppet/Indirector/Corl.html +501 -0
  184. data/rdoc/site/0.5.1/Puppet/Indirector.html +382 -0
  185. data/rdoc/site/0.5.1/Puppet/Parser/Functions.html +524 -0
  186. data/rdoc/site/0.5.1/Puppet/Parser.html +382 -0
  187. data/rdoc/site/0.5.1/Puppet.html +382 -0
  188. data/rdoc/site/0.5.1/README_rdoc.html +384 -0
  189. data/rdoc/site/0.5.1/Vagrant/Config/Loader.html +443 -0
  190. data/rdoc/site/0.5.1/Vagrant/Config.html +383 -0
  191. data/rdoc/site/0.5.1/Vagrant/Vagrantfile.html +436 -0
  192. data/rdoc/site/0.5.1/Vagrant.html +390 -0
  193. data/rdoc/site/0.5.1/VagrantPlugins/CORL/Action/DeleteCache.html +446 -0
  194. data/rdoc/site/0.5.1/VagrantPlugins/CORL/Action/InitKeys.html +452 -0
  195. data/rdoc/site/0.5.1/VagrantPlugins/CORL/Action/LinkNetwork.html +450 -0
  196. data/rdoc/site/0.5.1/VagrantPlugins/CORL/Action.html +385 -0
  197. data/rdoc/site/0.5.1/VagrantPlugins/CORL/BaseAction.html +535 -0
  198. data/rdoc/site/0.5.1/VagrantPlugins/CORL/Command/Launcher.html +577 -0
  199. data/rdoc/site/0.5.1/VagrantPlugins/CORL/Command.html +383 -0
  200. data/rdoc/site/0.5.1/VagrantPlugins/CORL/Config/CORL.html +776 -0
  201. data/rdoc/site/0.5.1/VagrantPlugins/CORL/Config.html +383 -0
  202. data/rdoc/site/0.5.1/VagrantPlugins/CORL/Plugin.html +389 -0
  203. data/rdoc/site/0.5.1/VagrantPlugins/CORL/Provisioner/CORL.html +580 -0
  204. data/rdoc/site/0.5.1/VagrantPlugins/CORL/Provisioner.html +383 -0
  205. data/rdoc/site/0.5.1/VagrantPlugins/CORL.html +390 -0
  206. data/rdoc/site/0.5.1/VagrantPlugins.html +390 -0
  207. data/rdoc/site/0.5.1/created.rid +114 -0
  208. data/rdoc/site/0.5.1/images/add.png +0 -0
  209. data/rdoc/site/0.5.1/images/brick.png +0 -0
  210. data/rdoc/site/0.5.1/images/brick_link.png +0 -0
  211. data/rdoc/site/0.5.1/images/bug.png +0 -0
  212. data/rdoc/site/0.5.1/images/bullet_black.png +0 -0
  213. data/rdoc/site/0.5.1/images/bullet_toggle_minus.png +0 -0
  214. data/rdoc/site/0.5.1/images/bullet_toggle_plus.png +0 -0
  215. data/rdoc/site/0.5.1/images/date.png +0 -0
  216. data/rdoc/site/0.5.1/images/delete.png +0 -0
  217. data/rdoc/site/0.5.1/images/find.png +0 -0
  218. data/rdoc/site/0.5.1/images/loadingAnimation.gif +0 -0
  219. data/rdoc/site/0.5.1/images/macFFBgHack.png +0 -0
  220. data/rdoc/site/0.5.1/images/package.png +0 -0
  221. data/rdoc/site/0.5.1/images/page_green.png +0 -0
  222. data/rdoc/site/0.5.1/images/page_white_text.png +0 -0
  223. data/rdoc/site/0.5.1/images/page_white_width.png +0 -0
  224. data/rdoc/site/0.5.1/images/plugin.png +0 -0
  225. data/rdoc/site/0.5.1/images/ruby.png +0 -0
  226. data/rdoc/site/0.5.1/images/tag_blue.png +0 -0
  227. data/rdoc/site/0.5.1/images/tag_green.png +0 -0
  228. data/rdoc/site/0.5.1/images/transparent.png +0 -0
  229. data/rdoc/site/0.5.1/images/wrench.png +0 -0
  230. data/rdoc/site/0.5.1/images/wrench_orange.png +0 -0
  231. data/rdoc/site/0.5.1/images/zoom.png +0 -0
  232. data/rdoc/site/0.5.1/index.html +383 -0
  233. data/rdoc/site/0.5.1/js/darkfish.js +155 -0
  234. data/rdoc/site/0.5.1/js/jquery.js +18 -0
  235. data/rdoc/site/0.5.1/js/navigation.js +142 -0
  236. data/rdoc/site/0.5.1/js/search.js +94 -0
  237. data/rdoc/site/0.5.1/js/search_index.js +1 -0
  238. data/rdoc/site/0.5.1/js/searcher.js +228 -0
  239. data/rdoc/site/0.5.1/rdoc.css +543 -0
  240. data/rdoc/site/0.5.1/table_of_contents.html +2005 -0
  241. metadata +174 -4
@@ -2,7 +2,7 @@
2
2
  module Nucleon
3
3
  module Action
4
4
  module Node
5
- class Keypair < CORL.plugin_class(:nucleon, :cloud_action)
5
+ class Keypair < Nucleon.plugin_class(:nucleon, :cloud_action)
6
6
 
7
7
  include Mixin::Action::Keypair
8
8
 
@@ -36,7 +36,7 @@ class Keypair < CORL.plugin_class(:nucleon, :cloud_action)
36
36
  # Operations
37
37
 
38
38
  def execute
39
- super do |node, network|
39
+ super do |node|
40
40
  if keys = keypair
41
41
  ui.info("\n", { :prefix => false })
42
42
  ui_group(Util::Console.cyan("#{keys.type.upcase} SSH keypair")) do |ui|
@@ -2,9 +2,7 @@
2
2
  module Nucleon
3
3
  module Action
4
4
  module Node
5
- class Lookup < CORL.plugin_class(:nucleon, :cloud_action)
6
-
7
- include Mixin::Action::Registration
5
+ class Lookup < Nucleon.plugin_class(:nucleon, :cloud_action)
8
6
 
9
7
  #-----------------------------------------------------------------------------
10
8
  # Info
@@ -43,7 +41,7 @@ class Lookup < CORL.plugin_class(:nucleon, :cloud_action)
43
41
  # Operations
44
42
 
45
43
  def execute
46
- super do |node, network|
44
+ super do |node|
47
45
  ensure_node(node) do
48
46
  translator = CORL.translator({}, settings[:format])
49
47
 
@@ -2,7 +2,7 @@
2
2
  module Nucleon
3
3
  module Action
4
4
  module Node
5
- class Provision < CORL.plugin_class(:nucleon, :cloud_action)
5
+ class Provision < Nucleon.plugin_class(:nucleon, :cloud_action)
6
6
 
7
7
  #-----------------------------------------------------------------------------
8
8
  # Info
@@ -33,7 +33,7 @@ class Provision < CORL.plugin_class(:nucleon, :cloud_action)
33
33
  # Operations
34
34
 
35
35
  def execute
36
- super do |node, network|
36
+ super do |node|
37
37
  info('corl.actions.provision.start')
38
38
 
39
39
  ensure_node(node) do
@@ -2,7 +2,7 @@
2
2
  module Nucleon
3
3
  module Action
4
4
  module Node
5
- class Reboot < CORL.plugin_class(:nucleon, :cloud_action)
5
+ class Reboot < Nucleon.plugin_class(:nucleon, :cloud_action)
6
6
 
7
7
  #-----------------------------------------------------------------------------
8
8
  # Info
@@ -52,8 +52,8 @@ class Reboot < CORL.plugin_class(:nucleon, :cloud_action)
52
52
  # Operations
53
53
 
54
54
  def execute
55
- super do |local_node, network|
56
- ensure_network(network) do
55
+ super do |local_node|
56
+ ensure_network do
57
57
  batch_success = network.batch(settings[:reboot_nodes], settings[:node_provider], settings[:parallel]) do |node|
58
58
  info('corl.actions.reboot.start', { :provider => node.plugin_provider, :name => node.plugin_name })
59
59
  node.reload
@@ -2,7 +2,7 @@
2
2
  module Nucleon
3
3
  module Action
4
4
  module Node
5
- class Revoke < CORL.plugin_class(:nucleon, :cloud_action)
5
+ class Revoke < Nucleon.plugin_class(:nucleon, :cloud_action)
6
6
 
7
7
  #-----------------------------------------------------------------------------
8
8
  # Info
@@ -32,7 +32,7 @@ class Revoke < CORL.plugin_class(:nucleon, :cloud_action)
32
32
  # Operations
33
33
 
34
34
  def execute
35
- super do |node, network|
35
+ super do |node|
36
36
  info('corl.actions.revoke.start')
37
37
 
38
38
  ensure_node(node) do
@@ -2,7 +2,7 @@
2
2
  module Nucleon
3
3
  module Action
4
4
  module Node
5
- class Seed < CORL.plugin_class(:nucleon, :cloud_action)
5
+ class Seed < Nucleon.plugin_class(:nucleon, :cloud_action)
6
6
 
7
7
  #-----------------------------------------------------------------------------
8
8
  # Info
@@ -10,7 +10,7 @@ class Seed < CORL.plugin_class(:nucleon, :cloud_action)
10
10
  def self.describe
11
11
  super(:node, :seed, 625)
12
12
  end
13
-
13
+
14
14
  #-----------------------------------------------------------------------------
15
15
  # Settings
16
16
 
@@ -18,31 +18,13 @@ class Seed < CORL.plugin_class(:nucleon, :cloud_action)
18
18
  super do
19
19
  codes :key_store_failure,
20
20
  :project_failure,
21
- :network_init_failure,
22
21
  :network_load_failure,
23
22
  :node_load_failure,
24
23
  :node_save_failure
25
24
  #---
26
25
 
27
- register :project_branch, :str, 'master'
28
- register :project_reference, :str, nil do |value|
29
- next true if value.nil?
30
-
31
- value = value.to_sym
32
- project_plugins = CORL.loaded_plugins(:nucleon, :project)
33
-
34
- if @project_info = CORL.plugin_class(:nucleon, :project).translate_reference(value, true)
35
- provider = @project_info[:provider]
36
- else
37
- provider = value
38
- end
39
-
40
- unless project_plugins.keys.include?(provider.to_sym)
41
- warn('corl.actions.seed.errors.project_reference', { :value => value, :provider => provider, :choices => project_plugins.keys.join(', ') })
42
- next false
43
- end
44
- true
45
- end
26
+ register_project :project_reference
27
+ register_str :project_branch, 'master'
46
28
  end
47
29
  end
48
30
 
@@ -56,28 +38,32 @@ class Seed < CORL.plugin_class(:nucleon, :cloud_action)
56
38
  # Operations
57
39
 
58
40
  def execute
59
- super do |node, network|
60
- info('corl.actions.seed.start')
41
+ super do |node|
42
+ info('start')
61
43
 
62
44
  ensure_node(node) do
63
45
  admin_exec do
64
46
  network_path = lookup(:corl_network)
65
47
  backup_path = File.join(Dir.tmpdir(), 'corl')
66
48
 
67
- info("Generating network SSH deploy keys", { :i18n => false })
49
+ info('deploy_keys')
50
+
51
+ project_class = CORL.plugin_class(:nucleon, :project)
68
52
 
69
53
  if keys = Util::SSH.generate.store
70
- if @project_info
54
+ if @project_info = project_class.translate_reference(settings[:project_reference], true)
71
55
  project_info = Config.new(@project_info)
72
56
  else
73
57
  project_info = Config.new({ :provider => :git })
74
58
  end
75
59
 
76
- info("Backing up current network configuration", { :i18n => false })
60
+ project_class.clear_provider(network_path)
61
+
62
+ info('backup')
77
63
  FileUtils.rm_rf(backup_path)
78
64
  FileUtils.mv(network_path, backup_path)
79
65
 
80
- info("Seeding network configuration from #{settings[:project_reference]}", { :i18n => false })
66
+ info('seeding')
81
67
  project = CORL.project(extended_config(:project, {
82
68
  :directory => network_path,
83
69
  :reference => project_info.get(:reference, nil),
@@ -86,28 +72,27 @@ class Seed < CORL.plugin_class(:nucleon, :cloud_action)
86
72
  :create => true,
87
73
  :pull => true,
88
74
  :keys => keys,
89
- :internal_ip => CORL.public_ip # Needed for seeding Vagrant VMs
75
+ :internal_ip => CORL.public_ip, # Needed for seeding Vagrant VMs,
76
+ :new => true
90
77
  }), project_info[:provider])
91
-
78
+
92
79
  if project
93
- info("Finalizing network path and removing temporary backup", { :i18n => false })
80
+ info('finalizing')
94
81
  FileUtils.chmod_R(0600, network_path)
95
82
  FileUtils.rm_rf(backup_path)
96
83
 
97
- info("Reinitializing network", { :i18n => false })
98
- if network = init_network
99
- if network.load
100
- if node = network.local_node(true)
101
- info("Updating node network configurations", { :i18n => false })
102
- myself.status = code.node_save_failure unless node.save
103
- else
104
- myself.status = code.node_load_failure
105
- end
84
+ info('reinitializing')
85
+ init_network
86
+
87
+ if network.load
88
+ if node = network.local_node(true)
89
+ info('updating')
90
+ myself.status = code.node_save_failure unless node.save
106
91
  else
107
- myself.status = code.network_load_failure
108
- end
92
+ myself.status = code.node_load_failure
93
+ end
109
94
  else
110
- myself.status = code.network_init_failure
95
+ myself.status = code.network_load_failure
111
96
  end
112
97
  else
113
98
  myself.status = code.project_failure
@@ -2,7 +2,7 @@
2
2
  module Nucleon
3
3
  module Action
4
4
  module Node
5
- class Spawn < CORL.plugin_class(:nucleon, :cloud_action)
5
+ class Spawn < Nucleon.plugin_class(:nucleon, :cloud_action)
6
6
 
7
7
  include Mixin::Action::Keypair
8
8
 
@@ -21,17 +21,17 @@ class Spawn < CORL.plugin_class(:nucleon, :cloud_action)
21
21
  codes :key_failure,
22
22
  :node_create_failure
23
23
 
24
- register :bootstrap, :bool, true
25
- register :seed, :bool, true
26
- register :provision, :bool, true
24
+ register_bool :bootstrap, true
25
+ register_bool :provision, false
27
26
 
28
- register :groups, :array, []
29
- register :region, :str, nil
30
- register :machine_type, :str, nil
31
- register :image, :str, nil
32
- register :user, :str, nil
33
- register :hostnames, :array, nil
34
-
27
+ register_array :hostnames, nil
28
+ register_array :groups
29
+
30
+ register_str :region, nil
31
+ register_str :machine_type, nil
32
+ register_str :image, nil
33
+ register_str :user, nil
34
+
35
35
  keypair_config
36
36
 
37
37
  config.defaults(CORL.action_config(:node_bootstrap))
@@ -39,6 +39,11 @@ class Spawn < CORL.plugin_class(:nucleon, :cloud_action)
39
39
  end
40
40
  end
41
41
 
42
+ def node_config
43
+ super
44
+ config[:node_provider].default = nil
45
+ end
46
+
42
47
  #---
43
48
 
44
49
  def ignore
@@ -53,8 +58,8 @@ class Spawn < CORL.plugin_class(:nucleon, :cloud_action)
53
58
  # Operations
54
59
 
55
60
  def execute
56
- super do |node, network|
57
- ensure_network(network) do
61
+ super do |node|
62
+ ensure_network do
58
63
  if keypair && keypair_clean
59
64
  hostnames = []
60
65
  results = []
@@ -70,7 +75,7 @@ class Spawn < CORL.plugin_class(:nucleon, :cloud_action)
70
75
  settings[:user] = :root
71
76
  end
72
77
 
73
- info('corl.actions.spawn.start', { :node_provider => node_provider })
78
+ info('start', { :node_provider => node_provider })
74
79
 
75
80
  settings.delete(:hostnames).each do |hostname|
76
81
  hostnames << extract_hostnames(hostname)
@@ -2,7 +2,7 @@
2
2
  module Nucleon
3
3
  module Action
4
4
  module Node
5
- class Start < CORL.plugin_class(:nucleon, :cloud_action)
5
+ class Start < Nucleon.plugin_class(:nucleon, :cloud_action)
6
6
 
7
7
  #-----------------------------------------------------------------------------
8
8
  # Info
@@ -52,8 +52,8 @@ class Start < CORL.plugin_class(:nucleon, :cloud_action)
52
52
  # Operations
53
53
 
54
54
  def execute
55
- super do |local_node, network|
56
- ensure_network(network) do
55
+ super do |local_node|
56
+ ensure_network do
57
57
  batch_success = network.batch(settings[:start_nodes], settings[:node_provider], settings[:parallel]) do |node|
58
58
  info('corl.actions.start.start', { :provider => node.plugin_provider, :name => node.plugin_name })
59
59
  node.start
@@ -2,9 +2,7 @@
2
2
  module Nucleon
3
3
  module Action
4
4
  module Node
5
- class Status < CORL.plugin_class(:nucleon, :cloud_action)
6
-
7
- include Mixin::Action::Registration
5
+ class Status < Nucleon.plugin_class(:nucleon, :cloud_action)
8
6
 
9
7
  #-----------------------------------------------------------------------------
10
8
  # Info
@@ -38,12 +36,13 @@ class Status < CORL.plugin_class(:nucleon, :cloud_action)
38
36
  # Operations
39
37
 
40
38
  def execute
41
- super do |local_node, network|
42
- ensure_network(network) do
39
+ super do |local_node|
40
+ ensure_network do
43
41
  settings[:status_nodes] = [ 'all' ] if settings[:status_nodes].empty?
44
42
 
45
43
  batch_success = network.batch(settings[:status_nodes], settings[:node_provider], settings[:parallel]) do |node|
46
- state = node.state(true).to_sym
44
+ state = node.state(true)
45
+ state = state.nil? ? :aborted : state.to_sym
47
46
  ssh_enabled = ''
48
47
 
49
48
  case state
@@ -63,10 +62,11 @@ class Status < CORL.plugin_class(:nucleon, :cloud_action)
63
62
  when :stopped, :aborted
64
63
  state = red(state.to_s)
65
64
  end
66
- info(state + " #{ssh_enabled}".rstrip, { :i18n => false, :prefix_text => yellow(node.plugin_provider) + ' ' + purple(node.plugin_name) })
65
+ info(state.to_s + " #{ssh_enabled}".rstrip, { :i18n => false, :prefix_text => yellow(node.plugin_provider) + ' ' + purple(node.plugin_name) })
67
66
  true
68
67
  end
69
- myself.status = code.batch_error unless batch_success
68
+ success = network.save({ :push => true, :remote => :edit, :message => "Updating node status information.", :allow_empty => true })
69
+ myself.status = code.batch_error unless batch_success && success
70
70
  end
71
71
  end
72
72
  end
@@ -2,7 +2,7 @@
2
2
  module Nucleon
3
3
  module Action
4
4
  module Node
5
- class Stop < CORL.plugin_class(:nucleon, :cloud_action)
5
+ class Stop < Nucleon.plugin_class(:nucleon, :cloud_action)
6
6
 
7
7
  #-----------------------------------------------------------------------------
8
8
  # Info
@@ -52,8 +52,8 @@ class Stop < CORL.plugin_class(:nucleon, :cloud_action)
52
52
  # Operations
53
53
 
54
54
  def execute
55
- super do |local_node, network|
56
- ensure_network(network) do
55
+ super do |local_node|
56
+ ensure_network do
57
57
  batch_success = network.batch(settings[:stop_nodes], settings[:node_provider], settings[:parallel]) do |node|
58
58
  info('corl.actions.stop.start', { :provider => node.plugin_provider, :name => node.plugin_name })
59
59
  node.stop
@@ -2,15 +2,12 @@
2
2
  module Nucleon
3
3
  module Action
4
4
  module Plugin
5
- class Create < CORL.plugin_class(:nucleon, :cloud_action)
6
-
7
- include Mixin::Action::Registration
5
+ class Create < Nucleon.plugin_class(:nucleon, :cloud_action)
8
6
 
9
7
  #-----------------------------------------------------------------------------
10
8
  # Info
11
9
 
12
10
  def self.describe
13
- Nucleon.dump_enabled = true
14
11
  super(:plugin, :create, 10)
15
12
  end
16
13
 
@@ -51,7 +48,7 @@ class Create < CORL.plugin_class(:nucleon, :cloud_action)
51
48
  register_array :name, nil
52
49
 
53
50
  register_bool :save
54
- register_bool :interpolate
51
+ register_bool :interpolate, true
55
52
 
56
53
  register_directory :template_path
57
54
  end
@@ -71,8 +68,8 @@ class Create < CORL.plugin_class(:nucleon, :cloud_action)
71
68
  # Operations
72
69
 
73
70
  def execute
74
- super do |node, network|
75
- ensure_network(network) do
71
+ super do |node|
72
+ ensure_network do
76
73
  require 'erubis'
77
74
 
78
75
  type = settings[:type].to_sym
@@ -95,7 +92,7 @@ class Create < CORL.plugin_class(:nucleon, :cloud_action)
95
92
  template_contents = Util::Disk.read(template)
96
93
 
97
94
  unless template_contents
98
- error("Template file #{template} for #{@plugin_namespace}.#{@plugin_type} could not be parsed", { :i18n => false })
95
+ error('parse_failed', { :file => template })
99
96
  myself.status = code.template_file_parse_failed
100
97
  next
101
98
  end
@@ -103,7 +100,7 @@ class Create < CORL.plugin_class(:nucleon, :cloud_action)
103
100
  end
104
101
 
105
102
  unless template
106
- error("No template file exists for #{template_path}#{File::SEPARATOR}#{@plugin_namespace}.#{@plugin_type}.erb", { :i18n => false })
103
+ error('no_template', { :file => "#{template_path}#{File::SEPARATOR}#{@plugin_namespace}.#{@plugin_type}.erb" })
107
104
  myself.status = code.no_template_file
108
105
  next
109
106
  end
@@ -113,7 +110,7 @@ class Create < CORL.plugin_class(:nucleon, :cloud_action)
113
110
  plugin_file = nil
114
111
 
115
112
  if File.exists?(save_file)
116
- error("Plugin already exists at #{save_file}", { :i18n => false })
113
+ error('provider_exists', { :file => save_file })
117
114
  myself.status = code.plugin_already_exists
118
115
  next
119
116
  end
@@ -146,13 +143,13 @@ class Create < CORL.plugin_class(:nucleon, :cloud_action)
146
143
  FileUtils.mkdir_p(save_directory)
147
144
 
148
145
  if Util::Disk.write(save_file, plugin_file)
149
- success("Plugin successfully saved to #{save_file}", { :i18n => false })
146
+ success('saved', { :file => save_file })
150
147
  else
151
- error("Plugin can not be saved to #{save_file}", { :i18n => false })
148
+ error('save_failed', { :file => save_file })
152
149
  myself.status = code.plugin_save_failed
153
150
  end
154
151
  else
155
- info("Plugin: #{blue(save_file)}", { :i18n => false })
152
+ info('plugin_file', { :file => blue(save_file) })
156
153
  # Render template ONLY (testing)
157
154
  if settings.delete(:interpolate)
158
155
  puts green(plugin_file)
@@ -2,7 +2,7 @@
2
2
  module Nucleon
3
3
  module Action
4
4
  module Plugin
5
- class List < CORL.plugin_class(:nucleon, :cloud_action)
5
+ class List < Nucleon.plugin_class(:nucleon, :cloud_action)
6
6
 
7
7
  #-----------------------------------------------------------------------------
8
8
  # Info
@@ -30,22 +30,22 @@ class List < CORL.plugin_class(:nucleon, :cloud_action)
30
30
  # Operations
31
31
 
32
32
  def execute
33
- super do |node, network|
34
- ensure_network(network) do
33
+ super do |node|
34
+ ensure_network do
35
35
  last_namespace = nil
36
36
  last_plugin_type = nil
37
37
 
38
38
  Nucleon.loaded_plugins.each do |namespace, plugins|
39
- info("------------------------------------------------------", { :i18n => false, :prefix => false })
40
- info(" Namespace: #{purple(namespace)}", { :i18n => false, :prefix => false })
39
+ info('------------------------------------------------------', { :i18n => false, :prefix => false })
40
+ prefixed_message(:info, ' ', 'namespace', { :namespace => purple(namespace), :prefix => false })
41
41
  info("\n", { :i18n => false, :prefix => false })
42
42
 
43
43
  provider_info = {}
44
44
  max_width = 10
45
45
 
46
46
  plugins.each do |type, providers|
47
- info(" Plugin type: #{blue(type)}", { :i18n => false, :prefix => false })
48
- info(" Providers:", { :i18n => false, :prefix => false })
47
+ prefixed_message(:info, ' ', 'plugin_type', { :type => blue(type), :prefix => false })
48
+ prefixed_message(:info, ' ', 'providers', { :prefix => false })
49
49
 
50
50
  providers.keys.each do |name|
51
51
  width = name.to_s.size
@@ -36,13 +36,13 @@ class <%= Nucleon.class_name(plugin_class) -%> < CORL.plugin_class(:nucleon, :cl
36
36
  # Operations
37
37
 
38
38
  def execute
39
- super do |node, network|
39
+ super do |node|
40
40
  <% if node_context -%>
41
41
  ensure_node(node) do
42
42
 
43
43
  end
44
44
  <% else -%>
45
- ensure_network(network) do
45
+ ensure_network do
46
46
 
47
47
  end
48
48
  <% end -%>
@@ -1,4 +1,8 @@
1
1
 
2
+ nucleon_require(File.join(File.dirname(__FILE__), 'plugin'), :list)
3
+
4
+ #---
5
+
2
6
  module Nucleon
3
7
  module Action
4
8
  class Plugins < Plugin::List
@@ -7,7 +11,14 @@ class Plugins < Plugin::List
7
11
  # Info
8
12
 
9
13
  def self.describe
10
- describe_base(nil, :plugins, 1)
14
+ describe_base(nil, :plugins, 1, nil, nil, :plugin_list)
15
+ end
16
+
17
+ #-----------------------------------------------------------------------------
18
+ # Output
19
+
20
+ def render_provider
21
+ :plugin_list
11
22
  end
12
23
  end
13
24
  end
@@ -1,7 +1,7 @@
1
1
 
2
2
  module Nucleon
3
3
  module Event
4
- class Puppet < CORL.plugin_class(:nucleon, :event)
4
+ class Puppet < Nucleon.plugin_class(:nucleon, :event)
5
5
 
6
6
  #-----------------------------------------------------------------------------
7
7
  # Puppet event interface
@@ -0,0 +1,26 @@
1
+
2
+ module Nucleon
3
+ module Extension
4
+ class CorlConfig < Nucleon.plugin_class(:nucleon, :extension)
5
+
6
+ def configuration_file_base(config)
7
+ plugin = config[:plugin]
8
+ file_bases = [ :build, :vagrant]
9
+ translators = Nucleon.loaded_plugins(:nucleon, :translator).keys
10
+
11
+ Dir.glob(File.join(plugin.directory, '*.*')).each do |file|
12
+ file_ext = File.extname(file)
13
+
14
+ if translators.include?(file_ext.sub('.', '').to_sym)
15
+ file_base = File.basename(file).gsub(/#{file_ext}$/, '').to_sym
16
+
17
+ unless file_base == :corl || file_bases.include?(file_base)
18
+ file_bases << file_base
19
+ end
20
+ end
21
+ end
22
+ file_bases
23
+ end
24
+ end
25
+ end
26
+ end
@@ -1,7 +1,7 @@
1
1
 
2
2
  module Nucleon
3
3
  module Template
4
- class Environment < CORL.plugin_class(:nucleon, :template)
4
+ class Environment < Nucleon.plugin_class(:nucleon, :template)
5
5
 
6
6
  #-----------------------------------------------------------------------------
7
7
  # Renderers