corl 0.4.29 → 0.5.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 (230) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +3 -3
  3. data/Gemfile.lock +16 -13
  4. data/VERSION +1 -1
  5. data/bin/corl +21 -1
  6. data/bootstrap/os/ubuntu/00_base.sh +2 -2
  7. data/bootstrap/os/ubuntu/06_puppet.sh +7 -12
  8. data/bootstrap/os/ubuntu/09_nucleon.sh +1 -1
  9. data/bootstrap/os/ubuntu/10_corl.sh +1 -4
  10. data/corl.gemspec +193 -40
  11. data/lib/CORL/builder/identity.rb +68 -0
  12. data/lib/CORL/builder/package.rb +75 -0
  13. data/lib/CORL/configuration/file.rb +5 -5
  14. data/lib/CORL/machine/{aws.rb → AWS.rb} +2 -2
  15. data/lib/CORL/machine/physical.rb +1 -1
  16. data/lib/CORL/machine/rackspace.rb +1 -1
  17. data/lib/CORL/machine/vagrant.rb +2 -2
  18. data/lib/CORL/network/{default.rb → CORL.rb} +1 -1
  19. data/lib/CORL/node/{aws.rb → AWS.rb} +1 -1
  20. data/lib/CORL/node/local.rb +1 -1
  21. data/lib/CORL/node/vagrant.rb +7 -2
  22. data/lib/CORL/provisioner/puppetnode.rb +139 -131
  23. data/lib/core/build.rb +112 -0
  24. data/lib/core/facade.rb +48 -8
  25. data/lib/core/mixin/builder.rb +158 -0
  26. data/lib/core/mixin/lookup.rb +51 -20
  27. data/lib/core/mixin/machine/ssh.rb +16 -4
  28. data/lib/core/plugin/builder.rb +49 -0
  29. data/lib/core/plugin/{action.rb → cloud_action.rb} +22 -16
  30. data/lib/core/plugin/configuration.rb +9 -3
  31. data/lib/core/plugin/fog_machine.rb +3 -3
  32. data/lib/core/plugin/fog_node.rb +1 -1
  33. data/lib/core/plugin/machine.rb +2 -2
  34. data/lib/core/plugin/network.rb +39 -10
  35. data/lib/core/plugin/node.rb +95 -35
  36. data/lib/core/plugin/provisioner.rb +133 -113
  37. data/lib/core/util/puppet/resource.rb +1 -1
  38. data/lib/core/vagrant/actions/delete_cache.rb +7 -1
  39. data/lib/core/vagrant/commands/launcher.rb +2 -2
  40. data/lib/core/vagrant/config.rb +29 -2
  41. data/lib/corl.rb +9 -8
  42. data/lib/facter/corl_config_ready.rb +1 -1
  43. data/lib/facter/vagrant_exists.rb +1 -1
  44. data/lib/nucleon/action/cloud/create.rb +51 -0
  45. data/lib/nucleon/action/cloud/hiera.rb +61 -0
  46. data/lib/{CORL/action → nucleon/action/cloud}/images.rb +11 -2
  47. data/lib/nucleon/action/cloud/inspect.rb +47 -0
  48. data/lib/{CORL/action → nucleon/action/cloud}/machines.rb +11 -2
  49. data/lib/{CORL/action → nucleon/action/cloud}/regions.rb +11 -2
  50. data/lib/{CORL/action → nucleon/action/cloud}/vagrantfile.rb +11 -2
  51. data/lib/{CORL/action/ip.rb → nucleon/action/node/IP.rb} +11 -2
  52. data/lib/{CORL/action/ssh.rb → nucleon/action/node/SSH.rb} +15 -7
  53. data/lib/{CORL/action → nucleon/action/node}/authorize.rb +11 -2
  54. data/lib/{CORL/action → nucleon/action/node}/bootstrap.rb +13 -4
  55. data/lib/nucleon/action/node/build.rb +49 -0
  56. data/lib/{CORL/action → nucleon/action/node}/destroy.rb +14 -5
  57. data/lib/{CORL/action → nucleon/action/node}/exec.rb +11 -2
  58. data/lib/{CORL/action → nucleon/action/node}/facts.rb +12 -3
  59. data/lib/{CORL/action → nucleon/action/node}/image.rb +13 -4
  60. data/lib/nucleon/action/node/keypair.rb +85 -0
  61. data/lib/{CORL/action → nucleon/action/node}/lookup.rb +13 -4
  62. data/lib/{CORL/action → nucleon/action/node}/provision.rb +30 -8
  63. data/lib/{CORL/action → nucleon/action/node}/reboot.rb +13 -4
  64. data/lib/{CORL/action → nucleon/action/node}/revoke.rb +11 -2
  65. data/lib/{CORL/action → nucleon/action/node}/seed.rb +13 -4
  66. data/lib/{CORL/action → nucleon/action/node}/spawn.rb +19 -9
  67. data/lib/{CORL/action → nucleon/action/node}/start.rb +13 -4
  68. data/lib/{CORL/action → nucleon/action/node}/stop.rb +13 -4
  69. data/lib/{CORL → nucleon}/event/puppet.rb +2 -2
  70. data/lib/{CORL → nucleon}/template/environment.rb +2 -2
  71. data/lib/puppet/indirector/corl.rb +7 -4
  72. data/lib/puppet/parser/functions/corl_resources.rb +1 -0
  73. data/lib/puppet/parser/functions/global_array.rb +2 -1
  74. data/lib/puppet/parser/functions/global_hash.rb +2 -1
  75. data/lib/puppet/parser/functions/global_param.rb +2 -1
  76. data/lib/puppet/parser/functions/module_array.rb +2 -1
  77. data/lib/puppet/parser/functions/module_hash.rb +3 -2
  78. data/lib/puppet/parser/functions/module_param.rb +3 -2
  79. data/lib/puppet/parser/functions/render.rb +1 -0
  80. data/locales/en.yml +80 -0
  81. data/rdoc/site/0.4.29/CORL/Action/Authorize.html +485 -0
  82. data/rdoc/site/0.4.29/CORL/Action/Bootstrap.html +546 -0
  83. data/rdoc/site/0.4.29/CORL/Action/Build.html +396 -0
  84. data/rdoc/site/0.4.29/CORL/Action/Destroy.html +515 -0
  85. data/rdoc/site/0.4.29/CORL/Action/Exec.html +472 -0
  86. data/rdoc/site/0.4.29/CORL/Action/Facts.html +398 -0
  87. data/rdoc/site/0.4.29/CORL/Action/Image.html +515 -0
  88. data/rdoc/site/0.4.29/CORL/Action/Images.html +514 -0
  89. data/rdoc/site/0.4.29/CORL/Action/Ip.html +395 -0
  90. data/rdoc/site/0.4.29/CORL/Action/Keypair.html +494 -0
  91. data/rdoc/site/0.4.29/CORL/Action/Lookup.html +474 -0
  92. data/rdoc/site/0.4.29/CORL/Action/Machines.html +509 -0
  93. data/rdoc/site/0.4.29/CORL/Action/Provision.html +456 -0
  94. data/rdoc/site/0.4.29/CORL/Action/Reboot.html +515 -0
  95. data/rdoc/site/0.4.29/CORL/Action/Regions.html +509 -0
  96. data/rdoc/site/0.4.29/CORL/Action/Revoke.html +483 -0
  97. data/rdoc/site/0.4.29/CORL/Action/Seed.html +544 -0
  98. data/rdoc/site/0.4.29/CORL/Action/Spawn.html +616 -0
  99. data/rdoc/site/0.4.29/CORL/Action/Ssh.html +526 -0
  100. data/rdoc/site/0.4.29/CORL/Action/Start.html +515 -0
  101. data/rdoc/site/0.4.29/CORL/Action/Stop.html +515 -0
  102. data/rdoc/site/0.4.29/CORL/Action/Vagrantfile.html +457 -0
  103. data/rdoc/site/0.4.29/CORL/Action.html +360 -0
  104. data/rdoc/site/0.4.29/CORL/Configuration/File.html +1128 -0
  105. data/rdoc/site/0.4.29/CORL/Configuration.html +339 -0
  106. data/rdoc/site/0.4.29/CORL/Errors.html +339 -0
  107. data/rdoc/site/0.4.29/CORL/Event/Puppet.html +673 -0
  108. data/rdoc/site/0.4.29/CORL/Event.html +339 -0
  109. data/rdoc/site/0.4.29/CORL/Facade.html +742 -0
  110. data/rdoc/site/0.4.29/CORL/Machine/Aws.html +733 -0
  111. data/rdoc/site/0.4.29/CORL/Machine/Fog.html +1269 -0
  112. data/rdoc/site/0.4.29/CORL/Machine/Physical.html +1039 -0
  113. data/rdoc/site/0.4.29/CORL/Machine/Rackspace.html +514 -0
  114. data/rdoc/site/0.4.29/CORL/Machine/Vagrant.html +1300 -0
  115. data/rdoc/site/0.4.29/CORL/Machine.html +343 -0
  116. data/rdoc/site/0.4.29/CORL/Mixin/Action/Keypair.html +572 -0
  117. data/rdoc/site/0.4.29/CORL/Mixin/Action.html +339 -0
  118. data/rdoc/site/0.4.29/CORL/Mixin/Lookup.html +954 -0
  119. data/rdoc/site/0.4.29/CORL/Mixin/Machine/SSH.html +643 -0
  120. data/rdoc/site/0.4.29/CORL/Mixin/Machine.html +339 -0
  121. data/rdoc/site/0.4.29/CORL/Mixin/Macro/NetworkSettings.html +464 -0
  122. data/rdoc/site/0.4.29/CORL/Mixin/Macro.html +339 -0
  123. data/rdoc/site/0.4.29/CORL/Mixin.html +342 -0
  124. data/rdoc/site/0.4.29/CORL/Network/Default.html +391 -0
  125. data/rdoc/site/0.4.29/CORL/Network.html +339 -0
  126. data/rdoc/site/0.4.29/CORL/Node/Aws.html +716 -0
  127. data/rdoc/site/0.4.29/CORL/Node/Fog.html +1192 -0
  128. data/rdoc/site/0.4.29/CORL/Node/Local.html +424 -0
  129. data/rdoc/site/0.4.29/CORL/Node/Rackspace.html +709 -0
  130. data/rdoc/site/0.4.29/CORL/Node/Vagrant.html +1451 -0
  131. data/rdoc/site/0.4.29/CORL/Node.html +343 -0
  132. data/rdoc/site/0.4.29/CORL/Plugin/CloudAction.html +810 -0
  133. data/rdoc/site/0.4.29/CORL/Plugin.html +339 -0
  134. data/rdoc/site/0.4.29/CORL/Provisioner/Puppetnode.html +1095 -0
  135. data/rdoc/site/0.4.29/CORL/Provisioner.html +339 -0
  136. data/rdoc/site/0.4.29/CORL/Template/Environment.html +528 -0
  137. data/rdoc/site/0.4.29/CORL/Template.html +339 -0
  138. data/rdoc/site/0.4.29/CORL/Util/Puppet/Resource.html +1038 -0
  139. data/rdoc/site/0.4.29/CORL/Util/Puppet/ResourceGroup.html +920 -0
  140. data/rdoc/site/0.4.29/CORL/Util/Puppet.html +1087 -0
  141. data/rdoc/site/0.4.29/CORL/Util.html +341 -0
  142. data/rdoc/site/0.4.29/CORL/Vagrant/Config.html +896 -0
  143. data/rdoc/site/0.4.29/CORL/Vagrant.html +418 -0
  144. data/rdoc/site/0.4.29/CORL.html +465 -0
  145. data/rdoc/site/0.4.29/Facter/Util/Loader.html +396 -0
  146. data/rdoc/site/0.4.29/Facter/Util.html +339 -0
  147. data/rdoc/site/0.4.29/Facter.html +339 -0
  148. data/rdoc/site/0.4.29/Fog/Compute/AWS/Server.html +423 -0
  149. data/rdoc/site/0.4.29/Fog/Compute/AWS.html +345 -0
  150. data/rdoc/site/0.4.29/Fog/Compute/RackspaceV2/Server.html +408 -0
  151. data/rdoc/site/0.4.29/Fog/Compute/RackspaceV2.html +345 -0
  152. data/rdoc/site/0.4.29/Fog/Compute.html +340 -0
  153. data/rdoc/site/0.4.29/Fog.html +340 -0
  154. data/rdoc/site/0.4.29/Hiera/Backend.html +422 -0
  155. data/rdoc/site/0.4.29/Hiera/Corl_logger.html +449 -0
  156. data/rdoc/site/0.4.29/Hiera.html +346 -0
  157. data/rdoc/site/0.4.29/Nucleon/Config.html +357 -0
  158. data/rdoc/site/0.4.29/Nucleon/Plugin/Base.html +345 -0
  159. data/rdoc/site/0.4.29/Nucleon/Plugin/Configuration.html +1213 -0
  160. data/rdoc/site/0.4.29/Nucleon/Plugin/Machine.html +1279 -0
  161. data/rdoc/site/0.4.29/Nucleon/Plugin/Network.html +1425 -0
  162. data/rdoc/site/0.4.29/Nucleon/Plugin/Node.html +3715 -0
  163. data/rdoc/site/0.4.29/Nucleon/Plugin/Provisioner.html +1297 -0
  164. data/rdoc/site/0.4.29/Nucleon/Plugin.html +344 -0
  165. data/rdoc/site/0.4.29/Nucleon.html +344 -0
  166. data/rdoc/site/0.4.29/Object.html +358 -0
  167. data/rdoc/site/0.4.29/Puppet/DataBinding/Corl.html +345 -0
  168. data/rdoc/site/0.4.29/Puppet/DataBinding.html +338 -0
  169. data/rdoc/site/0.4.29/Puppet/Indirector/Corl.html +454 -0
  170. data/rdoc/site/0.4.29/Puppet/Indirector.html +338 -0
  171. data/rdoc/site/0.4.29/Puppet/Parser/Functions.html +480 -0
  172. data/rdoc/site/0.4.29/Puppet/Parser.html +338 -0
  173. data/rdoc/site/0.4.29/Puppet.html +338 -0
  174. data/rdoc/site/0.4.29/README_rdoc.html +340 -0
  175. data/rdoc/site/0.4.29/Vagrant/Config/Loader.html +399 -0
  176. data/rdoc/site/0.4.29/Vagrant/Config.html +339 -0
  177. data/rdoc/site/0.4.29/Vagrant/Vagrantfile.html +392 -0
  178. data/rdoc/site/0.4.29/Vagrant.html +346 -0
  179. data/rdoc/site/0.4.29/VagrantPlugins/CORL/Action/DeleteCache.html +396 -0
  180. data/rdoc/site/0.4.29/VagrantPlugins/CORL/Action/InitKeys.html +408 -0
  181. data/rdoc/site/0.4.29/VagrantPlugins/CORL/Action/LinkNetwork.html +406 -0
  182. data/rdoc/site/0.4.29/VagrantPlugins/CORL/Action.html +341 -0
  183. data/rdoc/site/0.4.29/VagrantPlugins/CORL/BaseAction.html +491 -0
  184. data/rdoc/site/0.4.29/VagrantPlugins/CORL/Command/Launcher.html +533 -0
  185. data/rdoc/site/0.4.29/VagrantPlugins/CORL/Command.html +339 -0
  186. data/rdoc/site/0.4.29/VagrantPlugins/CORL/Config/CORL.html +732 -0
  187. data/rdoc/site/0.4.29/VagrantPlugins/CORL/Config.html +339 -0
  188. data/rdoc/site/0.4.29/VagrantPlugins/CORL/Plugin.html +345 -0
  189. data/rdoc/site/0.4.29/VagrantPlugins/CORL/Provisioner/CORL.html +536 -0
  190. data/rdoc/site/0.4.29/VagrantPlugins/CORL/Provisioner.html +339 -0
  191. data/rdoc/site/0.4.29/VagrantPlugins/CORL.html +346 -0
  192. data/rdoc/site/0.4.29/VagrantPlugins.html +346 -0
  193. data/rdoc/site/0.4.29/created.rid +96 -0
  194. data/rdoc/site/0.4.29/images/add.png +0 -0
  195. data/rdoc/site/0.4.29/images/brick.png +0 -0
  196. data/rdoc/site/0.4.29/images/brick_link.png +0 -0
  197. data/rdoc/site/0.4.29/images/bug.png +0 -0
  198. data/rdoc/site/0.4.29/images/bullet_black.png +0 -0
  199. data/rdoc/site/0.4.29/images/bullet_toggle_minus.png +0 -0
  200. data/rdoc/site/0.4.29/images/bullet_toggle_plus.png +0 -0
  201. data/rdoc/site/0.4.29/images/date.png +0 -0
  202. data/rdoc/site/0.4.29/images/delete.png +0 -0
  203. data/rdoc/site/0.4.29/images/find.png +0 -0
  204. data/rdoc/site/0.4.29/images/loadingAnimation.gif +0 -0
  205. data/rdoc/site/0.4.29/images/macFFBgHack.png +0 -0
  206. data/rdoc/site/0.4.29/images/package.png +0 -0
  207. data/rdoc/site/0.4.29/images/page_green.png +0 -0
  208. data/rdoc/site/0.4.29/images/page_white_text.png +0 -0
  209. data/rdoc/site/0.4.29/images/page_white_width.png +0 -0
  210. data/rdoc/site/0.4.29/images/plugin.png +0 -0
  211. data/rdoc/site/0.4.29/images/ruby.png +0 -0
  212. data/rdoc/site/0.4.29/images/tag_blue.png +0 -0
  213. data/rdoc/site/0.4.29/images/tag_green.png +0 -0
  214. data/rdoc/site/0.4.29/images/transparent.png +0 -0
  215. data/rdoc/site/0.4.29/images/wrench.png +0 -0
  216. data/rdoc/site/0.4.29/images/wrench_orange.png +0 -0
  217. data/rdoc/site/0.4.29/images/zoom.png +0 -0
  218. data/rdoc/site/0.4.29/index.html +339 -0
  219. data/rdoc/site/0.4.29/js/darkfish.js +155 -0
  220. data/rdoc/site/0.4.29/js/jquery.js +18 -0
  221. data/rdoc/site/0.4.29/js/navigation.js +142 -0
  222. data/rdoc/site/0.4.29/js/search.js +94 -0
  223. data/rdoc/site/0.4.29/js/search_index.js +1 -0
  224. data/rdoc/site/0.4.29/js/searcher.js +228 -0
  225. data/rdoc/site/0.4.29/rdoc.css +543 -0
  226. data/rdoc/site/0.4.29/table_of_contents.html +1561 -0
  227. metadata +192 -45
  228. data/lib/CORL/action/build.rb +0 -22
  229. data/lib/CORL/action/keypair.rb +0 -56
  230. data/lib/core/mod/facter_loader.rb +0 -15
