corl 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- 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,15 +2,13 @@
|
|
2
2
|
module Nucleon
|
3
3
|
module Action
|
4
4
|
module Cloud
|
5
|
-
class Settings <
|
6
|
-
|
7
|
-
include Mixin::Action::Registration
|
5
|
+
class Settings < Nucleon.plugin_class(:nucleon, :cloud_action)
|
8
6
|
|
9
7
|
#-----------------------------------------------------------------------------
|
10
8
|
# Info
|
11
9
|
|
12
10
|
def self.describe
|
13
|
-
super(:cloud, :settings,
|
11
|
+
super(:cloud, :settings, 950)
|
14
12
|
end
|
15
13
|
|
16
14
|
#-----------------------------------------------------------------------------
|
@@ -25,6 +23,7 @@ class Settings < CORL.plugin_class(:nucleon, :cloud_action)
|
|
25
23
|
register_str :name
|
26
24
|
register_array :value
|
27
25
|
|
26
|
+
register_bool :array
|
28
27
|
register_bool :delete
|
29
28
|
register_bool :append
|
30
29
|
register_bool :groups
|
@@ -37,7 +36,7 @@ class Settings < CORL.plugin_class(:nucleon, :cloud_action)
|
|
37
36
|
#---
|
38
37
|
|
39
38
|
def ignore
|
40
|
-
|
39
|
+
node_ignore
|
41
40
|
end
|
42
41
|
|
43
42
|
def arguments
|
@@ -48,28 +47,28 @@ class Settings < CORL.plugin_class(:nucleon, :cloud_action)
|
|
48
47
|
# Operations
|
49
48
|
|
50
49
|
def execute
|
51
|
-
super do |node
|
52
|
-
ensure_network
|
50
|
+
super do |node|
|
51
|
+
ensure_network do
|
53
52
|
if settings[:groups]
|
54
|
-
render_groups
|
53
|
+
render_groups
|
55
54
|
|
56
55
|
elsif settings[:group].empty?
|
57
|
-
render_settings
|
56
|
+
render_settings
|
58
57
|
|
59
58
|
elsif settings[:name].empty?
|
60
|
-
render_settings(
|
59
|
+
render_settings(settings[:group])
|
61
60
|
|
62
61
|
else
|
63
62
|
name = settings[:name].gsub(/\]$/, '').split(/\]?\[/)
|
64
63
|
|
65
64
|
if settings.get(:delete, false)
|
66
|
-
delete_settings(
|
65
|
+
delete_settings(name)
|
67
66
|
|
68
67
|
elsif ! settings[:value].empty?
|
69
|
-
set_settings(
|
68
|
+
set_settings(name, settings[:value])
|
70
69
|
|
71
70
|
else
|
72
|
-
render_settings(
|
71
|
+
render_settings([ settings[:group], name ])
|
73
72
|
end
|
74
73
|
end
|
75
74
|
end
|
@@ -77,12 +76,12 @@ class Settings < CORL.plugin_class(:nucleon, :cloud_action)
|
|
77
76
|
end
|
78
77
|
|
79
78
|
#-----------------------------------------------------------------------------
|
80
|
-
#
|
79
|
+
# Settings operations
|
81
80
|
|
82
|
-
def render_groups
|
81
|
+
def render_groups
|
83
82
|
groups = network.config.get(:settings).keys
|
84
83
|
|
85
|
-
info(
|
84
|
+
info('groups')
|
86
85
|
groups.each do |group|
|
87
86
|
info("-> #{green(group)}", { :i18n => false })
|
88
87
|
end
|
@@ -90,7 +89,7 @@ class Settings < CORL.plugin_class(:nucleon, :cloud_action)
|
|
90
89
|
|
91
90
|
#---
|
92
91
|
|
93
|
-
def render_settings(
|
92
|
+
def render_settings(elements = [])
|
94
93
|
format = settings[:format]
|
95
94
|
|
96
95
|
if elements.size > 0
|
@@ -103,27 +102,31 @@ class Settings < CORL.plugin_class(:nucleon, :cloud_action)
|
|
103
102
|
|
104
103
|
#---
|
105
104
|
|
106
|
-
def delete_settings(
|
105
|
+
def delete_settings(property)
|
107
106
|
group = settings[:group]
|
108
107
|
name = parse_property_name(property)
|
109
|
-
remote_text = remote_message(
|
108
|
+
remote_text = remote_message(settings[:net_remote])
|
109
|
+
|
110
|
+
render_options = { :group => blue(group), :name => blue(name), :remote_text => yellow(remote_text) }
|
110
111
|
|
111
112
|
network.config.delete([ :settings, group, property ])
|
112
113
|
|
113
|
-
if network.save({ :remote =>
|
114
|
-
success(
|
114
|
+
if network.save({ :remote => settings[:net_remote], :message => "Deleting #{group} setting #{name}", :allow_empty => true })
|
115
|
+
success('delete', render_options)
|
115
116
|
else
|
116
|
-
error(
|
117
|
+
error('delete', render_options)
|
117
118
|
myself.status = code.settings_delete_failed
|
118
119
|
end
|
119
120
|
end
|
120
121
|
|
121
122
|
#---
|
122
123
|
|
123
|
-
def set_settings(
|
124
|
+
def set_settings(property, values)
|
124
125
|
group = settings[:group]
|
125
126
|
name = parse_property_name(property)
|
126
|
-
remote_text = remote_message(
|
127
|
+
remote_text = remote_message(settings[:net_remote])
|
128
|
+
|
129
|
+
render_options = { :group => blue(group), :name => blue(name), :remote_text => yellow(remote_text) }
|
127
130
|
|
128
131
|
input_format = settings[:input_format]
|
129
132
|
|
@@ -145,7 +148,9 @@ class Settings < CORL.plugin_class(:nucleon, :cloud_action)
|
|
145
148
|
values = prev_value
|
146
149
|
end
|
147
150
|
else
|
148
|
-
if
|
151
|
+
if settings[:array]
|
152
|
+
values = array(values)
|
153
|
+
elsif values.size == 1
|
149
154
|
values = values[0]
|
150
155
|
end
|
151
156
|
end
|
@@ -153,32 +158,13 @@ class Settings < CORL.plugin_class(:nucleon, :cloud_action)
|
|
153
158
|
myself.result = values
|
154
159
|
network.config.set([ :settings, group, property ], result)
|
155
160
|
|
156
|
-
if network.save({ :remote =>
|
157
|
-
success(
|
161
|
+
if network.save({ :remote => settings[:net_remote], :message => "Updating #{group} setting #{name}", :allow_empty => true })
|
162
|
+
success('update', render_options)
|
158
163
|
else
|
159
|
-
error(
|
164
|
+
error('update', render_options)
|
160
165
|
myself.status = code.settings_save_failed
|
161
166
|
end
|
162
167
|
end
|
163
|
-
|
164
|
-
#-----------------------------------------------------------------------------
|
165
|
-
# Utilities
|
166
|
-
|
167
|
-
def parse_property_name(property)
|
168
|
-
property = property.clone
|
169
|
-
|
170
|
-
if property.size > 1
|
171
|
-
property.shift.to_s + '[' + property.join('][') + ']'
|
172
|
-
else
|
173
|
-
property.shift.to_s
|
174
|
-
end
|
175
|
-
end
|
176
|
-
|
177
|
-
#---
|
178
|
-
|
179
|
-
def remote_message(remote)
|
180
|
-
remote ? "#{remote}" : "LOCAL ONLY"
|
181
|
-
end
|
182
168
|
end
|
183
169
|
end
|
184
170
|
end
|
@@ -19,41 +19,58 @@ class Vagrantfile < CORL.plugin_class(:nucleon, :cloud_action)
|
|
19
19
|
codes :vagrant_backup_failure,
|
20
20
|
:vagrant_save_failure,
|
21
21
|
:network_save_failure
|
22
|
+
|
23
|
+
register_bool :save
|
22
24
|
end
|
23
25
|
end
|
24
26
|
|
27
|
+
#---
|
28
|
+
|
29
|
+
def ignore
|
30
|
+
node_ignore
|
31
|
+
end
|
32
|
+
|
25
33
|
#-----------------------------------------------------------------------------
|
26
34
|
# Action operations
|
27
35
|
|
28
36
|
def execute
|
29
|
-
super do |node
|
30
|
-
|
31
|
-
|
32
|
-
ensure_network(network) do
|
37
|
+
super do |node|
|
38
|
+
ensure_network do
|
33
39
|
generated_vagrantfile_name = File.join(CORL.lib_path, 'core', 'vagrant', 'Vagrantfile')
|
34
40
|
project_vagrantfile_name = File.join(network.directory, 'Vagrantfile')
|
35
41
|
success = true
|
36
42
|
|
37
43
|
corl_vagrantfile = Util::Disk.read(generated_vagrantfile_name)
|
38
44
|
|
39
|
-
if
|
40
|
-
|
41
|
-
|
42
|
-
|
45
|
+
if settings[:save]
|
46
|
+
if File.exists?(project_vagrantfile_name)
|
47
|
+
backup_file = "#{project_vagrantfile_name}.backup"
|
48
|
+
|
49
|
+
unless FileUtils.mv(project_vagrantfile_name, backup_file, :force => true)
|
50
|
+
error('file_save', { :file => blue(backup_file) })
|
51
|
+
myself.status = code.vagrant_backup_failure
|
52
|
+
success = false
|
53
|
+
end
|
43
54
|
end
|
44
|
-
end
|
45
55
|
|
46
|
-
if success
|
47
|
-
unless Util::Disk.write(project_vagrantfile_name, corl_vagrantfile)
|
48
|
-
myself.status = code.vagrant_save_failure
|
49
|
-
success = false
|
50
|
-
end
|
51
|
-
|
52
56
|
if success
|
53
|
-
unless
|
54
|
-
|
57
|
+
unless Util::Disk.write(project_vagrantfile_name, corl_vagrantfile)
|
58
|
+
error('file_save', { :file => blue(project_vagrantfile_name) })
|
59
|
+
myself.status = code.vagrant_save_failure
|
60
|
+
success = false
|
61
|
+
end
|
62
|
+
|
63
|
+
if success
|
64
|
+
if network.save({ :files => 'Vagrantfile', :remote => settings[:net_remote], :message => "Saving new Vagrantfile.", :allow_empty => true })
|
65
|
+
success('update', { :file => blue('Vagrantfile'), :remote_text => yellow(remote_message(settings[:net_remote])) })
|
66
|
+
else
|
67
|
+
error('update', { :file => blue('Vagrantfile') })
|
68
|
+
myself.status = code.network_save_failure
|
69
|
+
end
|
55
70
|
end
|
56
71
|
end
|
72
|
+
else
|
73
|
+
puts corl_vagrantfile
|
57
74
|
end
|
58
75
|
end
|
59
76
|
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
module Nucleon
|
3
3
|
module Action
|
4
4
|
module Node
|
5
|
-
class IP <
|
5
|
+
class IP < Nucleon.plugin_class(:nucleon, :cloud_action)
|
6
6
|
|
7
7
|
#-----------------------------------------------------------------------------
|
8
8
|
# Info
|
@@ -18,7 +18,7 @@ class IP < CORL.plugin_class(:nucleon, :cloud_action)
|
|
18
18
|
# Operations
|
19
19
|
|
20
20
|
def execute
|
21
|
-
super do |node
|
21
|
+
super do |node|
|
22
22
|
ensure_node(node) do
|
23
23
|
render(CORL.public_ip)
|
24
24
|
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
module Nucleon
|
3
3
|
module Action
|
4
4
|
module Node
|
5
|
-
class SSH <
|
5
|
+
class SSH < Nucleon.plugin_class(:nucleon, :cloud_action)
|
6
6
|
|
7
7
|
#-----------------------------------------------------------------------------
|
8
8
|
# Info
|
@@ -53,8 +53,8 @@ class SSH < CORL.plugin_class(:nucleon, :cloud_action)
|
|
53
53
|
# Operations
|
54
54
|
|
55
55
|
def execute
|
56
|
-
super do |local_node
|
57
|
-
ensure_network
|
56
|
+
super do |local_node|
|
57
|
+
ensure_network do
|
58
58
|
batch_success = network.batch(settings[:ssh_nodes], settings[:node_provider], false) do |node|
|
59
59
|
render_options = { :id => node.id, :hostname => node.hostname }
|
60
60
|
|
@@ -2,7 +2,7 @@
|
|
2
2
|
module Nucleon
|
3
3
|
module Action
|
4
4
|
module Node
|
5
|
-
class Authorize <
|
5
|
+
class Authorize < Nucleon.plugin_class(:nucleon, :cloud_action)
|
6
6
|
|
7
7
|
#-----------------------------------------------------------------------------
|
8
8
|
# Info
|
@@ -33,7 +33,7 @@ class Authorize < 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.authorize.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 Bootstrap <
|
5
|
+
class Bootstrap < Nucleon.plugin_class(:nucleon, :cloud_action)
|
6
6
|
|
7
7
|
#-----------------------------------------------------------------------------
|
8
8
|
# Info
|
@@ -16,31 +16,18 @@ class Bootstrap < CORL.plugin_class(:nucleon, :cloud_action)
|
|
16
16
|
|
17
17
|
def configure
|
18
18
|
super do
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
success
|
28
|
-
end
|
29
|
-
register :home_env_var, :str, 'HOME'
|
30
|
-
register :home, :str, nil
|
31
|
-
register :bootstrap_path, :str, File.join(CORL.lib_path, '..', 'bootstrap') do |value|
|
32
|
-
unless File.directory?(value)
|
33
|
-
warn('corl.actions.bootstrap.errors.bootstrap_path', { :value => value })
|
34
|
-
next false
|
35
|
-
end
|
36
|
-
true
|
37
|
-
end
|
38
|
-
register :bootstrap_glob, :str, '**/*.sh'
|
39
|
-
register :bootstrap_init, :str, 'bootstrap.sh'
|
19
|
+
register_directory :bootstrap_path, File.join(CORL.lib_path, '..', 'bootstrap')
|
20
|
+
register_files :auth_files
|
21
|
+
|
22
|
+
register_str :home_env_var, 'HOME'
|
23
|
+
register_str :home, nil
|
24
|
+
|
25
|
+
register_str :bootstrap_glob, '**/*.sh'
|
26
|
+
register_str :bootstrap_init, 'bootstrap.sh'
|
40
27
|
|
41
|
-
|
28
|
+
register_array :bootstrap_nodes, nil do |values|
|
42
29
|
if values.nil?
|
43
|
-
warn('
|
30
|
+
warn('bootstrap_nodes_empty')
|
44
31
|
next false
|
45
32
|
end
|
46
33
|
|
@@ -50,7 +37,7 @@ class Bootstrap < CORL.plugin_class(:nucleon, :cloud_action)
|
|
50
37
|
values.each do |value|
|
51
38
|
if info = CORL.plugin_class(:CORL, :node).translate_reference(value)
|
52
39
|
if ! node_plugins.keys.include?(info[:provider].to_sym) || info[:name].empty?
|
53
|
-
warn('
|
40
|
+
warn('bootstrap_nodes', { :value => value, :node_provider => info[:provider], :name => info[:name] })
|
54
41
|
success = false
|
55
42
|
end
|
56
43
|
end
|
@@ -74,18 +61,18 @@ class Bootstrap < CORL.plugin_class(:nucleon, :cloud_action)
|
|
74
61
|
# Operations
|
75
62
|
|
76
63
|
def execute
|
77
|
-
super do |local_node
|
78
|
-
ensure_network
|
64
|
+
super do |local_node|
|
65
|
+
ensure_network do
|
79
66
|
batch_success = network.batch(settings[:bootstrap_nodes], settings[:node_provider], settings[:parallel]) do |node|
|
80
67
|
render_options = { :id => node.id, :hostname => node.hostname }
|
81
68
|
|
82
|
-
info('
|
69
|
+
info('start', render_options)
|
83
70
|
success = node.bootstrap(network.home, extended_config(:bootstrap, settings.clone))
|
84
71
|
if success
|
85
|
-
|
72
|
+
success('complete', render_options)
|
86
73
|
else
|
87
74
|
render_options[:status] = node.status
|
88
|
-
error('
|
75
|
+
error('failure', render_options)
|
89
76
|
end
|
90
77
|
success
|
91
78
|
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
module Nucleon
|
3
3
|
module Action
|
4
4
|
module Node
|
5
|
-
class Build <
|
5
|
+
class Build < Nucleon.plugin_class(:nucleon, :cloud_action)
|
6
6
|
|
7
7
|
#-----------------------------------------------------------------------------
|
8
8
|
# Info
|
@@ -16,7 +16,7 @@ class Build < CORL.plugin_class(:nucleon, :cloud_action)
|
|
16
16
|
|
17
17
|
def configure
|
18
18
|
super do
|
19
|
-
|
19
|
+
register_str :environment
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
@@ -30,8 +30,8 @@ class Build < CORL.plugin_class(:nucleon, :cloud_action)
|
|
30
30
|
# Operations
|
31
31
|
|
32
32
|
def execute
|
33
|
-
super do |node
|
34
|
-
info('
|
33
|
+
super do |node|
|
34
|
+
info('start')
|
35
35
|
ensure_node(node) do
|
36
36
|
settings.delete(:environment) if settings[:environment] == ''
|
37
37
|
|
@@ -2,9 +2,7 @@
|
|
2
2
|
module Nucleon
|
3
3
|
module Action
|
4
4
|
module Node
|
5
|
-
class Cache <
|
6
|
-
|
7
|
-
include Mixin::Action::Registration
|
5
|
+
class Cache < Nucleon.plugin_class(:nucleon, :cloud_action)
|
8
6
|
|
9
7
|
#-----------------------------------------------------------------------------
|
10
8
|
# Info
|
@@ -41,7 +39,7 @@ class Cache < CORL.plugin_class(:nucleon, :cloud_action)
|
|
41
39
|
# Operations
|
42
40
|
|
43
41
|
def execute
|
44
|
-
super do |node
|
42
|
+
super do |node|
|
45
43
|
ensure_node(node) do
|
46
44
|
if settings.delete(:clear, false)
|
47
45
|
clear_node_cache(node)
|
@@ -2,7 +2,7 @@
|
|
2
2
|
module Nucleon
|
3
3
|
module Action
|
4
4
|
module Node
|
5
|
-
class Destroy <
|
5
|
+
class Destroy < Nucleon.plugin_class(:nucleon, :cloud_action)
|
6
6
|
|
7
7
|
#-----------------------------------------------------------------------------
|
8
8
|
# Info
|
@@ -16,25 +16,9 @@ class Destroy < CORL.plugin_class(:nucleon, :cloud_action)
|
|
16
16
|
|
17
17
|
def configure
|
18
18
|
super do
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
next false
|
23
|
-
end
|
24
|
-
|
25
|
-
node_plugins = CORL.loaded_plugins(:CORL, :node)
|
26
|
-
success = true
|
27
|
-
|
28
|
-
values.each do |value|
|
29
|
-
if info = CORL.plugin_class(:CORL, :node).translate_reference(value)
|
30
|
-
if ! node_plugins.keys.include?(info[:provider].to_sym) || info[:name].empty?
|
31
|
-
warn('corl.actions.destroy.errors.destroy_nodes', { :value => value, :node_provider => info[:provider], :name => info[:name] })
|
32
|
-
success = false
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
success
|
37
|
-
end
|
19
|
+
register_bool :force, false
|
20
|
+
|
21
|
+
register_nodes :destroy_nodes
|
38
22
|
end
|
39
23
|
end
|
40
24
|
|
@@ -52,13 +36,28 @@ class Destroy < CORL.plugin_class(:nucleon, :cloud_action)
|
|
52
36
|
# Operations
|
53
37
|
|
54
38
|
def execute
|
55
|
-
super do |local_node
|
56
|
-
ensure_network
|
57
|
-
|
58
|
-
|
59
|
-
|
39
|
+
super do |local_node|
|
40
|
+
ensure_network do
|
41
|
+
if settings[:force]
|
42
|
+
answer = 'YES'
|
43
|
+
else
|
44
|
+
message = render_message('prompt', { :operation => :ask }) + "\n\n"
|
45
|
+
|
46
|
+
array(settings[:destroy_nodes]).each do |hostname|
|
47
|
+
message << " #{hostname}\n"
|
48
|
+
end
|
49
|
+
|
50
|
+
message << "\n" + render_message('yes_query', { :operation => :ask, :yes => 'YES' }) + ' '
|
51
|
+
answer = ask(message)
|
52
|
+
end
|
53
|
+
|
54
|
+
if answer.upcase == 'YES'
|
55
|
+
batch_success = network.batch(settings[:destroy_nodes], settings[:node_provider], settings[:parallel]) do |node|
|
56
|
+
info('start', { :provider => node.plugin_provider, :name => node.plugin_name })
|
57
|
+
node.destroy
|
58
|
+
end
|
59
|
+
myself.status = code.batch_error unless batch_success
|
60
60
|
end
|
61
|
-
myself.status = code.batch_error unless batch_success
|
62
61
|
end
|
63
62
|
end
|
64
63
|
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
module Nucleon
|
3
3
|
module Action
|
4
4
|
module Node
|
5
|
-
class Exec <
|
5
|
+
class Exec < Nucleon.plugin_class(:nucleon, :cloud_action)
|
6
6
|
|
7
7
|
#-----------------------------------------------------------------------------
|
8
8
|
# Info
|
@@ -30,7 +30,7 @@ class Exec < CORL.plugin_class(:nucleon, :cloud_action)
|
|
30
30
|
# Operations
|
31
31
|
|
32
32
|
def execute
|
33
|
-
super do |node
|
33
|
+
super do |node|
|
34
34
|
ensure_node(node) do
|
35
35
|
if settings[:command].length > 1
|
36
36
|
settings[:command].collect! do |value|
|
@@ -2,15 +2,13 @@
|
|
2
2
|
module Nucleon
|
3
3
|
module Action
|
4
4
|
module Node
|
5
|
-
class Fact <
|
6
|
-
|
7
|
-
include Mixin::Action::Registration
|
5
|
+
class Fact < Nucleon.plugin_class(:nucleon, :cloud_action)
|
8
6
|
|
9
7
|
#-----------------------------------------------------------------------------
|
10
8
|
# Info
|
11
9
|
|
12
10
|
def self.describe(action = :fact, weight = 570)
|
13
|
-
|
11
|
+
describe_base(:node, action, weight, nil, nil, :node_fact)
|
14
12
|
end
|
15
13
|
|
16
14
|
#-----------------------------------------------------------------------------
|
@@ -43,7 +41,7 @@ class Fact < 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
|
if ! settings[:name] || settings[:name].empty?
|
49
47
|
render_node_facts(node)
|
@@ -113,6 +111,13 @@ class Fact < CORL.plugin_class(:nucleon, :cloud_action)
|
|
113
111
|
myself.status = code.fact_save_failed
|
114
112
|
end
|
115
113
|
end
|
114
|
+
|
115
|
+
#-----------------------------------------------------------------------------
|
116
|
+
# Output
|
117
|
+
|
118
|
+
def render_provider
|
119
|
+
:node_fact
|
120
|
+
end
|
116
121
|
end
|
117
122
|
end
|
118
123
|
end
|
@@ -2,15 +2,13 @@
|
|
2
2
|
module Nucleon
|
3
3
|
module Action
|
4
4
|
module Node
|
5
|
-
class Group <
|
6
|
-
|
7
|
-
include Mixin::Action::Registration
|
5
|
+
class Group < Nucleon.plugin_class(:nucleon, :cloud_action)
|
8
6
|
|
9
7
|
#-----------------------------------------------------------------------------
|
10
8
|
# Info
|
11
9
|
|
12
10
|
def self.describe(action = :group, weight = 670)
|
13
|
-
|
11
|
+
describe_base(:node, action, weight, nil, nil, :node_group)
|
14
12
|
end
|
15
13
|
|
16
14
|
#-----------------------------------------------------------------------------
|
@@ -41,7 +39,7 @@ class Group < CORL.plugin_class(:nucleon, :cloud_action)
|
|
41
39
|
# Operations
|
42
40
|
|
43
41
|
def execute
|
44
|
-
super do |node
|
42
|
+
super do |node|
|
45
43
|
ensure_node(node) do
|
46
44
|
if ! settings[:name] || settings[:name].empty?
|
47
45
|
render_node_groups(node)
|
@@ -109,6 +107,13 @@ class Group < CORL.plugin_class(:nucleon, :cloud_action)
|
|
109
107
|
myself.status = code.group_save_failed
|
110
108
|
end
|
111
109
|
end
|
110
|
+
|
111
|
+
#-----------------------------------------------------------------------------
|
112
|
+
# Output
|
113
|
+
|
114
|
+
def render_provider
|
115
|
+
:node_group
|
116
|
+
end
|
112
117
|
end
|
113
118
|
end
|
114
119
|
end
|
@@ -2,10 +2,8 @@
|
|
2
2
|
module Nucleon
|
3
3
|
module Action
|
4
4
|
module Node
|
5
|
-
class Identity <
|
6
|
-
|
7
|
-
include Mixin::Action::Registration
|
8
|
-
|
5
|
+
class Identity < Nucleon.plugin_class(:nucleon, :cloud_action)
|
6
|
+
|
9
7
|
#-----------------------------------------------------------------------------
|
10
8
|
# Info
|
11
9
|
|
@@ -20,7 +18,7 @@ class Identity < CORL.plugin_class(:nucleon, :cloud_action)
|
|
20
18
|
super do
|
21
19
|
codes :identity_upload_failure
|
22
20
|
|
23
|
-
|
21
|
+
register_str :name
|
24
22
|
register_project :identity
|
25
23
|
register_nodes :identity_nodes
|
26
24
|
end
|
@@ -40,15 +38,15 @@ class Identity < CORL.plugin_class(:nucleon, :cloud_action)
|
|
40
38
|
# Operations
|
41
39
|
|
42
40
|
def execute
|
43
|
-
super do |local_node
|
44
|
-
ensure_network
|
41
|
+
super do |local_node|
|
42
|
+
ensure_network do
|
45
43
|
builder = network.identity_builder({ settings[:name] => settings[:identity] })
|
46
44
|
|
47
45
|
if builder.build(local_node)
|
48
46
|
identity_directory = File.join(builder.build_directory, settings[:name])
|
49
47
|
|
50
48
|
success = network.batch(settings[:identity_nodes], settings[:node_provider], settings[:parallel]) do |node|
|
51
|
-
info('
|
49
|
+
info('start', { :provider => node.plugin_provider, :name => node.plugin_name })
|
52
50
|
|
53
51
|
remote_network_directory = node.lookup(:corl_network)
|
54
52
|
|
@@ -2,7 +2,7 @@
|
|
2
2
|
module Nucleon
|
3
3
|
module Action
|
4
4
|
module Node
|
5
|
-
class Image <
|
5
|
+
class Image < Nucleon.plugin_class(:nucleon, :cloud_action)
|
6
6
|
|
7
7
|
#-----------------------------------------------------------------------------
|
8
8
|
# Info
|
@@ -52,8 +52,8 @@ class Image < 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[:image_nodes], settings[:node_provider], settings[:parallel]) do |node|
|
58
58
|
info('corl.actions.image.start', { :provider => node.plugin_provider, :name => node.plugin_name })
|
59
59
|
node.create_image
|