corl 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.gitmodules +4 -0
- data/Gemfile +24 -0
- data/Gemfile.lock +123 -0
- data/LICENSE.txt +674 -0
- data/README.rdoc +27 -0
- data/Rakefile +78 -0
- data/VERSION +1 -0
- data/bin/corl +55 -0
- data/corl.gemspec +228 -0
- data/lib/corl/action/add.rb +69 -0
- data/lib/corl/action/bootstrap.rb +83 -0
- data/lib/corl/action/clone.rb +40 -0
- data/lib/corl/action/create.rb +55 -0
- data/lib/corl/action/exec.rb +41 -0
- data/lib/corl/action/extract.rb +49 -0
- data/lib/corl/action/image.rb +30 -0
- data/lib/corl/action/images.rb +55 -0
- data/lib/corl/action/lookup.rb +35 -0
- data/lib/corl/action/machines.rb +51 -0
- data/lib/corl/action/provision.rb +37 -0
- data/lib/corl/action/remove.rb +51 -0
- data/lib/corl/action/save.rb +53 -0
- data/lib/corl/action/seed.rb +115 -0
- data/lib/corl/action/spawn.rb +75 -0
- data/lib/corl/action/start.rb +37 -0
- data/lib/corl/action/stop.rb +30 -0
- data/lib/corl/action/update.rb +37 -0
- data/lib/corl/command/shell.rb +164 -0
- data/lib/corl/configuration/file.rb +386 -0
- data/lib/corl/event/puppet.rb +90 -0
- data/lib/corl/event/regex.rb +52 -0
- data/lib/corl/extension/puppetloader.rb +24 -0
- data/lib/corl/machine/fog.rb +310 -0
- data/lib/corl/machine/physical.rb +161 -0
- data/lib/corl/network/default.rb +26 -0
- data/lib/corl/node/aws.rb +90 -0
- data/lib/corl/node/fog.rb +198 -0
- data/lib/corl/node/google.rb +115 -0
- data/lib/corl/node/local.rb +26 -0
- data/lib/corl/node/rackspace.rb +89 -0
- data/lib/corl/project/git.rb +465 -0
- data/lib/corl/project/github.rb +108 -0
- data/lib/corl/provisioner/puppetnode/resource.rb +245 -0
- data/lib/corl/provisioner/puppetnode/resource_group.rb +205 -0
- data/lib/corl/provisioner/puppetnode.rb +407 -0
- data/lib/corl/template/environment.rb +73 -0
- data/lib/corl/template/json.rb +16 -0
- data/lib/corl/template/wrapper.rb +16 -0
- data/lib/corl/template/yaml.rb +16 -0
- data/lib/corl/translator/json.rb +27 -0
- data/lib/corl/translator/yaml.rb +27 -0
- data/lib/corl.rb +173 -0
- data/lib/corl_core/codes.rb +107 -0
- data/lib/corl_core/config/collection.rb +57 -0
- data/lib/corl_core/config/options.rb +70 -0
- data/lib/corl_core/config.rb +337 -0
- data/lib/corl_core/core.rb +59 -0
- data/lib/corl_core/corl.rb +254 -0
- data/lib/corl_core/errors.rb +84 -0
- data/lib/corl_core/facade.rb +126 -0
- data/lib/corl_core/gems.rb +72 -0
- data/lib/corl_core/manager.rb +425 -0
- data/lib/corl_core/mixin/action/commit.rb +58 -0
- data/lib/corl_core/mixin/action/keypair.rb +105 -0
- data/lib/corl_core/mixin/action/node.rb +129 -0
- data/lib/corl_core/mixin/action/project.rb +53 -0
- data/lib/corl_core/mixin/action/push.rb +52 -0
- data/lib/corl_core/mixin/config/collection.rb +53 -0
- data/lib/corl_core/mixin/config/ops.rb +53 -0
- data/lib/corl_core/mixin/config/options.rb +39 -0
- data/lib/corl_core/mixin/lookup.rb +196 -0
- data/lib/corl_core/mixin/macro/object_interface.rb +361 -0
- data/lib/corl_core/mixin/macro/plugin_interface.rb +380 -0
- data/lib/corl_core/mixin/settings.rb +46 -0
- data/lib/corl_core/mixin/sub_config.rb +148 -0
- data/lib/corl_core/mod/hash.rb +29 -0
- data/lib/corl_core/mod/hiera_backend.rb +63 -0
- data/lib/corl_core/plugin/action.rb +381 -0
- data/lib/corl_core/plugin/base.rb +374 -0
- data/lib/corl_core/plugin/command.rb +98 -0
- data/lib/corl_core/plugin/configuration.rb +177 -0
- data/lib/corl_core/plugin/event.rb +53 -0
- data/lib/corl_core/plugin/extension.rb +12 -0
- data/lib/corl_core/plugin/machine.rb +266 -0
- data/lib/corl_core/plugin/network.rb +359 -0
- data/lib/corl_core/plugin/node.rb +904 -0
- data/lib/corl_core/plugin/project.rb +927 -0
- data/lib/corl_core/plugin/provisioner.rb +51 -0
- data/lib/corl_core/plugin/template.rb +80 -0
- data/lib/corl_core/plugin/translator.rb +38 -0
- data/lib/corl_core/util/cli.rb +352 -0
- data/lib/corl_core/util/data.rb +404 -0
- data/lib/corl_core/util/disk.rb +114 -0
- data/lib/corl_core/util/git.rb +47 -0
- data/lib/corl_core/util/interface.rb +319 -0
- data/lib/corl_core/util/liquid.rb +17 -0
- data/lib/corl_core/util/package.rb +93 -0
- data/lib/corl_core/util/shell.rb +239 -0
- data/lib/corl_core/util/ssh.rb +286 -0
- data/lib/facter/corl_config_ready.rb +13 -0
- data/lib/facter/corl_exists.rb +15 -0
- data/lib/facter/corl_network.rb +17 -0
- data/lib/hiera/corl_logger.rb +18 -0
- data/lib/puppet/indirector/corl.rb +27 -0
- data/lib/puppet/indirector/data_binding/corl.rb +6 -0
- data/lib/puppet/parser/functions/config_initialized.rb +26 -0
- data/lib/puppet/parser/functions/corl_include.rb +44 -0
- data/lib/puppet/parser/functions/corl_resources.rb +58 -0
- data/lib/puppet/parser/functions/deep_merge.rb +21 -0
- data/lib/puppet/parser/functions/ensure.rb +29 -0
- data/lib/puppet/parser/functions/file_exists.rb +19 -0
- data/lib/puppet/parser/functions/global_array.rb +35 -0
- data/lib/puppet/parser/functions/global_hash.rb +35 -0
- data/lib/puppet/parser/functions/global_options.rb +23 -0
- data/lib/puppet/parser/functions/global_param.rb +43 -0
- data/lib/puppet/parser/functions/interpolate.rb +26 -0
- data/lib/puppet/parser/functions/is_false.rb +21 -0
- data/lib/puppet/parser/functions/is_true.rb +21 -0
- data/lib/puppet/parser/functions/module_array.rb +38 -0
- data/lib/puppet/parser/functions/module_hash.rb +38 -0
- data/lib/puppet/parser/functions/module_options.rb +23 -0
- data/lib/puppet/parser/functions/module_param.rb +48 -0
- data/lib/puppet/parser/functions/name.rb +21 -0
- data/lib/puppet/parser/functions/render.rb +33 -0
- data/lib/puppet/parser/functions/value.rb +21 -0
- data/locales/en.yml +232 -0
- data/spec/corl_core/interface_spec.rb +489 -0
- data/spec/corl_mock_input.rb +29 -0
- data/spec/corl_test_kernel.rb +22 -0
- data/spec/spec_helper.rb +15 -0
- metadata +406 -0
data/README.rdoc
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
= CORL (Cluster Orchestration and Research Library)
|
2
|
+
|
3
|
+
Coming soon!
|
4
|
+
|
5
|
+
Note: This library is still very early in development!
|
6
|
+
|
7
|
+
== Contributing to CORL
|
8
|
+
|
9
|
+
* Check out the latest {major}.{minor} branch to make sure the feature hasn't
|
10
|
+
been implemented or the bug hasn't been fixed yet.
|
11
|
+
* Check out the issue tracker to make sure someone already hasn't requested
|
12
|
+
it and/or contributed it.
|
13
|
+
* Fork the project.
|
14
|
+
* Start a feature/bugfix branch.
|
15
|
+
* Commit and push until you are happy with your contribution.
|
16
|
+
* Make sure to add tests for it. This is important so I don't break it in a
|
17
|
+
future version unintentionally.
|
18
|
+
* Please try not to mess with the Rakefile, version, or history. If you want
|
19
|
+
to have your own version, or is otherwise necessary, that is fine, but
|
20
|
+
please isolate to its own commit so I can cherry-pick around it.
|
21
|
+
|
22
|
+
== Copyright
|
23
|
+
|
24
|
+
Licensed under GPLv3. See LICENSE.txt for further details.
|
25
|
+
|
26
|
+
Copyright (c) 2013 Adrian Webb <adrian.webb@coralnexus.com>
|
27
|
+
Coral Technology Group LLC
|
data/Rakefile
ADDED
@@ -0,0 +1,78 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'rake'
|
5
|
+
require 'bundler'
|
6
|
+
require 'jeweler'
|
7
|
+
require 'rspec/core/rake_task'
|
8
|
+
require 'rdoc/task'
|
9
|
+
require 'yard'
|
10
|
+
|
11
|
+
require './lib/corl.rb'
|
12
|
+
|
13
|
+
#-------------------------------------------------------------------------------
|
14
|
+
# Dependencies
|
15
|
+
|
16
|
+
begin
|
17
|
+
Bundler.setup(:default, :development)
|
18
|
+
rescue Bundler::BundlerError => e
|
19
|
+
$stderr.puts e.message
|
20
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
21
|
+
exit e.status_code
|
22
|
+
end
|
23
|
+
|
24
|
+
#-------------------------------------------------------------------------------
|
25
|
+
# Gem specification
|
26
|
+
|
27
|
+
Jeweler::Tasks.new do |gem|
|
28
|
+
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
29
|
+
gem.name = "corl"
|
30
|
+
gem.homepage = "http://github.com/coralnexus/corl"
|
31
|
+
gem.rubyforge_project = 'corl'
|
32
|
+
gem.license = "GPLv3"
|
33
|
+
gem.email = "adrian.webb@coralnexus.com"
|
34
|
+
gem.authors = ["Adrian Webb"]
|
35
|
+
gem.summary = %Q{Provides core data elements and utilities used in other CORL gems}
|
36
|
+
gem.description = File.read('README.rdoc')
|
37
|
+
gem.required_ruby_version = '>= 1.8.1'
|
38
|
+
gem.has_rdoc = true
|
39
|
+
gem.rdoc_options << '--title' << 'Cluster Orchestration and Research Library' <<
|
40
|
+
'--main' << 'README.rdoc' <<
|
41
|
+
'--line-numbers'
|
42
|
+
|
43
|
+
gem.files.include Dir.glob('bootstrap/**/*')
|
44
|
+
|
45
|
+
# Dependencies defined in Gemfile
|
46
|
+
end
|
47
|
+
Jeweler::RubygemsDotOrgTasks.new
|
48
|
+
|
49
|
+
#-------------------------------------------------------------------------------
|
50
|
+
# Testing
|
51
|
+
|
52
|
+
RSpec::Core::RakeTask.new(:spec, :tag) do |spec, task_args|
|
53
|
+
options = []
|
54
|
+
options << "--tag #{task_args[:tag]}" if task_args.is_a?(Array) && ! task_args[:tag].to_s.empty?
|
55
|
+
spec.rspec_opts = options.join(' ')
|
56
|
+
end
|
57
|
+
|
58
|
+
task :default => :spec
|
59
|
+
|
60
|
+
#-------------------------------------------------------------------------------
|
61
|
+
# Documentation
|
62
|
+
|
63
|
+
version = CORL::VERSION
|
64
|
+
doc_title = "corl #{version}"
|
65
|
+
|
66
|
+
Rake::RDocTask.new do |rdoc|
|
67
|
+
rdoc.rdoc_dir = 'rdoc'
|
68
|
+
rdoc.title = doc_title
|
69
|
+
rdoc.rdoc_files.include('README*')
|
70
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
71
|
+
end
|
72
|
+
|
73
|
+
#---
|
74
|
+
|
75
|
+
YARD::Rake::YardocTask.new do |ydoc|
|
76
|
+
ydoc.files = [ 'README*', 'lib/**/*.rb' ]
|
77
|
+
ydoc.options = [ "--output-dir yardoc", "--title '#{doc_title}'" ]
|
78
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.4.0
|
data/bin/corl
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
Signal.trap("INT") { exit 1 }
|
4
|
+
|
5
|
+
#---
|
6
|
+
|
7
|
+
require 'corl_core'
|
8
|
+
|
9
|
+
logger = CORL.logger
|
10
|
+
logger.info("`corl` invoked: #{ARGV.inspect}")
|
11
|
+
|
12
|
+
#---
|
13
|
+
|
14
|
+
$stdout.sync = true
|
15
|
+
$stderr.sync = true
|
16
|
+
|
17
|
+
#---
|
18
|
+
|
19
|
+
begin
|
20
|
+
logger.debug("Beginning execution run")
|
21
|
+
|
22
|
+
arg_components = CORL::Util::CLI::Parser.split(ARGV, 'corl <action> [ <arg> ... ]')
|
23
|
+
main_command = arg_components.shift
|
24
|
+
sub_command = arg_components.shift
|
25
|
+
sub_args = arg_components
|
26
|
+
|
27
|
+
if main_command.processed && sub_command
|
28
|
+
exit_status = CORL.action_cli(sub_command, sub_args)
|
29
|
+
else
|
30
|
+
puts I18n.t('corl.core.exec.help.usage') + ': ' + main_command.help + "\n"
|
31
|
+
puts I18n.t('corl.core.exec.help.header') + ":\n\n"
|
32
|
+
|
33
|
+
CORL::Manager.connection.loaded_plugins(:action).each do |provider, action|
|
34
|
+
puts sprintf(" %-10s : %s\n",
|
35
|
+
"<#{provider}>",
|
36
|
+
CORL.action(provider, { :settings => {}, :quiet => true }).help
|
37
|
+
)
|
38
|
+
end
|
39
|
+
|
40
|
+
puts "\n" + I18n.t('corl.core.exec.help.footer') + "\n\n"
|
41
|
+
exit_status = CORL.code.help_wanted
|
42
|
+
end
|
43
|
+
|
44
|
+
rescue Exception => error
|
45
|
+
logger.error("Corl executable experienced an error:")
|
46
|
+
logger.error(error.inspect)
|
47
|
+
logger.error(error.message)
|
48
|
+
logger.error(CORL::Util::Data.to_yaml(error.backtrace))
|
49
|
+
|
50
|
+
CORL.ui.error(error.message, { :prefix => false }) if error.message
|
51
|
+
|
52
|
+
exit_status = error.status_code if error.respond_to?(:status_code)
|
53
|
+
end
|
54
|
+
|
55
|
+
exit(exit_status)
|
data/corl.gemspec
ADDED
@@ -0,0 +1,228 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = "corl"
|
8
|
+
s.version = "0.4.0"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Adrian Webb"]
|
12
|
+
s.date = "2014-02-20"
|
13
|
+
s.description = "= CORL (Cluster Orchestration and Research Library)\n\nComing soon!\n\nNote: This library is still very early in development!\n\n== Contributing to CORL\n \n* Check out the latest {major}.{minor} branch to make sure the feature hasn't \n been implemented or the bug hasn't been fixed yet.\n* Check out the issue tracker to make sure someone already hasn't requested \n it and/or contributed it.\n* Fork the project.\n* Start a feature/bugfix branch.\n* Commit and push until you are happy with your contribution.\n* Make sure to add tests for it. This is important so I don't break it in a \n future version unintentionally.\n* Please try not to mess with the Rakefile, version, or history. If you want \n to have your own version, or is otherwise necessary, that is fine, but \n please isolate to its own commit so I can cherry-pick around it.\n\n== Copyright\n\nLicensed under GPLv3. See LICENSE.txt for further details.\n\nCopyright (c) 2013 Adrian Webb <adrian.webb@coralnexus.com>\nCoral Technology Group LLC"
|
14
|
+
s.email = "adrian.webb@coralnexus.com"
|
15
|
+
s.executables = ["corl"]
|
16
|
+
s.extra_rdoc_files = [
|
17
|
+
"LICENSE.txt",
|
18
|
+
"README.rdoc"
|
19
|
+
]
|
20
|
+
s.files = [
|
21
|
+
".document",
|
22
|
+
".gitmodules",
|
23
|
+
"Gemfile",
|
24
|
+
"Gemfile.lock",
|
25
|
+
"LICENSE.txt",
|
26
|
+
"README.rdoc",
|
27
|
+
"Rakefile",
|
28
|
+
"VERSION",
|
29
|
+
"bin/corl",
|
30
|
+
"corl.gemspec",
|
31
|
+
"lib/corl.rb",
|
32
|
+
"lib/corl/action/add.rb",
|
33
|
+
"lib/corl/action/bootstrap.rb",
|
34
|
+
"lib/corl/action/clone.rb",
|
35
|
+
"lib/corl/action/create.rb",
|
36
|
+
"lib/corl/action/exec.rb",
|
37
|
+
"lib/corl/action/extract.rb",
|
38
|
+
"lib/corl/action/image.rb",
|
39
|
+
"lib/corl/action/images.rb",
|
40
|
+
"lib/corl/action/lookup.rb",
|
41
|
+
"lib/corl/action/machines.rb",
|
42
|
+
"lib/corl/action/provision.rb",
|
43
|
+
"lib/corl/action/remove.rb",
|
44
|
+
"lib/corl/action/save.rb",
|
45
|
+
"lib/corl/action/seed.rb",
|
46
|
+
"lib/corl/action/spawn.rb",
|
47
|
+
"lib/corl/action/start.rb",
|
48
|
+
"lib/corl/action/stop.rb",
|
49
|
+
"lib/corl/action/update.rb",
|
50
|
+
"lib/corl/command/shell.rb",
|
51
|
+
"lib/corl/configuration/file.rb",
|
52
|
+
"lib/corl/event/puppet.rb",
|
53
|
+
"lib/corl/event/regex.rb",
|
54
|
+
"lib/corl/extension/puppetloader.rb",
|
55
|
+
"lib/corl/machine/fog.rb",
|
56
|
+
"lib/corl/machine/physical.rb",
|
57
|
+
"lib/corl/network/default.rb",
|
58
|
+
"lib/corl/node/aws.rb",
|
59
|
+
"lib/corl/node/fog.rb",
|
60
|
+
"lib/corl/node/google.rb",
|
61
|
+
"lib/corl/node/local.rb",
|
62
|
+
"lib/corl/node/rackspace.rb",
|
63
|
+
"lib/corl/project/git.rb",
|
64
|
+
"lib/corl/project/github.rb",
|
65
|
+
"lib/corl/provisioner/puppetnode.rb",
|
66
|
+
"lib/corl/provisioner/puppetnode/resource.rb",
|
67
|
+
"lib/corl/provisioner/puppetnode/resource_group.rb",
|
68
|
+
"lib/corl/template/environment.rb",
|
69
|
+
"lib/corl/template/json.rb",
|
70
|
+
"lib/corl/template/wrapper.rb",
|
71
|
+
"lib/corl/template/yaml.rb",
|
72
|
+
"lib/corl/translator/json.rb",
|
73
|
+
"lib/corl/translator/yaml.rb",
|
74
|
+
"lib/corl_core/codes.rb",
|
75
|
+
"lib/corl_core/config.rb",
|
76
|
+
"lib/corl_core/config/collection.rb",
|
77
|
+
"lib/corl_core/config/options.rb",
|
78
|
+
"lib/corl_core/core.rb",
|
79
|
+
"lib/corl_core/corl.rb",
|
80
|
+
"lib/corl_core/errors.rb",
|
81
|
+
"lib/corl_core/facade.rb",
|
82
|
+
"lib/corl_core/gems.rb",
|
83
|
+
"lib/corl_core/manager.rb",
|
84
|
+
"lib/corl_core/mixin/action/commit.rb",
|
85
|
+
"lib/corl_core/mixin/action/keypair.rb",
|
86
|
+
"lib/corl_core/mixin/action/node.rb",
|
87
|
+
"lib/corl_core/mixin/action/project.rb",
|
88
|
+
"lib/corl_core/mixin/action/push.rb",
|
89
|
+
"lib/corl_core/mixin/config/collection.rb",
|
90
|
+
"lib/corl_core/mixin/config/ops.rb",
|
91
|
+
"lib/corl_core/mixin/config/options.rb",
|
92
|
+
"lib/corl_core/mixin/lookup.rb",
|
93
|
+
"lib/corl_core/mixin/macro/object_interface.rb",
|
94
|
+
"lib/corl_core/mixin/macro/plugin_interface.rb",
|
95
|
+
"lib/corl_core/mixin/settings.rb",
|
96
|
+
"lib/corl_core/mixin/sub_config.rb",
|
97
|
+
"lib/corl_core/mod/hash.rb",
|
98
|
+
"lib/corl_core/mod/hiera_backend.rb",
|
99
|
+
"lib/corl_core/plugin/action.rb",
|
100
|
+
"lib/corl_core/plugin/base.rb",
|
101
|
+
"lib/corl_core/plugin/command.rb",
|
102
|
+
"lib/corl_core/plugin/configuration.rb",
|
103
|
+
"lib/corl_core/plugin/event.rb",
|
104
|
+
"lib/corl_core/plugin/extension.rb",
|
105
|
+
"lib/corl_core/plugin/machine.rb",
|
106
|
+
"lib/corl_core/plugin/network.rb",
|
107
|
+
"lib/corl_core/plugin/node.rb",
|
108
|
+
"lib/corl_core/plugin/project.rb",
|
109
|
+
"lib/corl_core/plugin/provisioner.rb",
|
110
|
+
"lib/corl_core/plugin/template.rb",
|
111
|
+
"lib/corl_core/plugin/translator.rb",
|
112
|
+
"lib/corl_core/util/cli.rb",
|
113
|
+
"lib/corl_core/util/data.rb",
|
114
|
+
"lib/corl_core/util/disk.rb",
|
115
|
+
"lib/corl_core/util/git.rb",
|
116
|
+
"lib/corl_core/util/interface.rb",
|
117
|
+
"lib/corl_core/util/liquid.rb",
|
118
|
+
"lib/corl_core/util/package.rb",
|
119
|
+
"lib/corl_core/util/shell.rb",
|
120
|
+
"lib/corl_core/util/ssh.rb",
|
121
|
+
"lib/facter/corl_config_ready.rb",
|
122
|
+
"lib/facter/corl_exists.rb",
|
123
|
+
"lib/facter/corl_network.rb",
|
124
|
+
"lib/hiera/corl_logger.rb",
|
125
|
+
"lib/puppet/indirector/corl.rb",
|
126
|
+
"lib/puppet/indirector/data_binding/corl.rb",
|
127
|
+
"lib/puppet/parser/functions/config_initialized.rb",
|
128
|
+
"lib/puppet/parser/functions/corl_include.rb",
|
129
|
+
"lib/puppet/parser/functions/corl_resources.rb",
|
130
|
+
"lib/puppet/parser/functions/deep_merge.rb",
|
131
|
+
"lib/puppet/parser/functions/ensure.rb",
|
132
|
+
"lib/puppet/parser/functions/file_exists.rb",
|
133
|
+
"lib/puppet/parser/functions/global_array.rb",
|
134
|
+
"lib/puppet/parser/functions/global_hash.rb",
|
135
|
+
"lib/puppet/parser/functions/global_options.rb",
|
136
|
+
"lib/puppet/parser/functions/global_param.rb",
|
137
|
+
"lib/puppet/parser/functions/interpolate.rb",
|
138
|
+
"lib/puppet/parser/functions/is_false.rb",
|
139
|
+
"lib/puppet/parser/functions/is_true.rb",
|
140
|
+
"lib/puppet/parser/functions/module_array.rb",
|
141
|
+
"lib/puppet/parser/functions/module_hash.rb",
|
142
|
+
"lib/puppet/parser/functions/module_options.rb",
|
143
|
+
"lib/puppet/parser/functions/module_param.rb",
|
144
|
+
"lib/puppet/parser/functions/name.rb",
|
145
|
+
"lib/puppet/parser/functions/render.rb",
|
146
|
+
"lib/puppet/parser/functions/value.rb",
|
147
|
+
"locales/en.yml",
|
148
|
+
"spec/corl_core/interface_spec.rb",
|
149
|
+
"spec/corl_mock_input.rb",
|
150
|
+
"spec/corl_test_kernel.rb",
|
151
|
+
"spec/spec_helper.rb"
|
152
|
+
]
|
153
|
+
s.homepage = "http://github.com/coralnexus/corl"
|
154
|
+
s.licenses = ["GPLv3"]
|
155
|
+
s.rdoc_options = ["--title", "Cluster Orchestration and Research Library", "--main", "README.rdoc", "--line-numbers"]
|
156
|
+
s.require_paths = ["lib"]
|
157
|
+
s.required_ruby_version = Gem::Requirement.new(">= 1.8.1")
|
158
|
+
s.rubyforge_project = "corl"
|
159
|
+
s.rubygems_version = "1.8.11"
|
160
|
+
s.summary = "Provides core data elements and utilities used in other CORL gems"
|
161
|
+
|
162
|
+
if s.respond_to? :specification_version then
|
163
|
+
s.specification_version = 3
|
164
|
+
|
165
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
166
|
+
s.add_runtime_dependency(%q<log4r>, ["~> 1.1"])
|
167
|
+
s.add_runtime_dependency(%q<i18n>, ["~> 0.6"])
|
168
|
+
s.add_runtime_dependency(%q<deep_merge>, ["~> 1.0"])
|
169
|
+
s.add_runtime_dependency(%q<celluloid>, ["~> 0.15"])
|
170
|
+
s.add_runtime_dependency(%q<sshkey>, ["~> 1.6"])
|
171
|
+
s.add_runtime_dependency(%q<hiera>, ["~> 1.3"])
|
172
|
+
s.add_runtime_dependency(%q<multi_json>, ["~> 1.7"])
|
173
|
+
s.add_runtime_dependency(%q<grit>, ["~> 2.5"])
|
174
|
+
s.add_runtime_dependency(%q<octokit>, ["~> 2.7"])
|
175
|
+
s.add_runtime_dependency(%q<netrc>, ["~> 0.7"])
|
176
|
+
s.add_runtime_dependency(%q<fog>, ["~> 1.20"])
|
177
|
+
s.add_runtime_dependency(%q<rgen>, ["~> 0.6"])
|
178
|
+
s.add_runtime_dependency(%q<facter>, ["~> 1.7"])
|
179
|
+
s.add_runtime_dependency(%q<puppet>, ["~> 3.2"])
|
180
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.2"])
|
181
|
+
s.add_development_dependency(%q<jeweler>, ["~> 2.0"])
|
182
|
+
s.add_development_dependency(%q<rspec>, ["~> 2.10"])
|
183
|
+
s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
|
184
|
+
s.add_development_dependency(%q<yard>, ["~> 0.8"])
|
185
|
+
else
|
186
|
+
s.add_dependency(%q<log4r>, ["~> 1.1"])
|
187
|
+
s.add_dependency(%q<i18n>, ["~> 0.6"])
|
188
|
+
s.add_dependency(%q<deep_merge>, ["~> 1.0"])
|
189
|
+
s.add_dependency(%q<celluloid>, ["~> 0.15"])
|
190
|
+
s.add_dependency(%q<sshkey>, ["~> 1.6"])
|
191
|
+
s.add_dependency(%q<hiera>, ["~> 1.3"])
|
192
|
+
s.add_dependency(%q<multi_json>, ["~> 1.7"])
|
193
|
+
s.add_dependency(%q<grit>, ["~> 2.5"])
|
194
|
+
s.add_dependency(%q<octokit>, ["~> 2.7"])
|
195
|
+
s.add_dependency(%q<netrc>, ["~> 0.7"])
|
196
|
+
s.add_dependency(%q<fog>, ["~> 1.20"])
|
197
|
+
s.add_dependency(%q<rgen>, ["~> 0.6"])
|
198
|
+
s.add_dependency(%q<facter>, ["~> 1.7"])
|
199
|
+
s.add_dependency(%q<puppet>, ["~> 3.2"])
|
200
|
+
s.add_dependency(%q<bundler>, ["~> 1.2"])
|
201
|
+
s.add_dependency(%q<jeweler>, ["~> 2.0"])
|
202
|
+
s.add_dependency(%q<rspec>, ["~> 2.10"])
|
203
|
+
s.add_dependency(%q<rdoc>, ["~> 3.12"])
|
204
|
+
s.add_dependency(%q<yard>, ["~> 0.8"])
|
205
|
+
end
|
206
|
+
else
|
207
|
+
s.add_dependency(%q<log4r>, ["~> 1.1"])
|
208
|
+
s.add_dependency(%q<i18n>, ["~> 0.6"])
|
209
|
+
s.add_dependency(%q<deep_merge>, ["~> 1.0"])
|
210
|
+
s.add_dependency(%q<celluloid>, ["~> 0.15"])
|
211
|
+
s.add_dependency(%q<sshkey>, ["~> 1.6"])
|
212
|
+
s.add_dependency(%q<hiera>, ["~> 1.3"])
|
213
|
+
s.add_dependency(%q<multi_json>, ["~> 1.7"])
|
214
|
+
s.add_dependency(%q<grit>, ["~> 2.5"])
|
215
|
+
s.add_dependency(%q<octokit>, ["~> 2.7"])
|
216
|
+
s.add_dependency(%q<netrc>, ["~> 0.7"])
|
217
|
+
s.add_dependency(%q<fog>, ["~> 1.20"])
|
218
|
+
s.add_dependency(%q<rgen>, ["~> 0.6"])
|
219
|
+
s.add_dependency(%q<facter>, ["~> 1.7"])
|
220
|
+
s.add_dependency(%q<puppet>, ["~> 3.2"])
|
221
|
+
s.add_dependency(%q<bundler>, ["~> 1.2"])
|
222
|
+
s.add_dependency(%q<jeweler>, ["~> 2.0"])
|
223
|
+
s.add_dependency(%q<rspec>, ["~> 2.10"])
|
224
|
+
s.add_dependency(%q<rdoc>, ["~> 3.12"])
|
225
|
+
s.add_dependency(%q<yard>, ["~> 0.8"])
|
226
|
+
end
|
227
|
+
end
|
228
|
+
|
@@ -0,0 +1,69 @@
|
|
1
|
+
|
2
|
+
module CORL
|
3
|
+
module Action
|
4
|
+
class Add < Plugin::Action
|
5
|
+
|
6
|
+
include Mixin::Action::Project
|
7
|
+
include Mixin::Action::Push
|
8
|
+
|
9
|
+
#-----------------------------------------------------------------------------
|
10
|
+
# Add action interface
|
11
|
+
|
12
|
+
def normalize
|
13
|
+
super('corl add <subproject/path> <subproject:::reference>')
|
14
|
+
|
15
|
+
codes :project_failure => 20,
|
16
|
+
:add_failure => 21,
|
17
|
+
:push_failure => 22
|
18
|
+
end
|
19
|
+
|
20
|
+
#-----------------------------------------------------------------------------
|
21
|
+
# Action operations
|
22
|
+
|
23
|
+
def parse(parser)
|
24
|
+
parser.arg_str(:sub_path, nil,
|
25
|
+
'corl.core.actions.add.options.sub_path'
|
26
|
+
)
|
27
|
+
parser.arg_str(:sub_reference, nil,
|
28
|
+
'corl.core.actions.add.options.sub_reference'
|
29
|
+
)
|
30
|
+
parser.option_bool(:editable, false,
|
31
|
+
'--editable',
|
32
|
+
'corl.core.actions.add.options.editable'
|
33
|
+
)
|
34
|
+
project_options(parser, true, true)
|
35
|
+
push_options(parser, true)
|
36
|
+
end
|
37
|
+
|
38
|
+
#---
|
39
|
+
|
40
|
+
def execute
|
41
|
+
super do |node, network, status|
|
42
|
+
info('corl.core.actions.add.start')
|
43
|
+
|
44
|
+
if project = project_load(Dir.pwd, false)
|
45
|
+
sub_info = project.translate_reference(settings[:sub_reference], settings[:editable])
|
46
|
+
sub_path = settings[:sub_path]
|
47
|
+
|
48
|
+
if sub_info
|
49
|
+
sub_url = sub_info[:url]
|
50
|
+
sub_revision = sub_info[:revision]
|
51
|
+
else
|
52
|
+
sub_url = settings[:sub_reference]
|
53
|
+
sub_revision = nil
|
54
|
+
end
|
55
|
+
|
56
|
+
if project.add_subproject(sub_path, sub_url, sub_revision)
|
57
|
+
status = code.push_failure unless push(project)
|
58
|
+
else
|
59
|
+
status = code.add_failure
|
60
|
+
end
|
61
|
+
else
|
62
|
+
status = code.project_failure
|
63
|
+
end
|
64
|
+
status
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
@@ -0,0 +1,83 @@
|
|
1
|
+
|
2
|
+
module CORL
|
3
|
+
module Action
|
4
|
+
class Bootstrap < Plugin::Action
|
5
|
+
|
6
|
+
#-----------------------------------------------------------------------------
|
7
|
+
# Settings
|
8
|
+
|
9
|
+
def configure
|
10
|
+
super do
|
11
|
+
codes :network_failure
|
12
|
+
|
13
|
+
register :auth_files, :array, [] do |values|
|
14
|
+
success = true
|
15
|
+
values.each do |value|
|
16
|
+
unless File.exists?(value)
|
17
|
+
warn('corl.actions.bootstrap.errors.auth_files', { :value => value })
|
18
|
+
success = false
|
19
|
+
end
|
20
|
+
end
|
21
|
+
success
|
22
|
+
end
|
23
|
+
register :home_env_var, :str, 'HOME'
|
24
|
+
register :home, :str, nil
|
25
|
+
register :bootstrap_path, :str, File.join(Gems.core.full_gem_path, 'bootstrap') do |value|
|
26
|
+
unless File.directory?(value)
|
27
|
+
warn('corl.actions.bootstrap.errors.bootstrap_path', { :value => value })
|
28
|
+
next false
|
29
|
+
end
|
30
|
+
true
|
31
|
+
end
|
32
|
+
register :bootstrap_glob, :str, '**/*.sh'
|
33
|
+
register :bootstrap_init, :str, 'bootstrap.sh'
|
34
|
+
|
35
|
+
register :bootstrap_nodes, :array, nil do |values|
|
36
|
+
node_plugins = Manager.connection.loaded_plugins(:node)
|
37
|
+
success = true
|
38
|
+
|
39
|
+
values.each do |value|
|
40
|
+
if info = Plugin::Node.translate_reference(value)
|
41
|
+
if ! node_plugins.keys.include?(info[:provider].to_sym) || info[:name].empty?
|
42
|
+
warn('corl.actions.bootstrap.errors.bootstrap_nodes', { :value => value, :node_provider => info[:provider], :name => info[:name] })
|
43
|
+
success = false
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
success
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
#---
|
53
|
+
|
54
|
+
def ignore
|
55
|
+
[ :nodes ]
|
56
|
+
end
|
57
|
+
|
58
|
+
def arguments
|
59
|
+
[ :bootstrap_nodes ]
|
60
|
+
end
|
61
|
+
|
62
|
+
#-----------------------------------------------------------------------------
|
63
|
+
# Operations
|
64
|
+
|
65
|
+
def execute
|
66
|
+
super do |local_node, network|
|
67
|
+
if network
|
68
|
+
batch_success = network.batch(settings[:bootstrap_nodes], settings[:node_provider], settings[:parallel]) do |node|
|
69
|
+
render_options = { :id => node.id, :hostname => node.hostname }
|
70
|
+
|
71
|
+
info('corl.actions.bootstrap.start', render_options)
|
72
|
+
node.bootstrap(network.home, extended_config(:bootstrap, settings))
|
73
|
+
info('corl.actions.bootstrap.success', render_options)
|
74
|
+
end
|
75
|
+
myself.status = code.batch_error unless batch_success
|
76
|
+
else
|
77
|
+
myself.status = code.network_failure
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
|
2
|
+
module CORL
|
3
|
+
module Action
|
4
|
+
class Clone < Plugin::Action
|
5
|
+
|
6
|
+
#-----------------------------------------------------------------------------
|
7
|
+
# Clone action interface
|
8
|
+
|
9
|
+
def normalize
|
10
|
+
super('corl clone <existing_node_reference> <new_node_reference>')
|
11
|
+
end
|
12
|
+
|
13
|
+
#-----------------------------------------------------------------------------
|
14
|
+
# Action operations
|
15
|
+
|
16
|
+
def parse(parser)
|
17
|
+
parser.option_str(:provider, :rackspace,
|
18
|
+
'--provider DEFAULT_NODE_PROVIDER',
|
19
|
+
'corl.core.actions.start.options.provider'
|
20
|
+
)
|
21
|
+
parser.arg_str(:existing_node_reference, nil,
|
22
|
+
'corl.core.actions.start.options.existing_node_reference'
|
23
|
+
)
|
24
|
+
parser.arg_str(:new_node_reference, nil,
|
25
|
+
'corl.core.actions.start.options.new_node_reference'
|
26
|
+
)
|
27
|
+
end
|
28
|
+
|
29
|
+
#---
|
30
|
+
|
31
|
+
def execute
|
32
|
+
super do |node, network, status|
|
33
|
+
info('corl.core.actions.clone.start')
|
34
|
+
|
35
|
+
status
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
|
2
|
+
module CORL
|
3
|
+
module Action
|
4
|
+
class Create < Plugin::Action
|
5
|
+
|
6
|
+
#-----------------------------------------------------------------------------
|
7
|
+
# Create action interface
|
8
|
+
|
9
|
+
def normalize
|
10
|
+
super('corl create [ <project:::reference> ]')
|
11
|
+
|
12
|
+
codes :project_failure => 20
|
13
|
+
end
|
14
|
+
|
15
|
+
#-----------------------------------------------------------------------------
|
16
|
+
# Action operations
|
17
|
+
|
18
|
+
def parse(parser)
|
19
|
+
network_path = Dir.pwd
|
20
|
+
network_path = lookup(:corl_network) if CORL.admin?
|
21
|
+
|
22
|
+
parser.option_str(:path, network_path,
|
23
|
+
'--path PROJECT_DIR',
|
24
|
+
'corl.core.actions.create.options.path'
|
25
|
+
)
|
26
|
+
parser.option_str(:revision, :master,
|
27
|
+
'--revision REVISION/BRANCH',
|
28
|
+
'corl.core.actions.create.options.revision'
|
29
|
+
)
|
30
|
+
parser.arg_str(:reference,
|
31
|
+
'github:::coralnexus/puppet-cloud-template',
|
32
|
+
'corl.core.actions.create.options.reference'
|
33
|
+
)
|
34
|
+
end
|
35
|
+
|
36
|
+
#---
|
37
|
+
|
38
|
+
def execute
|
39
|
+
super do |node, network, status|
|
40
|
+
info('corl.core.actions.create.start')
|
41
|
+
|
42
|
+
project = CORL.project(extended_config(:project, {
|
43
|
+
:create => true,
|
44
|
+
:directory => settings[:path],
|
45
|
+
:url => settings[:reference],
|
46
|
+
:revision => settings[:revision],
|
47
|
+
:pull => true
|
48
|
+
}))
|
49
|
+
|
50
|
+
project ? status : code.project_failure
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
|
2
|
+
module CORL
|
3
|
+
module Action
|
4
|
+
class Exec < Plugin::Action
|
5
|
+
|
6
|
+
#-----------------------------------------------------------------------------
|
7
|
+
# Seed action interface
|
8
|
+
|
9
|
+
def normalize
|
10
|
+
super('corl exec <command> [ <args> ... ]')
|
11
|
+
|
12
|
+
codes :network_failure => 20
|
13
|
+
end
|
14
|
+
|
15
|
+
#-----------------------------------------------------------------------------
|
16
|
+
# Action operations
|
17
|
+
|
18
|
+
def parse(parser)
|
19
|
+
parser.arg_array(:command, nil,
|
20
|
+
'corl.core.actions.exec.options.command'
|
21
|
+
)
|
22
|
+
node_options(parser)
|
23
|
+
end
|
24
|
+
|
25
|
+
#---
|
26
|
+
|
27
|
+
def execute
|
28
|
+
super do |node, network, status|
|
29
|
+
if network && node
|
30
|
+
command_str = settings[:command].join(' ')
|
31
|
+
result = node.exec({ :commands => [ command_str ] }).first
|
32
|
+
status = result[:status]
|
33
|
+
else
|
34
|
+
status = code.network_failure
|
35
|
+
end
|
36
|
+
status
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|