@@ -1,7 +1,15 @@
1
1
 
2
- module CORL
2
+ module Nucleon
3
3
  module Action
4
- class Machines < Plugin::CloudAction
4
+ module Cloud
5
+ class Machines < CORL.plugin_class(:nucleon, :cloud_action)
6
+
7
+ #-----------------------------------------------------------------------------
8
+ # Info
9
+
10
+ def self.describe
11
+ super(:cloud, :machines, 860)
12
+ end
5
13
 
6
14
  #-----------------------------------------------------------------------------
7
15
  # Settings
@@ -51,3 +59,4 @@ class Machines < Plugin::CloudAction
51
59
  end
52
60
  end
53
61
  end
62
+ end
@@ -1,7 +1,15 @@
1
1
 
2
- module CORL
2
+ module Nucleon
3
3
  module Action
4
- class Regions < Plugin::CloudAction
4
+ module Cloud
5
+ class Regions < CORL.plugin_class(:nucleon, :cloud_action)
6
+
7
+ #-----------------------------------------------------------------------------
8
+ # Info
9
+
10
+ def self.describe
11
+ super(:cloud, :regions, 855)
12
+ end
5
13
 
6
14
  #-----------------------------------------------------------------------------
7
15
  # Settings
@@ -51,3 +59,4 @@ class Regions < Plugin::CloudAction
51
59
  end
