corl 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/VERSION +1 -1
- data/bootstrap/os/ubuntu/06_puppet.sh +1 -1
- data/corl.gemspec +171 -3
- data/lib/CORL/builder/identity.rb +6 -3
- data/lib/CORL/builder/package.rb +3 -3
- data/lib/CORL/configuration/file.rb +21 -7
- data/lib/CORL/machine/vagrant.rb +3 -3
- data/lib/CORL/node/vagrant.rb +2 -5
- data/lib/CORL/provisioner/puppetnode.rb +8 -8
- data/lib/core/facade.rb +7 -3
- data/lib/core/mixin/action/keypair.rb +3 -3
- data/lib/core/mixin/action/registration.rb +31 -0
- data/lib/core/mixin/lookup.rb +50 -6
- data/lib/core/mixin/machine/ssh.rb +4 -4
- data/lib/core/plugin/cloud_action.rb +8 -1
- data/lib/core/plugin/configuration.rb +6 -7
- data/lib/core/plugin/fog_node.rb +7 -0
- data/lib/core/plugin/network.rb +31 -0
- data/lib/core/plugin/node.rb +182 -117
- data/lib/core/vagrant/provisioner/provisioner.rb +1 -1
- data/lib/nucleon/action/cloud/config.rb +259 -0
- data/lib/nucleon/action/cloud/images.rb +1 -1
- data/lib/nucleon/action/cloud/inspect.rb +11 -2
- data/lib/nucleon/action/cloud/machines.rb +1 -1
- data/lib/nucleon/action/cloud/regions.rb +1 -1
- data/lib/nucleon/action/cloud/settings.rb +185 -0
- data/lib/nucleon/action/node/IP.rb +1 -1
- data/lib/nucleon/action/node/bootstrap.rb +1 -1
- data/lib/nucleon/action/node/cache.rb +133 -0
- data/lib/nucleon/action/node/fact.rb +119 -0
- data/lib/nucleon/action/node/facts.rb +16 -16
- data/lib/nucleon/action/node/group.rb +115 -0
- data/lib/nucleon/action/node/groups.rb +33 -0
- data/lib/nucleon/action/node/identity.rb +75 -0
- data/lib/nucleon/action/node/lookup.rb +20 -7
- data/lib/nucleon/action/node/seed.rb +6 -6
- data/lib/nucleon/action/node/status.rb +76 -0
- data/lib/nucleon/action/plugin/create.rb +169 -0
- data/lib/nucleon/action/plugin/list.rb +69 -0
- data/lib/nucleon/action/plugin/template/nucleon.action.erb +56 -0
- data/lib/nucleon/action/plugins.rb +14 -0
- data/locales/en.yml +3 -0
- data/rdoc/site/0.5.0/CORL/Build.html +757 -0
- data/rdoc/site/0.5.0/CORL/Builder/Identity.html +569 -0
- data/rdoc/site/0.5.0/CORL/Builder/Package.html +576 -0
- data/rdoc/site/0.5.0/CORL/Builder.html +360 -0
- data/rdoc/site/0.5.0/CORL/Configuration/File.html +1148 -0
- data/rdoc/site/0.5.0/CORL/Configuration.html +359 -0
- data/rdoc/site/0.5.0/CORL/Errors.html +359 -0
- data/rdoc/site/0.5.0/CORL/Facade.html +899 -0
- data/rdoc/site/0.5.0/CORL/Machine/AWS.html +753 -0
- data/rdoc/site/0.5.0/CORL/Machine/Fog.html +1289 -0
- data/rdoc/site/0.5.0/CORL/Machine/Physical.html +1059 -0
- data/rdoc/site/0.5.0/CORL/Machine/Rackspace.html +534 -0
- data/rdoc/site/0.5.0/CORL/Machine/Vagrant.html +1320 -0
- data/rdoc/site/0.5.0/CORL/Machine.html +363 -0
- data/rdoc/site/0.5.0/CORL/Mixin/Action/Keypair.html +592 -0
- data/rdoc/site/0.5.0/CORL/Mixin/Action.html +359 -0
- data/rdoc/site/0.5.0/CORL/Mixin/Builder/Global.html +604 -0
- data/rdoc/site/0.5.0/CORL/Mixin/Builder/Instance.html +696 -0
- data/rdoc/site/0.5.0/CORL/Mixin/Builder.html +359 -0
- data/rdoc/site/0.5.0/CORL/Mixin/Lookup.html +1139 -0
- data/rdoc/site/0.5.0/CORL/Mixin/Machine/SSH.html +675 -0
- data/rdoc/site/0.5.0/CORL/Mixin/Machine.html +359 -0
- data/rdoc/site/0.5.0/CORL/Mixin/Macro/NetworkSettings.html +484 -0
- data/rdoc/site/0.5.0/CORL/Mixin/Macro.html +359 -0
- data/rdoc/site/0.5.0/CORL/Mixin.html +363 -0
- data/rdoc/site/0.5.0/CORL/Network/CORL.html +411 -0
- data/rdoc/site/0.5.0/CORL/Network.html +359 -0
- data/rdoc/site/0.5.0/CORL/Node/AWS.html +736 -0
- data/rdoc/site/0.5.0/CORL/Node/Fog.html +1212 -0
- data/rdoc/site/0.5.0/CORL/Node/Local.html +444 -0
- data/rdoc/site/0.5.0/CORL/Node/Rackspace.html +729 -0
- data/rdoc/site/0.5.0/CORL/Node/Vagrant.html +1476 -0
- data/rdoc/site/0.5.0/CORL/Node.html +363 -0
- data/rdoc/site/0.5.0/CORL/Plugin/Builder.html +500 -0
- data/rdoc/site/0.5.0/CORL/Plugin/Configuration.html +1271 -0
- data/rdoc/site/0.5.0/CORL/Plugin/Machine.html +1299 -0
- data/rdoc/site/0.5.0/CORL/Plugin/Network.html +1580 -0
- data/rdoc/site/0.5.0/CORL/Plugin/Node.html +4041 -0
- data/rdoc/site/0.5.0/CORL/Plugin/Provisioner.html +1115 -0
- data/rdoc/site/0.5.0/CORL/Plugin.html +649 -0
- data/rdoc/site/0.5.0/CORL/Provisioner/Puppetnode.html +1177 -0
- data/rdoc/site/0.5.0/CORL/Provisioner.html +359 -0
- data/rdoc/site/0.5.0/CORL/Util/Puppet/Resource.html +1058 -0
- data/rdoc/site/0.5.0/CORL/Util/Puppet/ResourceGroup.html +940 -0
- data/rdoc/site/0.5.0/CORL/Util/Puppet.html +1107 -0
- data/rdoc/site/0.5.0/CORL/Util.html +361 -0
- data/rdoc/site/0.5.0/CORL/Vagrant/Config.html +943 -0
- data/rdoc/site/0.5.0/CORL/Vagrant.html +438 -0
- data/rdoc/site/0.5.0/CORL.html +471 -0
- data/rdoc/site/0.5.0/Fog/Compute/AWS/Server.html +443 -0
- data/rdoc/site/0.5.0/Fog/Compute/AWS.html +365 -0
- data/rdoc/site/0.5.0/Fog/Compute/RackspaceV2/Server.html +428 -0
- data/rdoc/site/0.5.0/Fog/Compute/RackspaceV2.html +365 -0
- data/rdoc/site/0.5.0/Fog/Compute.html +360 -0
- data/rdoc/site/0.5.0/Fog.html +360 -0
- data/rdoc/site/0.5.0/Hiera/Backend.html +442 -0
- data/rdoc/site/0.5.0/Hiera/Corl_logger.html +469 -0
- data/rdoc/site/0.5.0/Hiera.html +366 -0
- data/rdoc/site/0.5.0/Nucleon/Action/Cloud/Create.html +538 -0
- data/rdoc/site/0.5.0/Nucleon/Action/Cloud/Hiera.html +566 -0
- data/rdoc/site/0.5.0/Nucleon/Action/Cloud/Images.html +572 -0
- data/rdoc/site/0.5.0/Nucleon/Action/Cloud/Inspect.html +524 -0
- data/rdoc/site/0.5.0/Nucleon/Action/Cloud/Machines.html +567 -0
- data/rdoc/site/0.5.0/Nucleon/Action/Cloud/Regions.html +567 -0
- data/rdoc/site/0.5.0/Nucleon/Action/Cloud/Vagrantfile.html +515 -0
- data/rdoc/site/0.5.0/Nucleon/Action/Cloud.html +365 -0
- data/rdoc/site/0.5.0/Nucleon/Action/Node/Authorize.html +543 -0
- data/rdoc/site/0.5.0/Nucleon/Action/Node/Bootstrap.html +604 -0
- data/rdoc/site/0.5.0/Nucleon/Action/Node/Build.html +526 -0
- data/rdoc/site/0.5.0/Nucleon/Action/Node/Destroy.html +573 -0
- data/rdoc/site/0.5.0/Nucleon/Action/Node/Exec.html +530 -0
- data/rdoc/site/0.5.0/Nucleon/Action/Node/Facts.html +456 -0
- data/rdoc/site/0.5.0/Nucleon/Action/Node/IP.html +453 -0
- data/rdoc/site/0.5.0/Nucleon/Action/Node/Image.html +573 -0
- data/rdoc/site/0.5.0/Nucleon/Action/Node/Keypair.html +572 -0
- data/rdoc/site/0.5.0/Nucleon/Action/Node/Lookup.html +532 -0
- data/rdoc/site/0.5.0/Nucleon/Action/Node/Provision.html +553 -0
- data/rdoc/site/0.5.0/Nucleon/Action/Node/Reboot.html +573 -0
- data/rdoc/site/0.5.0/Nucleon/Action/Node/Revoke.html +541 -0
- data/rdoc/site/0.5.0/Nucleon/Action/Node/SSH.html +583 -0
- data/rdoc/site/0.5.0/Nucleon/Action/Node/Seed.html +602 -0
- data/rdoc/site/0.5.0/Nucleon/Action/Node/Spawn.html +675 -0
- data/rdoc/site/0.5.0/Nucleon/Action/Node/Start.html +573 -0
- data/rdoc/site/0.5.0/Nucleon/Action/Node/Stop.html +573 -0
- data/rdoc/site/0.5.0/Nucleon/Action/Node.html +376 -0
- data/rdoc/site/0.5.0/Nucleon/Action.html +383 -0
- data/rdoc/site/0.5.0/Nucleon/Config.html +377 -0
- data/rdoc/site/0.5.0/Nucleon/Event/Puppet.html +693 -0
- data/rdoc/site/0.5.0/Nucleon/Event.html +359 -0
- data/rdoc/site/0.5.0/Nucleon/Plugin/Base.html +365 -0
- data/rdoc/site/0.5.0/Nucleon/Plugin/CloudAction.html +838 -0
- data/rdoc/site/0.5.0/Nucleon/Plugin.html +360 -0
- data/rdoc/site/0.5.0/Nucleon/Template/Environment.html +548 -0
- data/rdoc/site/0.5.0/Nucleon/Template.html +359 -0
- data/rdoc/site/0.5.0/Nucleon.html +387 -0
- data/rdoc/site/0.5.0/Object.html +378 -0
- data/rdoc/site/0.5.0/Puppet/DataBinding/Corl.html +365 -0
- data/rdoc/site/0.5.0/Puppet/DataBinding.html +358 -0
- data/rdoc/site/0.5.0/Puppet/Indirector/Corl.html +477 -0
- data/rdoc/site/0.5.0/Puppet/Indirector.html +358 -0
- data/rdoc/site/0.5.0/Puppet/Parser/Functions.html +500 -0
- data/rdoc/site/0.5.0/Puppet/Parser.html +358 -0
- data/rdoc/site/0.5.0/Puppet.html +358 -0
- data/rdoc/site/0.5.0/README_rdoc.html +360 -0
- data/rdoc/site/0.5.0/Vagrant/Config/Loader.html +419 -0
- data/rdoc/site/0.5.0/Vagrant/Config.html +359 -0
- data/rdoc/site/0.5.0/Vagrant/Vagrantfile.html +412 -0
- data/rdoc/site/0.5.0/Vagrant.html +366 -0
- data/rdoc/site/0.5.0/VagrantPlugins/CORL/Action/DeleteCache.html +422 -0
- data/rdoc/site/0.5.0/VagrantPlugins/CORL/Action/InitKeys.html +428 -0
- data/rdoc/site/0.5.0/VagrantPlugins/CORL/Action/LinkNetwork.html +426 -0
- data/rdoc/site/0.5.0/VagrantPlugins/CORL/Action.html +361 -0
- data/rdoc/site/0.5.0/VagrantPlugins/CORL/BaseAction.html +511 -0
- data/rdoc/site/0.5.0/VagrantPlugins/CORL/Command/Launcher.html +553 -0
- data/rdoc/site/0.5.0/VagrantPlugins/CORL/Command.html +359 -0
- data/rdoc/site/0.5.0/VagrantPlugins/CORL/Config/CORL.html +752 -0
- data/rdoc/site/0.5.0/VagrantPlugins/CORL/Config.html +359 -0
- data/rdoc/site/0.5.0/VagrantPlugins/CORL/Plugin.html +365 -0
- data/rdoc/site/0.5.0/VagrantPlugins/CORL/Provisioner/CORL.html +556 -0
- data/rdoc/site/0.5.0/VagrantPlugins/CORL/Provisioner.html +359 -0
- data/rdoc/site/0.5.0/VagrantPlugins/CORL.html +366 -0
- data/rdoc/site/0.5.0/VagrantPlugins.html +366 -0
- data/rdoc/site/0.5.0/created.rid +103 -0
- data/rdoc/site/0.5.0/images/add.png +0 -0
- data/rdoc/site/0.5.0/images/brick.png +0 -0
- data/rdoc/site/0.5.0/images/brick_link.png +0 -0
- data/rdoc/site/0.5.0/images/bug.png +0 -0
- data/rdoc/site/0.5.0/images/bullet_black.png +0 -0
- data/rdoc/site/0.5.0/images/bullet_toggle_minus.png +0 -0
- data/rdoc/site/0.5.0/images/bullet_toggle_plus.png +0 -0
- data/rdoc/site/0.5.0/images/date.png +0 -0
- data/rdoc/site/0.5.0/images/delete.png +0 -0
- data/rdoc/site/0.5.0/images/find.png +0 -0
- data/rdoc/site/0.5.0/images/loadingAnimation.gif +0 -0
- data/rdoc/site/0.5.0/images/macFFBgHack.png +0 -0
- data/rdoc/site/0.5.0/images/package.png +0 -0
- data/rdoc/site/0.5.0/images/page_green.png +0 -0
- data/rdoc/site/0.5.0/images/page_white_text.png +0 -0
- data/rdoc/site/0.5.0/images/page_white_width.png +0 -0
- data/rdoc/site/0.5.0/images/plugin.png +0 -0
- data/rdoc/site/0.5.0/images/ruby.png +0 -0
- data/rdoc/site/0.5.0/images/tag_blue.png +0 -0
- data/rdoc/site/0.5.0/images/tag_green.png +0 -0
- data/rdoc/site/0.5.0/images/transparent.png +0 -0
- data/rdoc/site/0.5.0/images/wrench.png +0 -0
- data/rdoc/site/0.5.0/images/wrench_orange.png +0 -0
- data/rdoc/site/0.5.0/images/zoom.png +0 -0
- data/rdoc/site/0.5.0/index.html +359 -0
- data/rdoc/site/0.5.0/js/darkfish.js +155 -0
- data/rdoc/site/0.5.0/js/jquery.js +18 -0
- data/rdoc/site/0.5.0/js/navigation.js +142 -0
- data/rdoc/site/0.5.0/js/search.js +94 -0
- data/rdoc/site/0.5.0/js/search_index.js +1 -0
- data/rdoc/site/0.5.0/js/searcher.js +228 -0
- data/rdoc/site/0.5.0/rdoc.css +543 -0
- data/rdoc/site/0.5.0/table_of_contents.html +1797 -0
- metadata +171 -3
- data/lib/nucleon/action/cloud/hiera.rb +0 -61
@@ -0,0 +1,169 @@
|
|
1
|
+
|
2
|
+
module Nucleon
|
3
|
+
module Action
|
4
|
+
module Plugin
|
5
|
+
class Create < CORL.plugin_class(:nucleon, :cloud_action)
|
6
|
+
|
7
|
+
include Mixin::Action::Registration
|
8
|
+
|
9
|
+
#-----------------------------------------------------------------------------
|
10
|
+
# Info
|
11
|
+
|
12
|
+
def self.describe
|
13
|
+
Nucleon.dump_enabled = true
|
14
|
+
super(:plugin, :create, 10)
|
15
|
+
end
|
16
|
+
|
17
|
+
#-----------------------------------------------------------------------------
|
18
|
+
# Settings
|
19
|
+
|
20
|
+
def strict?
|
21
|
+
false # Allow extra settings
|
22
|
+
end
|
23
|
+
|
24
|
+
def configure
|
25
|
+
super do
|
26
|
+
codes :no_template_file,
|
27
|
+
:template_file_parse_failed,
|
28
|
+
:plugin_already_exists,
|
29
|
+
:plugin_save_failed
|
30
|
+
|
31
|
+
register_str :type, :action do |value|
|
32
|
+
namespace = nil
|
33
|
+
components = value.to_s.split(':::')
|
34
|
+
|
35
|
+
if components.size > 1
|
36
|
+
namespace = components[0].to_sym
|
37
|
+
value = components[1]
|
38
|
+
end
|
39
|
+
value = value.to_sym
|
40
|
+
|
41
|
+
Nucleon.namespaces.each do |plugin_namespace|
|
42
|
+
if ! namespace || namespace == plugin_namespace
|
43
|
+
if Nucleon.types(plugin_namespace).include?(value)
|
44
|
+
@plugin_namespace = plugin_namespace
|
45
|
+
@plugin_type = value
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
@plugin_namespace ? true : false
|
50
|
+
end
|
51
|
+
register_array :name, nil
|
52
|
+
|
53
|
+
register_bool :save
|
54
|
+
register_bool :interpolate
|
55
|
+
|
56
|
+
register_directory :template_path
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
#---
|
61
|
+
|
62
|
+
def ignore
|
63
|
+
node_ignore
|
64
|
+
end
|
65
|
+
|
66
|
+
def arguments
|
67
|
+
[ :type, :name ]
|
68
|
+
end
|
69
|
+
|
70
|
+
#-----------------------------------------------------------------------------
|
71
|
+
# Operations
|
72
|
+
|
73
|
+
def execute
|
74
|
+
super do |node, network|
|
75
|
+
ensure_network(network) do
|
76
|
+
require 'erubis'
|
77
|
+
|
78
|
+
type = settings[:type].to_sym
|
79
|
+
name = settings[:name]
|
80
|
+
|
81
|
+
unless template_path = settings.delete(:template_path)
|
82
|
+
template_path = File.join(File.dirname(__FILE__), 'template')
|
83
|
+
end
|
84
|
+
|
85
|
+
templates = Dir.glob("#{template_path}/**/*.erb")
|
86
|
+
template = nil
|
87
|
+
|
88
|
+
templates.each do |template_file|
|
89
|
+
if template_file =~ /#{@plugin_namespace}\.#{@plugin_type}\.erb/
|
90
|
+
template = template_file
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
if template
|
95
|
+
template_contents = Util::Disk.read(template)
|
96
|
+
|
97
|
+
unless template_contents
|
98
|
+
error("Template file #{template} for #{@plugin_namespace}.#{@plugin_type} could not be parsed", { :i18n => false })
|
99
|
+
myself.status = code.template_file_parse_failed
|
100
|
+
next
|
101
|
+
end
|
102
|
+
template = template_contents
|
103
|
+
end
|
104
|
+
|
105
|
+
unless template
|
106
|
+
error("No template file exists for #{template_path}#{File::SEPARATOR}#{@plugin_namespace}.#{@plugin_type}.erb", { :i18n => false })
|
107
|
+
myself.status = code.no_template_file
|
108
|
+
next
|
109
|
+
end
|
110
|
+
|
111
|
+
save_path = File.join(network.directory, 'lib', @plugin_namespace.to_s, @plugin_type.to_s)
|
112
|
+
save_file = File.join(save_path, name.join(File::SEPARATOR) + '.rb')
|
113
|
+
plugin_file = nil
|
114
|
+
|
115
|
+
if File.exists?(save_file)
|
116
|
+
error("Plugin already exists at #{save_file}", { :i18n => false })
|
117
|
+
myself.status = code.plugin_already_exists
|
118
|
+
next
|
119
|
+
end
|
120
|
+
|
121
|
+
settings.import({
|
122
|
+
:plugin_class => name.pop,
|
123
|
+
:plugin_groups => name
|
124
|
+
})
|
125
|
+
|
126
|
+
renderer = Erubis::Eruby.new(template)
|
127
|
+
parse = true
|
128
|
+
|
129
|
+
while(parse)
|
130
|
+
begin
|
131
|
+
plugin_file = renderer.result(settings.export)
|
132
|
+
parse = false
|
133
|
+
|
134
|
+
rescue NameError => error
|
135
|
+
settings.set(error.name, nil)
|
136
|
+
|
137
|
+
rescue => error
|
138
|
+
raise error
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
142
|
+
if settings.delete(:save)
|
143
|
+
# Save template to file within network project
|
144
|
+
save_directory = File.dirname(save_file)
|
145
|
+
|
146
|
+
FileUtils.mkdir_p(save_directory)
|
147
|
+
|
148
|
+
if Util::Disk.write(save_file, plugin_file)
|
149
|
+
success("Plugin successfully saved to #{save_file}", { :i18n => false })
|
150
|
+
else
|
151
|
+
error("Plugin can not be saved to #{save_file}", { :i18n => false })
|
152
|
+
myself.status = code.plugin_save_failed
|
153
|
+
end
|
154
|
+
else
|
155
|
+
info("Plugin: #{blue(save_file)}", { :i18n => false })
|
156
|
+
# Render template ONLY (testing)
|
157
|
+
if settings.delete(:interpolate)
|
158
|
+
puts green(plugin_file)
|
159
|
+
else
|
160
|
+
puts green(template)
|
161
|
+
end
|
162
|
+
end
|
163
|
+
end
|
164
|
+
end
|
165
|
+
end
|
166
|
+
end
|
167
|
+
end
|
168
|
+
end
|
169
|
+
end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
|
2
|
+
module Nucleon
|
3
|
+
module Action
|
4
|
+
module Plugin
|
5
|
+
class List < CORL.plugin_class(:nucleon, :cloud_action)
|
6
|
+
|
7
|
+
#-----------------------------------------------------------------------------
|
8
|
+
# Info
|
9
|
+
|
10
|
+
def self.describe
|
11
|
+
super(:plugin, :list, 15)
|
12
|
+
end
|
13
|
+
|
14
|
+
#-----------------------------------------------------------------------------
|
15
|
+
# Settings
|
16
|
+
|
17
|
+
def configure
|
18
|
+
super do
|
19
|
+
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
#---
|
24
|
+
|
25
|
+
def arguments
|
26
|
+
[]
|
27
|
+
end
|
28
|
+
|
29
|
+
#-----------------------------------------------------------------------------
|
30
|
+
# Operations
|
31
|
+
|
32
|
+
def execute
|
33
|
+
super do |node, network|
|
34
|
+
ensure_network(network) do
|
35
|
+
last_namespace = nil
|
36
|
+
last_plugin_type = nil
|
37
|
+
|
38
|
+
Nucleon.loaded_plugins.each do |namespace, plugins|
|
39
|
+
info("------------------------------------------------------", { :i18n => false, :prefix => false })
|
40
|
+
info(" Namespace: #{purple(namespace)}", { :i18n => false, :prefix => false })
|
41
|
+
info("\n", { :i18n => false, :prefix => false })
|
42
|
+
|
43
|
+
provider_info = {}
|
44
|
+
max_width = 10
|
45
|
+
|
46
|
+
plugins.each do |type, providers|
|
47
|
+
info(" Plugin type: #{blue(type)}", { :i18n => false, :prefix => false })
|
48
|
+
info(" Providers:", { :i18n => false, :prefix => false })
|
49
|
+
|
50
|
+
providers.keys.each do |name|
|
51
|
+
width = name.to_s.size
|
52
|
+
max_width = width if width > max_width
|
53
|
+
end
|
54
|
+
|
55
|
+
providers.each do |provider, plugin_info|
|
56
|
+
info(" #{sprintf("%-#{max_width + 10}s", green(provider))} - #{yellow(plugin_info[:file])}", { :i18n => false, :prefix => false })
|
57
|
+
end
|
58
|
+
info("\n", { :i18n => false, :prefix => false })
|
59
|
+
last_plugin_type = type
|
60
|
+
end
|
61
|
+
last_namespace = namespace
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
|
2
|
+
module Nucleon
|
3
|
+
module Action
|
4
|
+
<% plugin_groups.each do |group| -%>
|
5
|
+
module <%= Nucleon.class_name(group) %>
|
6
|
+
<% end -%>
|
7
|
+
class <%= Nucleon.class_name(plugin_class) -%> < CORL.plugin_class(:nucleon, :cloud_action)
|
8
|
+
|
9
|
+
#-----------------------------------------------------------------------------
|
10
|
+
# Info
|
11
|
+
|
12
|
+
def self.describe
|
13
|
+
super([ <%= plugin_groups.collect {|group| ':' + group.downcase.to_s }.join(', ') -%> ], <%= ':' + plugin_class.downcase.to_s -%>, <%= action_weight ? action_weight : 0 -%>)
|
14
|
+
end
|
15
|
+
|
16
|
+
#-----------------------------------------------------------------------------
|
17
|
+
# Settings
|
18
|
+
|
19
|
+
def configure
|
20
|
+
super do
|
21
|
+
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
#---
|
26
|
+
|
27
|
+
def ignore
|
28
|
+
[]
|
29
|
+
end
|
30
|
+
|
31
|
+
def arguments
|
32
|
+
[]
|
33
|
+
end
|
34
|
+
|
35
|
+
#-----------------------------------------------------------------------------
|
36
|
+
# Operations
|
37
|
+
|
38
|
+
def execute
|
39
|
+
super do |node, network|
|
40
|
+
<% if node_context -%>
|
41
|
+
ensure_node(node) do
|
42
|
+
|
43
|
+
end
|
44
|
+
<% else -%>
|
45
|
+
ensure_network(network) do
|
46
|
+
|
47
|
+
end
|
48
|
+
<% end -%>
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
<% plugin_groups.each do |group| -%>
|
53
|
+
end
|
54
|
+
<% end -%>
|
55
|
+
end
|
56
|
+
end
|
data/locales/en.yml
CHANGED