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.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/Gemfile.lock +8 -6
- data/VERSION +1 -1
- data/bootstrap/os/ubuntu/00_base.sh +2 -2
- data/bootstrap/os/ubuntu/05_ruby.sh +14 -2
- data/corl.gemspec +175 -5
- data/lib/CORL/builder/identity.rb +1 -1
- data/lib/CORL/builder/package.rb +1 -1
- data/lib/CORL/configuration/file.rb +7 -13
- data/lib/CORL/machine/physical.rb +1 -1
- data/lib/CORL/machine/vagrant.rb +12 -4
- data/lib/CORL/network/CORL.rb +1 -1
- data/lib/CORL/node/AWS.rb +25 -23
- data/lib/CORL/node/local.rb +1 -1
- data/lib/CORL/node/rackspace.rb +13 -15
- data/lib/CORL/node/vagrant.rb +1 -1
- data/lib/CORL/provisioner/puppetnode.rb +1 -1
- data/lib/core/mixin/action/keypair.rb +6 -6
- data/lib/core/mixin/action/registration.rb +39 -11
- data/lib/core/mod/fog_aws_server.rb +1 -3
- data/lib/core/plugin/builder.rb +1 -1
- data/lib/core/plugin/cloud_action.rb +59 -49
- data/lib/core/plugin/configuration.rb +4 -3
- data/lib/core/plugin/fog_machine.rb +10 -2
- data/lib/core/plugin/fog_node.rb +10 -4
- data/lib/core/plugin/machine.rb +2 -8
- data/lib/core/plugin/network.rb +9 -3
- data/lib/core/plugin/node.rb +30 -31
- data/lib/core/plugin/provisioner.rb +1 -1
- data/lib/core/vagrant/Vagrantfile +4 -1
- data/lib/core/vagrant/plugins.rb +6 -4
- data/lib/corl.rb +1 -1
- data/lib/nucleon/action/cloud/config.rb +167 -100
- data/lib/nucleon/action/cloud/create.rb +5 -1
- data/lib/nucleon/action/cloud/images.rb +10 -7
- data/lib/nucleon/action/cloud/inspect.rb +8 -6
- data/lib/nucleon/action/cloud/machines.rb +10 -7
- data/lib/nucleon/action/cloud/regions.rb +13 -8
- data/lib/nucleon/action/cloud/remote.rb +68 -0
- data/lib/nucleon/action/cloud/settings.rb +33 -47
- data/lib/nucleon/action/cloud/vagrantfile.rb +34 -17
- data/lib/nucleon/action/node/IP.rb +2 -2
- data/lib/nucleon/action/node/SSH.rb +3 -3
- data/lib/nucleon/action/node/authorize.rb +2 -2
- data/lib/nucleon/action/node/bootstrap.rb +17 -30
- data/lib/nucleon/action/node/build.rb +4 -4
- data/lib/nucleon/action/node/cache.rb +2 -4
- data/lib/nucleon/action/node/destroy.rb +25 -26
- data/lib/nucleon/action/node/exec.rb +2 -2
- data/lib/nucleon/action/node/fact.rb +10 -5
- data/lib/nucleon/action/node/group.rb +10 -5
- data/lib/nucleon/action/node/identity.rb +6 -8
- data/lib/nucleon/action/node/image.rb +3 -3
- data/lib/nucleon/action/node/keypair.rb +2 -2
- data/lib/nucleon/action/node/lookup.rb +2 -4
- data/lib/nucleon/action/node/provision.rb +2 -2
- data/lib/nucleon/action/node/reboot.rb +3 -3
- data/lib/nucleon/action/node/revoke.rb +2 -2
- data/lib/nucleon/action/node/seed.rb +28 -43
- data/lib/nucleon/action/node/spawn.rb +19 -14
- data/lib/nucleon/action/node/start.rb +3 -3
- data/lib/nucleon/action/node/status.rb +8 -8
- data/lib/nucleon/action/node/stop.rb +3 -3
- data/lib/nucleon/action/plugin/create.rb +10 -13
- data/lib/nucleon/action/plugin/list.rb +7 -7
- data/lib/nucleon/action/plugin/template/nucleon.action.erb +2 -2
- data/lib/nucleon/action/plugins.rb +12 -1
- data/lib/nucleon/event/puppet.rb +1 -1
- data/lib/nucleon/extension/corl_config.rb +26 -0
- data/lib/nucleon/template/environment.rb +1 -1
- data/locales/en.yml +483 -90
- data/rdoc/site/0.5.1/CORL/Build.html +781 -0
- data/rdoc/site/0.5.1/CORL/Builder/Identity.html +596 -0
- data/rdoc/site/0.5.1/CORL/Builder/Package.html +600 -0
- data/rdoc/site/0.5.1/CORL/Builder.html +384 -0
- data/rdoc/site/0.5.1/CORL/Configuration/File.html +1186 -0
- data/rdoc/site/0.5.1/CORL/Configuration.html +383 -0
- data/rdoc/site/0.5.1/CORL/Errors.html +383 -0
- data/rdoc/site/0.5.1/CORL/Facade.html +927 -0
- data/rdoc/site/0.5.1/CORL/Machine/AWS.html +777 -0
- data/rdoc/site/0.5.1/CORL/Machine/Fog.html +1313 -0
- data/rdoc/site/0.5.1/CORL/Machine/Physical.html +1083 -0
- data/rdoc/site/0.5.1/CORL/Machine/Rackspace.html +558 -0
- data/rdoc/site/0.5.1/CORL/Machine/Vagrant.html +1344 -0
- data/rdoc/site/0.5.1/CORL/Machine.html +387 -0
- data/rdoc/site/0.5.1/CORL/Mixin/Action/Keypair.html +616 -0
- data/rdoc/site/0.5.1/CORL/Mixin/Action/Registration.html +469 -0
- data/rdoc/site/0.5.1/CORL/Mixin/Action.html +384 -0
- data/rdoc/site/0.5.1/CORL/Mixin/Builder/Global.html +628 -0
- data/rdoc/site/0.5.1/CORL/Mixin/Builder/Instance.html +720 -0
- data/rdoc/site/0.5.1/CORL/Mixin/Builder.html +383 -0
- data/rdoc/site/0.5.1/CORL/Mixin/Lookup.html +1315 -0
- data/rdoc/site/0.5.1/CORL/Mixin/Machine/SSH.html +699 -0
- data/rdoc/site/0.5.1/CORL/Mixin/Machine.html +383 -0
- data/rdoc/site/0.5.1/CORL/Mixin/Macro/NetworkSettings.html +508 -0
- data/rdoc/site/0.5.1/CORL/Mixin/Macro.html +383 -0
- data/rdoc/site/0.5.1/CORL/Mixin.html +388 -0
- data/rdoc/site/0.5.1/CORL/Network/CORL.html +435 -0
- data/rdoc/site/0.5.1/CORL/Network.html +383 -0
- data/rdoc/site/0.5.1/CORL/Node/AWS.html +760 -0
- data/rdoc/site/0.5.1/CORL/Node/Fog.html +1268 -0
- data/rdoc/site/0.5.1/CORL/Node/Local.html +468 -0
- data/rdoc/site/0.5.1/CORL/Node/Rackspace.html +753 -0
- data/rdoc/site/0.5.1/CORL/Node/Vagrant.html +1497 -0
- data/rdoc/site/0.5.1/CORL/Node.html +387 -0
- data/rdoc/site/0.5.1/CORL/Plugin/Builder.html +524 -0
- data/rdoc/site/0.5.1/CORL/Plugin/Configuration.html +1294 -0
- data/rdoc/site/0.5.1/CORL/Plugin/Machine.html +1323 -0
- data/rdoc/site/0.5.1/CORL/Plugin/Network.html +1766 -0
- data/rdoc/site/0.5.1/CORL/Plugin/Node.html +4263 -0
- data/rdoc/site/0.5.1/CORL/Plugin/Provisioner.html +1139 -0
- data/rdoc/site/0.5.1/CORL/Plugin.html +673 -0
- data/rdoc/site/0.5.1/CORL/Provisioner/Puppetnode.html +1201 -0
- data/rdoc/site/0.5.1/CORL/Provisioner.html +383 -0
- data/rdoc/site/0.5.1/CORL/Util/Puppet/Resource.html +1082 -0
- data/rdoc/site/0.5.1/CORL/Util/Puppet/ResourceGroup.html +964 -0
- data/rdoc/site/0.5.1/CORL/Util/Puppet.html +1131 -0
- data/rdoc/site/0.5.1/CORL/Util.html +385 -0
- data/rdoc/site/0.5.1/CORL/Vagrant/Config.html +967 -0
- data/rdoc/site/0.5.1/CORL/Vagrant.html +462 -0
- data/rdoc/site/0.5.1/CORL.html +496 -0
- data/rdoc/site/0.5.1/Fog/Compute/AWS/Server.html +467 -0
- data/rdoc/site/0.5.1/Fog/Compute/AWS.html +389 -0
- data/rdoc/site/0.5.1/Fog/Compute/RackspaceV2/Server.html +452 -0
- data/rdoc/site/0.5.1/Fog/Compute/RackspaceV2.html +389 -0
- data/rdoc/site/0.5.1/Fog/Compute.html +384 -0
- data/rdoc/site/0.5.1/Fog.html +384 -0
- data/rdoc/site/0.5.1/Hiera/Backend.html +466 -0
- data/rdoc/site/0.5.1/Hiera/Corl_logger.html +493 -0
- data/rdoc/site/0.5.1/Hiera.html +390 -0
- data/rdoc/site/0.5.1/Nucleon/Action/Cloud/Config.html +978 -0
- data/rdoc/site/0.5.1/Nucleon/Action/Cloud/Create.html +562 -0
- data/rdoc/site/0.5.1/Nucleon/Action/Cloud/Images.html +596 -0
- data/rdoc/site/0.5.1/Nucleon/Action/Cloud/Inspect.html +567 -0
- data/rdoc/site/0.5.1/Nucleon/Action/Cloud/Machines.html +591 -0
- data/rdoc/site/0.5.1/Nucleon/Action/Cloud/Regions.html +591 -0
- data/rdoc/site/0.5.1/Nucleon/Action/Cloud/Settings.html +878 -0
- data/rdoc/site/0.5.1/Nucleon/Action/Cloud/Vagrantfile.html +539 -0
- data/rdoc/site/0.5.1/Nucleon/Action/Cloud.html +390 -0
- data/rdoc/site/0.5.1/Nucleon/Action/Node/Authorize.html +567 -0
- data/rdoc/site/0.5.1/Nucleon/Action/Node/Bootstrap.html +628 -0
- data/rdoc/site/0.5.1/Nucleon/Action/Node/Build.html +550 -0
- data/rdoc/site/0.5.1/Nucleon/Action/Node/Cache.html +773 -0
- data/rdoc/site/0.5.1/Nucleon/Action/Node/Destroy.html +597 -0
- data/rdoc/site/0.5.1/Nucleon/Action/Node/Exec.html +554 -0
- data/rdoc/site/0.5.1/Nucleon/Action/Node/Fact.html +733 -0
- data/rdoc/site/0.5.1/Nucleon/Action/Node/Facts.html +505 -0
- data/rdoc/site/0.5.1/Nucleon/Action/Node/Group.html +729 -0
- data/rdoc/site/0.5.1/Nucleon/Action/Node/Groups.html +505 -0
- data/rdoc/site/0.5.1/Nucleon/Action/Node/IP.html +477 -0
- data/rdoc/site/0.5.1/Nucleon/Action/Node/Identity.html +614 -0
- data/rdoc/site/0.5.1/Nucleon/Action/Node/Image.html +597 -0
- data/rdoc/site/0.5.1/Nucleon/Action/Node/Keypair.html +596 -0
- data/rdoc/site/0.5.1/Nucleon/Action/Node/Lookup.html +579 -0
- data/rdoc/site/0.5.1/Nucleon/Action/Node/Provision.html +577 -0
- data/rdoc/site/0.5.1/Nucleon/Action/Node/Reboot.html +597 -0
- data/rdoc/site/0.5.1/Nucleon/Action/Node/Revoke.html +565 -0
- data/rdoc/site/0.5.1/Nucleon/Action/Node/SSH.html +607 -0
- data/rdoc/site/0.5.1/Nucleon/Action/Node/Seed.html +626 -0
- data/rdoc/site/0.5.1/Nucleon/Action/Node/Spawn.html +699 -0
- data/rdoc/site/0.5.1/Nucleon/Action/Node/Start.html +597 -0
- data/rdoc/site/0.5.1/Nucleon/Action/Node/Status.html +615 -0
- data/rdoc/site/0.5.1/Nucleon/Action/Node/Stop.html +597 -0
- data/rdoc/site/0.5.1/Nucleon/Action/Node.html +406 -0
- data/rdoc/site/0.5.1/Nucleon/Action/Plugin/Create.html +736 -0
- data/rdoc/site/0.5.1/Nucleon/Action/Plugin/List.html +570 -0
- data/rdoc/site/0.5.1/Nucleon/Action/Plugin.html +384 -0
- data/rdoc/site/0.5.1/Nucleon/Action/Plugins.html +435 -0
- data/rdoc/site/0.5.1/Nucleon/Action.html +417 -0
- data/rdoc/site/0.5.1/Nucleon/Config.html +401 -0
- data/rdoc/site/0.5.1/Nucleon/Event/Puppet.html +717 -0
- data/rdoc/site/0.5.1/Nucleon/Event.html +383 -0
- data/rdoc/site/0.5.1/Nucleon/Plugin/Base.html +389 -0
- data/rdoc/site/0.5.1/Nucleon/Plugin/CloudAction.html +894 -0
- data/rdoc/site/0.5.1/Nucleon/Plugin.html +384 -0
- data/rdoc/site/0.5.1/Nucleon/Template/Environment.html +572 -0
- data/rdoc/site/0.5.1/Nucleon/Template.html +383 -0
- data/rdoc/site/0.5.1/Nucleon.html +421 -0
- data/rdoc/site/0.5.1/Object.html +402 -0
- data/rdoc/site/0.5.1/Puppet/DataBinding/Corl.html +389 -0
- data/rdoc/site/0.5.1/Puppet/DataBinding.html +382 -0
- data/rdoc/site/0.5.1/Puppet/Indirector/Corl.html +501 -0
- data/rdoc/site/0.5.1/Puppet/Indirector.html +382 -0
- data/rdoc/site/0.5.1/Puppet/Parser/Functions.html +524 -0
- data/rdoc/site/0.5.1/Puppet/Parser.html +382 -0
- data/rdoc/site/0.5.1/Puppet.html +382 -0
- data/rdoc/site/0.5.1/README_rdoc.html +384 -0
- data/rdoc/site/0.5.1/Vagrant/Config/Loader.html +443 -0
- data/rdoc/site/0.5.1/Vagrant/Config.html +383 -0
- data/rdoc/site/0.5.1/Vagrant/Vagrantfile.html +436 -0
- data/rdoc/site/0.5.1/Vagrant.html +390 -0
- data/rdoc/site/0.5.1/VagrantPlugins/CORL/Action/DeleteCache.html +446 -0
- data/rdoc/site/0.5.1/VagrantPlugins/CORL/Action/InitKeys.html +452 -0
- data/rdoc/site/0.5.1/VagrantPlugins/CORL/Action/LinkNetwork.html +450 -0
- data/rdoc/site/0.5.1/VagrantPlugins/CORL/Action.html +385 -0
- data/rdoc/site/0.5.1/VagrantPlugins/CORL/BaseAction.html +535 -0
- data/rdoc/site/0.5.1/VagrantPlugins/CORL/Command/Launcher.html +577 -0
- data/rdoc/site/0.5.1/VagrantPlugins/CORL/Command.html +383 -0
- data/rdoc/site/0.5.1/VagrantPlugins/CORL/Config/CORL.html +776 -0
- data/rdoc/site/0.5.1/VagrantPlugins/CORL/Config.html +383 -0
- data/rdoc/site/0.5.1/VagrantPlugins/CORL/Plugin.html +389 -0
- data/rdoc/site/0.5.1/VagrantPlugins/CORL/Provisioner/CORL.html +580 -0
- data/rdoc/site/0.5.1/VagrantPlugins/CORL/Provisioner.html +383 -0
- data/rdoc/site/0.5.1/VagrantPlugins/CORL.html +390 -0
- data/rdoc/site/0.5.1/VagrantPlugins.html +390 -0
- data/rdoc/site/0.5.1/created.rid +114 -0
- data/rdoc/site/0.5.1/images/add.png +0 -0
- data/rdoc/site/0.5.1/images/brick.png +0 -0
- data/rdoc/site/0.5.1/images/brick_link.png +0 -0
- data/rdoc/site/0.5.1/images/bug.png +0 -0
- data/rdoc/site/0.5.1/images/bullet_black.png +0 -0
- data/rdoc/site/0.5.1/images/bullet_toggle_minus.png +0 -0
- data/rdoc/site/0.5.1/images/bullet_toggle_plus.png +0 -0
- data/rdoc/site/0.5.1/images/date.png +0 -0
- data/rdoc/site/0.5.1/images/delete.png +0 -0
- data/rdoc/site/0.5.1/images/find.png +0 -0
- data/rdoc/site/0.5.1/images/loadingAnimation.gif +0 -0
- data/rdoc/site/0.5.1/images/macFFBgHack.png +0 -0
- data/rdoc/site/0.5.1/images/package.png +0 -0
- data/rdoc/site/0.5.1/images/page_green.png +0 -0
- data/rdoc/site/0.5.1/images/page_white_text.png +0 -0
- data/rdoc/site/0.5.1/images/page_white_width.png +0 -0
- data/rdoc/site/0.5.1/images/plugin.png +0 -0
- data/rdoc/site/0.5.1/images/ruby.png +0 -0
- data/rdoc/site/0.5.1/images/tag_blue.png +0 -0
- data/rdoc/site/0.5.1/images/tag_green.png +0 -0
- data/rdoc/site/0.5.1/images/transparent.png +0 -0
- data/rdoc/site/0.5.1/images/wrench.png +0 -0
- data/rdoc/site/0.5.1/images/wrench_orange.png +0 -0
- data/rdoc/site/0.5.1/images/zoom.png +0 -0
- data/rdoc/site/0.5.1/index.html +383 -0
- data/rdoc/site/0.5.1/js/darkfish.js +155 -0
- data/rdoc/site/0.5.1/js/jquery.js +18 -0
- data/rdoc/site/0.5.1/js/navigation.js +142 -0
- data/rdoc/site/0.5.1/js/search.js +94 -0
- data/rdoc/site/0.5.1/js/search_index.js +1 -0
- data/rdoc/site/0.5.1/js/searcher.js +228 -0
- data/rdoc/site/0.5.1/rdoc.css +543 -0
- data/rdoc/site/0.5.1/table_of_contents.html +2005 -0
- metadata +174 -4
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
module Nucleon
|
|
3
3
|
module Action
|
|
4
4
|
module Node
|
|
5
|
-
class Keypair <
|
|
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
|
|
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 <
|
|
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
|
|
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 <
|
|
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
|
|
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 <
|
|
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
|
|
56
|
-
ensure_network
|
|
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 <
|
|
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
|
|
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 <
|
|
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
|
-
|
|
28
|
-
|
|
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
|
|
60
|
-
info('
|
|
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(
|
|
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
|
-
|
|
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(
|
|
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(
|
|
80
|
+
info('finalizing')
|
|
94
81
|
FileUtils.chmod_R(0600, network_path)
|
|
95
82
|
FileUtils.rm_rf(backup_path)
|
|
96
83
|
|
|
97
|
-
info(
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
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.
|
|
108
|
-
end
|
|
92
|
+
myself.status = code.node_load_failure
|
|
93
|
+
end
|
|
109
94
|
else
|
|
110
|
-
myself.status = code.
|
|
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 <
|
|
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
|
-
|
|
25
|
-
|
|
26
|
-
register :provision, :bool, true
|
|
24
|
+
register_bool :bootstrap, true
|
|
25
|
+
register_bool :provision, false
|
|
27
26
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
|
57
|
-
ensure_network
|
|
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('
|
|
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 <
|
|
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
|
|
56
|
-
ensure_network
|
|
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 <
|
|
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
|
|
42
|
-
ensure_network
|
|
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)
|
|
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
|
-
|
|
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 <
|
|
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
|
|
56
|
-
ensure_network
|
|
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 <
|
|
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
|
|
75
|
-
ensure_network
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
146
|
+
success('saved', { :file => save_file })
|
|
150
147
|
else
|
|
151
|
-
error(
|
|
148
|
+
error('save_failed', { :file => save_file })
|
|
152
149
|
myself.status = code.plugin_save_failed
|
|
153
150
|
end
|
|
154
151
|
else
|
|
155
|
-
info(
|
|
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 <
|
|
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
|
|
34
|
-
ensure_network
|
|
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(
|
|
40
|
-
|
|
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
|
-
|
|
48
|
-
|
|
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
|
|
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
|
|
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
|
data/lib/nucleon/event/puppet.rb
CHANGED
|
@@ -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
|