52
60
  end
53
61
  end
62
+ end
@@ -1,7 +1,15 @@
1
1
 
2
- module CORL
2
+ module Nucleon
3
3
  module Action
4
- class Vagrantfile < Plugin::CloudAction
4
+ module Cloud
5
+ class Vagrantfile < CORL.plugin_class(:nucleon, :cloud_action)
6
+
7
+ #-----------------------------------------------------------------------------
8
+ # Info
9
+
10
+ def self.describe
11
+ super(:cloud, :vagrantfile, 800)
12
+ end
5
13
 
6
14
  #-----------------------------------------------------------------------------
7
15
  # Settings
@@ -53,3 +61,4 @@ class Vagrantfile < Plugin::CloudAction
53
61
  end
54
62
  end
55
63
  end
64
+ end
@@ -1,7 +1,15 @@
1
1
 
2
- module CORL
2
+ module Nucleon
3
3
  module Action
4
- class Ip < Plugin::CloudAction
4
+ module Node
5
+ class IP < CORL.plugin_class(:nucleon, :cloud_action)
6
+
7
+ #-----------------------------------------------------------------------------
8
+ # Info
9
+
10
+ def self.describe
11
+ super(:node, :ip, 575)
12
+ end
5
13
 
6
14
  #-----------------------------------------------------------------------------
