corl 0.5.6 → 0.5.7
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/.gitignore +10 -1
- data/Gemfile +1 -0
- data/Gemfile.lock +4 -0
- data/README.rdoc +125 -517
- data/Rakefile +57 -0
- data/VERSION +1 -1
- data/bootstrap/os/ubuntu/00_base.sh +10 -7
- data/bootstrap/os/ubuntu/05_ruby.sh +4 -4
- data/corl.gemspec +32 -5
- data/info/AUTOMATION.rdoc +5 -0
- data/info/INSTALLATION.rdoc +163 -0
- data/info/PACKAGING.rdoc +171 -0
- data/info/PLUGINS.rdoc +57 -0
- data/info/TODO.rdoc +27 -0
- data/lib/CORL/configuration/file.rb +2 -2
- data/lib/CORL/machine/docker.rb +327 -0
- data/lib/CORL/machine/vagrant.rb +142 -107
- data/lib/CORL/node/docker.rb +269 -0
- data/lib/CORL/node/vagrant.rb +23 -0
- data/lib/CORL/provisioner/puppetnode.rb +52 -27
- data/lib/core/facade.rb +36 -34
- data/lib/core/mixin/builder.rb +44 -44
- data/lib/core/mixin/machine/ssh.rb +34 -34
- data/lib/core/mod/vagrant.rb +32 -0
- data/lib/core/plugin/cloud_action.rb +1 -1
- data/lib/core/plugin/machine.rb +85 -85
- data/lib/core/plugin/network.rb +23 -9
- data/lib/core/plugin/node.rb +10 -7
- data/lib/core/plugin/provisioner.rb +3 -3
- data/lib/core/vagrant/action.rb +15 -13
- data/lib/core/vagrant/actions/include_overrides.rb +17 -0
- data/lib/core/vagrant/actions/init_keys.rb +9 -5
- data/lib/core/vagrant/commands/launcher.rb +1 -1
- data/lib/core/vagrant/config.rb +343 -143
- data/lib/core/vagrant/plugins.rb +14 -14
- data/lib/corl.rb +3 -7
- data/lib/nucleon/action/node/provision.rb +15 -4
- data/lib/nucleon/action/node/seed.rb +2 -2
- data/lib/nucleon/extension/vagrant.rb +30 -0
- data/locales/en.yml +5 -0
- data/rdoc/site/0.5.7/README.rdoc +595 -0
- data/rdoc/site/0.5.7/info/AUTOMATION.rdoc +382 -0
- data/rdoc/site/0.5.7/info/INSTALLATION.rdoc +543 -0
- data/rdoc/site/0.5.7/info/PACKAGES.rdoc +556 -0
- data/rdoc/site/0.5.7/info/PACKAGING.rdoc +563 -0
- data/rdoc/site/0.5.7/info/PLUGINS.rdoc +534 -0
- data/rdoc/site/0.5.7/info/TODO.rdoc +412 -0
- data/tmp/README.rdoc +217 -0
- data/tmp/info/AUTOMATION.rdoc +6 -0
- data/tmp/info/INSTALLATION.rdoc +158 -0
- data/tmp/info/PACKAGES.rdoc +177 -0
- data/tmp/info/PACKAGING.rdoc +184 -0
- data/tmp/info/PLUGINS.rdoc +129 -0
- data/tmp/info/README.rdoc +217 -0
- data/tmp/info/TODO.rdoc +36 -0
- metadata +41 -3
- data/TODO.rdoc +0 -12
data/lib/core/vagrant/plugins.rb
CHANGED
@@ -6,26 +6,26 @@ end
|
|
6
6
|
module VagrantPlugins
|
7
7
|
module CORL
|
8
8
|
class Plugin < ::Vagrant.plugin('2')
|
9
|
-
|
10
|
-
name '
|
9
|
+
|
10
|
+
name 'Coral Orchestration and Research Library'
|
11
11
|
description 'The `corl` plugin provides an easy way to develop and test CORL networks locally from within Vagrant.'
|
12
|
-
|
13
|
-
@@directory = File.dirname(__FILE__)
|
14
|
-
@@action_dir = File.join(@@directory, 'actions')
|
12
|
+
|
13
|
+
@@directory = File.dirname(__FILE__)
|
14
|
+
@@action_dir = File.join(@@directory, 'actions')
|
15
15
|
@@command_dir = File.join(@@directory, 'commands')
|
16
16
|
@@provisioner_dir = File.join(@@directory, 'provisioner')
|
17
|
-
|
18
|
-
#---
|
19
|
-
|
17
|
+
|
18
|
+
#---
|
19
|
+
|
20
20
|
nucleon_require(@@directory, :config)
|
21
21
|
nucleon_require(@@directory, :action)
|
22
|
-
nucleon_require(@@command_dir, :launcher)
|
22
|
+
nucleon_require(@@command_dir, :launcher)
|
23
23
|
|
24
24
|
# Commands (only one, which launches Nucleon actions)
|
25
|
-
command(:corl) do
|
25
|
+
command(:corl) do
|
26
26
|
Command::Launcher # Meta command for action launcher
|
27
27
|
end
|
28
|
-
|
28
|
+
|
29
29
|
# Provisioner (we handle provisioning internally)
|
30
30
|
config(:corl, :provisioner) do
|
31
31
|
nucleon_require(@@provisioner_dir, :config)
|
@@ -35,20 +35,20 @@ class Plugin < ::Vagrant.plugin('2')
|
|
35
35
|
nucleon_require(@@provisioner_dir, :provisioner)
|
36
36
|
Provisioner::CORL
|
37
37
|
end
|
38
|
-
|
38
|
+
|
39
39
|
# Action hooks
|
40
40
|
action_hook 'init-keys', :machine_action_up do |hook|
|
41
41
|
nucleon_require(@@action_dir, :init_keys)
|
42
42
|
hook.after Vagrant::Action::Builtin::WaitForCommunicator, Action::InitKeys
|
43
43
|
end
|
44
|
-
|
44
|
+
|
45
45
|
if ENV['CORL_LINK_NETWORK']
|
46
46
|
action_hook 'link-network', :machine_action_up do |hook|
|
47
47
|
nucleon_require(@@action_dir, :link_network)
|
48
48
|
hook.after Action::InitKeys, Action::LinkNetwork
|
49
49
|
end
|
50
50
|
end
|
51
|
-
|
51
|
+
|
52
52
|
action_hook 'delete-cache', :machine_action_destroy do |hook|
|
53
53
|
nucleon_require(@@action_dir, :delete_cache)
|
54
54
|
hook.after Vagrant::Action::Builtin::ProvisionerCleanup, Action::DeleteCache
|
data/lib/corl.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
|
2
2
|
#*******************************************************************************
|
3
|
-
# CORL (
|
3
|
+
# CORL (Coral Orchestration and Research Library)
|
4
4
|
#
|
5
5
|
# built on Nucleon (github.com/coralnexus/nucleon)
|
6
6
|
#
|
@@ -8,7 +8,7 @@
|
|
8
8
|
# the cloud.
|
9
9
|
#
|
10
10
|
# Author:: Adrian Webb (mailto:adrian.webb@coralnexus.com)
|
11
|
-
# License::
|
11
|
+
# License:: Apache License v2
|
12
12
|
|
13
13
|
#-------------------------------------------------------------------------------
|
14
14
|
# Top level properties
|
@@ -34,8 +34,6 @@ CORL = Nucleon
|
|
34
34
|
|
35
35
|
require 'hiera'
|
36
36
|
require 'facter'
|
37
|
-
require 'puppet'
|
38
|
-
require 'puppet/configurer'
|
39
37
|
|
40
38
|
#-------------------------------------------------------------------------------
|
41
39
|
# Localization
|
@@ -105,10 +103,8 @@ nucleon_require(core_dir, :build)
|
|
105
103
|
nucleon_require(core_dir, :plugin)
|
106
104
|
|
107
105
|
# Include Vagrant plugins (only include if running inside Vagrant)
|
108
|
-
|
109
|
-
require "vagrant"
|
106
|
+
if defined?(Vagrant) == 'constant' && Vagrant.class == Module
|
110
107
|
nucleon_require(vagrant_dir, :plugins)
|
111
|
-
rescue LoadError
|
112
108
|
end
|
113
109
|
|
114
110
|
#-------------------------------------------------------------------------------
|
@@ -20,6 +20,8 @@ class Provision < Nucleon.plugin_class(:nucleon, :cloud_action)
|
|
20
20
|
|
21
21
|
register_bool :build, false
|
22
22
|
register_bool :dry_run, false
|
23
|
+
register_bool :check_profiles, false
|
24
|
+
|
23
25
|
register_str :environment
|
24
26
|
end
|
25
27
|
end
|
@@ -45,7 +47,9 @@ class Provision < Nucleon.plugin_class(:nucleon, :cloud_action)
|
|
45
47
|
end
|
46
48
|
|
47
49
|
if CORL.admin?
|
48
|
-
|
50
|
+
unless settings[:check_profiles]
|
51
|
+
info('start', { :provider => node.plugin_provider, :name => node.plugin_name })
|
52
|
+
end
|
49
53
|
|
50
54
|
if settings[:build] ||
|
51
55
|
settings.has_key?(:environment) ||
|
@@ -64,12 +68,19 @@ class Provision < Nucleon.plugin_class(:nucleon, :cloud_action)
|
|
64
68
|
|
65
69
|
collection.each do |name, provisioner|
|
66
70
|
if supported_profiles = provisioner.supported_profiles(node, profiles)
|
67
|
-
|
68
|
-
|
71
|
+
supported_profiles.each do |profile|
|
72
|
+
info('profile', { :provider => yellow(provider), :profile => green(profile.to_s) })
|
73
|
+
end
|
74
|
+
unless settings[:check_profiles]
|
75
|
+
profile_success = provisioner.provision(node, supported_profiles, settings)
|
76
|
+
success = false unless profile_success
|
77
|
+
end
|
69
78
|
end
|
70
79
|
end
|
71
80
|
end
|
72
|
-
|
81
|
+
unless settings[:check_profiles]
|
82
|
+
success('complete', { :provider => node.plugin_provider, :name => node.plugin_name, :time => Time.now.to_s }) if success
|
83
|
+
end
|
73
84
|
myself.status = code.provision_failure unless success
|
74
85
|
end
|
75
86
|
end
|
@@ -53,9 +53,9 @@ class Seed < Nucleon.plugin_class(:nucleon, :cloud_action)
|
|
53
53
|
|
54
54
|
if keys = Util::SSH.generate.store
|
55
55
|
if @project_info = project_class.translate_reference(settings[:project_reference], true)
|
56
|
-
project_info = Config.new(@project_info)
|
56
|
+
project_info = Config.new(@project_info, {}, true, false)
|
57
57
|
else
|
58
|
-
project_info = Config.new({ :provider => :git })
|
58
|
+
project_info = Config.new({ :provider => :git }, {}, true, false)
|
59
59
|
end
|
60
60
|
|
61
61
|
project_class.clear_provider(network_path)
|
@@ -0,0 +1,30 @@
|
|
1
|
+
|
2
|
+
module Nucleon
|
3
|
+
module Extension
|
4
|
+
class Vagrant < Nucleon.plugin_class(:nucleon, :extension)
|
5
|
+
|
6
|
+
def network_new_node_config(config)
|
7
|
+
plugin = config[:plugin]
|
8
|
+
provider = plugin.plugin_provider
|
9
|
+
|
10
|
+
if provider == :vagrant
|
11
|
+
image_name = string(config.delete(:image))
|
12
|
+
machine_type = symbol(config.delete(:machine_type))
|
13
|
+
hostname = string(config[:hostname])
|
14
|
+
|
15
|
+
public_ip = string(config.delete(:public_ip))
|
16
|
+
|
17
|
+
case machine_type
|
18
|
+
when :docker
|
19
|
+
config.set([ :vm, :providers, :docker, :image ], image_name)
|
20
|
+
else
|
21
|
+
config.set([ :vm, :providers, machine_type, :private_network ], public_ip) if public_ip
|
22
|
+
config.set([ :vm, :providers, machine_type, :override, :vm, :box ], image_name)
|
23
|
+
end
|
24
|
+
|
25
|
+
config.set([ :vm, :providers, :docker, :create_args ], [ "--hostname='#{hostname}'" ])
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
data/locales/en.yml
CHANGED
@@ -572,6 +572,8 @@ en:
|
|
572
572
|
Provisioning %{provider} machine %{name}
|
573
573
|
build: |-
|
574
574
|
Building projects on %{provider} machine %{name}
|
575
|
+
profile: |-
|
576
|
+
Configured profile: %{provider}:::%{profile}
|
575
577
|
success:
|
576
578
|
complete: |-
|
577
579
|
Provisioning of %{provider} machine %{name} completed at %{time}
|
@@ -714,6 +716,9 @@ en:
|
|
714
716
|
Starting provision run
|
715
717
|
vagrant:
|
716
718
|
actions:
|
719
|
+
init_command:
|
720
|
+
start: |-
|
721
|
+
Initializing CORL command reference...
|
717
722
|
init_keys:
|
718
723
|
start: |-
|
719
724
|
Initializing CORL development keys...
|