7
15
  # Settings
@@ -19,3 +27,4 @@ class Ip < Plugin::CloudAction
19
27
  end
20
28
  end
21
29
  end
30
+ end
@@ -1,7 +1,15 @@
1
1
 
2
- module CORL
2
+ module Nucleon
3
3
  module Action
4
- class Ssh < Plugin::CloudAction
4
+ module Node
5
+ class SSH < CORL.plugin_class(:nucleon, :cloud_action)
6
+
7
+ #-----------------------------------------------------------------------------
8
+ # Info
9
+
10
+ def self.describe
11
+ super(:node, :ssh, 560)
12
+ end
5
13
 
6
14
  #-----------------------------------------------------------------------------
7
15
  # Settings
@@ -14,11 +22,11 @@ class Ssh < Plugin::CloudAction
14
22
  next false
15
23
  end
16
24
 
17
- node_plugins = CORL.loaded_plugins(:node)
25
+ node_plugins = CORL.loaded_plugins(:CORL, :node)
18
26
  success = true
19
27
 
20
28
  values.each do |value|
21
- if info = CORL.plugin_class(:node).translate_reference(value)
29
+ if info = CORL.plugin_class(:CORL, :node).translate_reference(value)
22
30
  if ! node_plugins.keys.include?(info[:provider].to_sym) || info[:name].empty?
23
31
  warn('corl.actions.bootstrap.errors.ssh_nodes', { :value => value, :node_provider => info[:provider], :name => info[:name] })
24
32
  success = false
@@ -26,10 +34,9 @@ class Ssh < Plugin::CloudAction
26
34
  end
27
35
  end
28
36
  success
29
- end
30
-
31
- config[:node_provider].default = :rackspace
37
+ end
32
38
  end
39
+ config[:node_provider].default = :rackspace
33
40
  end
34
41
 
35
42
  #---
@@ -68,3 +75,4 @@ class Ssh < Plugin::CloudAction
68
75
  end
69
76
  end
70
77
  end
78
+ end
@@ -1,7 +1,15 @@
1
1
 
2
- module CORL
2
+ module Nucleon
3
3
  module Action
4
- class Authorize < Plugin::CloudAction
4
+ module Node
5
+ class Authorize < CORL.plugin_class(:nucleon, :cloud_action)
6
+
7
+ #-----------------------------------------------------------------------------
8
+ # Info
9
+
10
+ def self.describe
11
+ super(:node, :authorize, 555)
12
+ end
5
13
 
6
14
  #-----------------------------------------------------------------------------
7
15
  # Settings
@@ -55,3 +63,4 @@ class Authorize < Plugin::CloudAction
55
63
  end
56
64
  end
57
65
  end
66
+ end
@@ -1,7 +1,15 @@
1
1
 
2
- module CORL
2
+ module Nucleon
3
3
  module Action
4
- class Bootstrap < Plugin::CloudAction
4
+ module Node
5
+ class Bootstrap < CORL.plugin_class(:nucleon, :cloud_action)
6
+
7
+ #-----------------------------------------------------------------------------
8
+ # Info
9
+
10
+ def self.describe
11
+ super(:node, :bootstrap, 630)
12
+ end
5
13
 
6
14
  #-----------------------------------------------------------------------------
7
15
  # Settings
@@ -36,11 +44,11 @@ class Bootstrap < Plugin::CloudAction
36
44
  next false
37
45
  end
38
46
 
39
- node_plugins = CORL.loaded_plugins(:node)
47
+ node_plugins = CORL.loaded_plugins(:CORL, :node)
40
48
  success = true
41
49
 
42
50
  values.each do |value|
43
- if info = CORL.plugin_class(:node).translate_reference(value)
51
+ if info = CORL.plugin_class(:CORL, :node).translate_reference(value)
44
52
  if ! node_plugins.keys.include?(info[:provider].to_sym) || info[:name].empty?
45
53
  warn('corl.actions.bootstrap.errors.bootstrap_nodes', { :value => value, :node_provider => info[:provider], :name => info[:name] })
46
54
  success = false
@@ -88,3 +96,4 @@ class Bootstrap < Plugin::CloudAction
88
96
  end
89
97
  end
90
98
  end
99
+ end
@@ -0,0 +1,49 @@
1
+
2
+ module Nucleon
3
+ module Action
4
+ module Node
5
+ class Build < CORL.plugin_class(:nucleon, :cloud_action)
6
+
7
+ #-----------------------------------------------------------------------------
8
+ # Info
9
+
10
+ def self.describe
11
+ super(:node, :build, 620)
12
+ end
13
+
14
+ #-----------------------------------------------------------------------------
15
+ # Settings
16
+
17
+ def configure
18
+ super do
19
+ register :environment, :str, ''
20
+ end
21
+ end
22
+
23
+ #---
24
+
25
+ def arguments
26
+ [ :environment ]
27
+ end
28
+
29
+ #-----------------------------------------------------------------------------
30
+ # Operations
31
+
32
+ def execute
33
+ super do |node, network|
34
+ info('corl.actions.build.start')
35
+ ensure_node(node) do
36
+ settings.delete(:environment) if settings[:environment] == ''
37
+
38
+ if settings.has_key?(:environment)
39
+ node.create_fact(:corl_environment, settings[:environment])
40
+ end
41
+
42
+ node.build(settings)
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
@@ -1,7 +1,15 @@
1
1
 
2
- module CORL
2
+ module Nucleon
3
3
  module Action
4
- class Destroy < Plugin::CloudAction
4
+ module Node
5
+ class Destroy < CORL.plugin_class(:nucleon, :cloud_action)
6
+
7
+ #-----------------------------------------------------------------------------
8
+ # Info
9
+
10
+ def self.describe
11
+ super(:node, :destroy, 580)
12
+ end
5
13
 
6
14
  #-----------------------------------------------------------------------------
7
15
  # Settings
@@ -14,11 +22,11 @@ class Destroy < Plugin::CloudAction
14
22
  next false
15
23
  end
16
24
 
17
- node_plugins = CORL.loaded_plugins(:node)
25
+ node_plugins = CORL.loaded_plugins(:CORL, :node)
18
26
  success = true
19
27
 
20
28
  values.each do |value|
21
- if info = CORL.plugin_class(:node).translate_reference(value)
29
+ if info = CORL.plugin_class(:CORL, :node).translate_reference(value)
22
30
  if ! node_plugins.keys.include?(info[:provider].to_sym) || info[:name].empty?
23
31
  warn('corl.actions.destroy.errors.destroy_nodes', { :value => value, :node_provider => info[:provider], :name => info[:name] })
24
32
  success = false
@@ -47,7 +55,7 @@ class Destroy < Plugin::CloudAction
47
55
  super do |local_node, network|
48
56
  ensure_network(network) do
49
57
  batch_success = network.batch(settings[:destroy_nodes], settings[:node_provider], settings[:parallel]) do |node|
50
- info('corl.actions.stop.start', { :provider => node.plugin_provider, :name => node.plugin_name })
58
+ info('corl.actions.destroy.start', { :provider => node.plugin_provider, :name => node.plugin_name })
51
59
  node.destroy
52
60
  end
53
61
  myself.status = code.batch_error unless batch_success
@@ -57,3 +65,4 @@ class Destroy < Plugin::CloudAction
57
65
  end
58
66
  end
59
67
  end
68
+ end
@@ -1,7 +1,15 @@
1
1
 
2
- module CORL
2
+ module Nucleon
3
3
  module Action
4
- class Exec < Plugin::CloudAction
4
+ module Node
5
+ class Exec < CORL.plugin_class(:nucleon, :cloud_action)
6
+
7
+ #-----------------------------------------------------------------------------
8
+ # Info
9
+
10
+ def self.describe
11
+ super(:node, :exec, 605)
12
+ end
5
13
 
6
14
  #----------------------------------------------------------------------------
7
15
  # Settings
@@ -42,3 +50,4 @@ class Exec < Plugin::CloudAction
42
50
  end
43
51
  end
44
52
  end
53
+ end
@@ -1,7 +1,15 @@
1
1
 
2
- module CORL
2
+ module Nucleon
3
3
  module Action
4
- class Facts < Plugin::CloudAction
4
+ module Node
5
+ class Facts < CORL.plugin_class(:nucleon, :cloud_action)
6
+
7
+ #-----------------------------------------------------------------------------
8
+ # Info
9
+
10
+ def self.describe
11
+ super(:node, :facts, 570)
12
+ end
5
13
 
6
14
  #-----------------------------------------------------------------------------
7
15
  # Settings
@@ -12,7 +20,7 @@ class Facts < Plugin::CloudAction
12
20
  def execute
13
21
  super do |node, network|
14
22
  ensure_node(node) do
15
- facter_facts = Config.facts
23
+ facter_facts = node.facts
16
24
 
17
25
  ui.info(Util::Data.to_json(facter_facts, true), { :prefix => false })
18
26
  myself.result = facter_facts
@@ -22,3 +30,4 @@ class Facts < Plugin::CloudAction
22
30
  end
23
31
  end
24
32
  end
33
+ end
@@ -1,7 +1,15 @@
1
1
 
2
- module CORL
2
+ module Nucleon
3
3
  module Action
4
- class Image < Plugin::CloudAction
4
+ module Node
5
+ class Image < CORL.plugin_class(:nucleon, :cloud_action)
6
+
7
+ #-----------------------------------------------------------------------------
8
+ # Info
9
+
10
+ def self.describe
11
+ super(:node, :image, 610)
12
+ end
5
13
 
6
14
  #-----------------------------------------------------------------------------
7
15
  # Settings
@@ -14,11 +22,11 @@ class Image < Plugin::CloudAction
14
22
  next false
15
23
  end
16
24
 
17
- node_plugins = CORL.loaded_plugins(:node)
25
+ node_plugins = CORL.loaded_plugins(:CORL, :node)
18
26
  success = true
19
27
 
20
28
  values.each do |value|
21
- if info = CORL.plugin_class(:node).translate_reference(value)
29
+ if info = CORL.plugin_class(:CORL, :node).translate_reference(value)
22
30
  if ! node_plugins.keys.include?(info[:provider].to_sym) || info[:name].empty?
23
31
  warn('corl.actions.image.errors.image_nodes', { :value => value, :node_provider => info[:provider], :name => info[:name] })
24
32
  success = false
@@ -57,3 +65,4 @@ class Image < Plugin::CloudAction
57
65
  end
58
66
  end
59
67
  end
68
+ end
@@ -0,0 +1,85 @@
1
+
2
+ module Nucleon
3
+ module Action
4
+ module Node
5
+ class Keypair < CORL.plugin_class(:nucleon, :cloud_action)
6
+
7
+ include Mixin::Action::Keypair
8
+
9
+ #-----------------------------------------------------------------------------
10
+ # Info
11
+
12
+ def self.describe
13
+ super(:node, :keypair, 545)
14
+ end
15
+
16
+ #----------------------------------------------------------------------------
17
+ # Settings
18
+
19
+ def configure
20
+ super do
21
+ codes :key_failure
22
+
23
+ register :json, :bool, true
24
+ register :both, :bool, false
25
+ keypair_config
26
+ end
27
+ end
28
+
29
+ #---
30
+
31
+ def ignore
32
+ node_ignore
33
+ end
34
+
35
+ #-----------------------------------------------------------------------------
36
+ # Operations
37
+
38
+ def execute
39
+ super do |node, network|
40
+ if keys = keypair
41
+ ui.info("\n", { :prefix => false })
42
+ ui_group(Util::Console.cyan("#{keys.type.upcase} SSH keypair")) do |ui|
43
+ render_json = lambda do
44
+ private_key = Util::Console.blue(Util::Data.to_json(keys.encrypted_key, true))
45
+ ssh_key = keys.ssh_key.gsub(/^ssh\-[a-z]+\s+/, '')
46
+ ssh_key = Util::Console.green(Util::Data.to_json(ssh_key, true))
47
+
48
+ ui.info("-----------------------------------------------------")
49
+ ui.info(yellow("SSH JSON string"))
50
+ ui.info("SSH private key:\n#{private_key}")
51
+ ui.info("SSH public key:\n#{ssh_key}")
52
+ ui.info("\n", { :prefix => false })
53
+ end
54
+
55
+ render_file = lambda do
56
+ private_key = Util::Console.blue(keys.encrypted_key)
57
+ ssh_key = Util::Console.green(keys.ssh_key)
58
+
59
+ ui.info("-----------------------------------------------------")
60
+ ui.info(yellow("SSH file rendering"))
61
+ ui.info("SSH private key:\n#{private_key}")
62
+ ui.info("SSH public key:\n#{ssh_key}")
63
+ ui.info("\n", { :prefix => false })
64
+ end
65
+
66
+ if settings[:both]
67
+ render_json.call
68
+ render_file.call
69
+ else
70
+ if settings[:json]
71
+ render_json.call
72
+ else
73
+ render_file.call
74
+ end
75
+ end
76
+ end
77
+ else
78
+ myself.status = code.key_failure
79
+ end
80
+ end
81
+ end
82
+ end
83
+ end
84
+ end
85
+ end
@@ -1,8 +1,16 @@
1
1
 
2
- module CORL
2
+ module Nucleon
3
3
  module Action
4
- class Lookup < Plugin::CloudAction
5
-
4
+ module Node
5
+ class Lookup < CORL.plugin_class(:nucleon, :cloud_action)
6
+
7
+ #-----------------------------------------------------------------------------
8
+ # Info
9
+
10
+ def self.describe
11
+ super(:node, :lookup, 565)
12
+ end
13
+
6
14
  #-----------------------------------------------------------------------------
7
15
  # Settings
8
16
 
@@ -34,7 +42,7 @@ class Lookup < Plugin::CloudAction
34
42
  super do |node, network|
35
43
  ensure_node(node) do
36
44
  property = settings.delete(:property)
37
- value = lookup(property, nil, settings)
45
+ value = node.lookup(property, nil, settings)
38
46
 
39
47
  ui.info(Util::Data.to_json(value, true), { :prefix => false })
40
48
  myself.result = value
@@ -44,3 +52,4 @@ class Lookup < Plugin::CloudAction
44
52
  end
45
53
  end
46
54
  end
55
+ end
@@ -1,7 +1,15 @@
1
1
 
2
- module CORL
2
+ module Nucleon
3
3
  module Action
4
- class Provision < Plugin::CloudAction
4
+ module Node
5
+ class Provision < CORL.plugin_class(:nucleon, :cloud_action)
6
+
7
+ #-----------------------------------------------------------------------------
8
+ # Info
9
+
10
+ def self.describe
11
+ super(:node, :provision, 615)
12
+ end
5
13
 
6
14
  #-----------------------------------------------------------------------------
7
15
  # Settings
@@ -11,9 +19,16 @@ class Provision < Plugin::CloudAction
11
19
  codes :provision_failure
12
20
 
13
21
  register :dry_run, :bool, false
22
+ register :environment, :str, ''
14
23
  end
15
24
  end
16
25
 
26
+ #---
27
+
28
+ def arguments
29
+ [ :environment ]
30
+ end
31
+
17
32
  #-----------------------------------------------------------------------------
18
33
  # Operations
19
34
 
@@ -24,21 +39,27 @@ class Provision < Plugin::CloudAction
24
39
  ensure_node(node) do
25
40
  success = true
26
41
 
42
+ settings.delete(:environment) if settings[:environment] == ''
43
+
44
+ if settings.has_key?(:environment)
45
+ node.create_fact(:corl_environment, settings[:environment])
46
+ end
47
+
27
48
  if CORL.admin?
28
49
  unless node.build_time && File.directory?(network.build_directory)
29
- success = node.build
50
+ success = node.build(settings)
30
51
  end
31
-
52
+
32
53
  if success
33
54
  provisioner_info = node.provisioner_info
34
-
55
+
35
56
  node.provisioners.each do |provider, collection|
36
57
  provider_info = provisioner_info[provider]
37
58
  profiles = provider_info[:profiles]
38
-
59
+
39
60
  collection.each do |name, provisioner|
40
- if supported_profiles = provisioner.supported_profiles(profiles)
41
- profile_success = provisioner.provision(supported_profiles, settings)
61
+ if supported_profiles = provisioner.supported_profiles(node, profiles)
62
+ profile_success = provisioner.provision(node, supported_profiles, settings)
42
63
  success = false unless profile_success
43
64
  end
44
65
  end
@@ -52,3 +73,4 @@ class Provision < Plugin::CloudAction
52
73
  end
53
74
  end
54
75
  end
76
+ end
@@ -1,7 +1,15 @@
1
1
 
2
- module CORL
2
+ module Nucleon
3
3
  module Action
4
- class Reboot < Plugin::CloudAction
4
+ module Node
5
+ class Reboot < CORL.plugin_class(:nucleon, :cloud_action)
6
+
7
+ #-----------------------------------------------------------------------------
8
+ # Info
9
+
10
+ def self.describe
11
+ super(:node, :reboot, 600)
12
+ end
5
13
 
6
14
  #-----------------------------------------------------------------------------
7
15
  # Settings
@@ -14,11 +22,11 @@ class Reboot < Plugin::CloudAction
14
22
  next false
15
23
  end
16
24
 
17
- node_plugins = CORL.loaded_plugins(:node)
25
+ node_plugins = CORL.loaded_plugins(:CORL, :node)
18
26
  success = true
19
27
 
20
28
  values.each do |value|
21
- if info = CORL.plugin_class(:node).translate_reference(value)
29
+ if info = CORL.plugin_class(:CORL, :node).translate_reference(value)
22
30
  if ! node_plugins.keys.include?(info[:provider].to_sym) || info[:name].empty?
23
31
  warn('corl.actions.reboot.errors.reboot_nodes', { :value => value, :node_provider => info[:provider], :name => info[:name] })
24
32
  success = false
@@ -57,3 +65,4 @@ class Reboot < Plugin::CloudAction
57
65
  end
58
66
  end
59
67
  end
68
+ end
@@ -1,7 +1,15 @@
1
1
 
2
- module CORL
2
+ module Nucleon
3
3
  module Action
4
- class Revoke < Plugin::CloudAction
4
+ module Node
5
+ class Revoke < CORL.plugin_class(:nucleon, :cloud_action)
6
+
7
+ #-----------------------------------------------------------------------------
8
+ # Info
9
+
10
+ def self.describe
11
+ super(:node, :revoke, 550)
12
+ end
5
13
 
6
14
  #-----------------------------------------------------------------------------
7
15
  # Settings
@@ -53,3 +61,4 @@ class Revoke < Plugin::CloudAction
53
61
  end
54
62
  end
55
63
  end
64
+ end
@@ -1,7 +1,15 @@
1
1
 
2
- module CORL
2
+ module Nucleon
3
3
  module Action
4
- class Seed < Plugin::CloudAction
4
+ module Node
5
+ class Seed < CORL.plugin_class(:nucleon, :cloud_action)
6
+
7
+ #-----------------------------------------------------------------------------
8
+ # Info
9
+
10
+ def self.describe
11
+ super(:node, :seed, 625)
12
+ end
5
13
 
6
14
  #-----------------------------------------------------------------------------
7
15
  # Settings
@@ -21,9 +29,9 @@ class Seed < Plugin::CloudAction
21
29
  next true if value.nil?
22
30
 
23
31
  value = value.to_sym
24
- project_plugins = CORL.loaded_plugins(:project)
32
+ project_plugins = CORL.loaded_plugins(:nucleon, :project)
25
33
 
26
- if @project_info = CORL.plugin_class(:project).translate_reference(value, true)
34
+ if @project_info = CORL.plugin_class(:nucleon, :project).translate_reference(value, true)
27
35
  provider = @project_info[:provider]
28
36
  else
29
37
  provider = value
@@ -114,3 +122,4 @@ class Seed < Plugin::CloudAction
114
122
  end
115
123
  end
116
124
  end
125
+ end