corl 0.4.21 → 0.4.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/VERSION +1 -1
- data/bootstrap/os/ubuntu/06_puppet.sh +9 -3
- data/corl.gemspec +3 -3
- data/lib/CORL/action/lookup.rb +9 -0
- data/lib/core/mixin/lookup.rb +3 -3
- data/lib/core/mixin/machine/ssh.rb +1 -1
- data/lib/core/plugin/node.rb +1 -1
- data/lib/core/util/puppet/resource_group.rb +7 -9
- data/lib/core/util/puppet.rb +9 -5
- data/locales/en.yml +7 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6689cece3da0f0598e2b101e9d830d54f3772fc9
|
4
|
+
data.tar.gz: b82d70a25434a64f1704eec02f5811b9e41283f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29952bd940117c67ff3159faddc993dc9d76c2e95ad7a8037e85169caedb1a169a3a5b91960d2d1c893c5d92576bd9dec548f354e96f58bec8e736ca0ef5681d
|
7
|
+
data.tar.gz: 08a1399763d9dbb9865e1642d4ae8769ca1ccb895888ae3e13359518932c364118a3462cfd3f9e23fbf141a8d8e99f751860d2015f2c1855fef3dfe22d568fa3
|
data/Gemfile.lock
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.22
|
@@ -15,8 +15,8 @@ esac
|
|
15
15
|
# Set up Puppet Apt repositories
|
16
16
|
apt-key adv --recv-key --keyserver pgp.mit.edu 4BD6EC30 2>&1 || exit 60
|
17
17
|
|
18
|
-
echo -e "deb http://apt.puppetlabs.com $OS_NAME main dependencies\ndeb-src http://apt.puppetlabs.com $OS_NAME main dependencies" | cat > /etc/apt/sources.list.d/
|
19
|
-
chmod 0644 /etc/apt/sources.list.d/
|
18
|
+
echo -e "deb http://apt.puppetlabs.com $OS_NAME main dependencies\ndeb-src http://apt.puppetlabs.com $OS_NAME main dependencies" | cat > /etc/apt/sources.list.d/corl_puppet.list || exit 61
|
19
|
+
chmod 0644 /etc/apt/sources.list.d/corl_puppet.list || exit 62
|
20
20
|
|
21
21
|
# Install Puppet
|
22
22
|
apt-get -y update || exit 63
|
@@ -26,6 +26,8 @@ apt-get -y install puppet-common="$PUPPET_PACKAGE" puppet="$PUPPET_PACKAGE" || e
|
|
26
26
|
# Set up Hiera configuration
|
27
27
|
mkdir -p /var/corl/config || exit 65
|
28
28
|
|
29
|
+
if [ ! -e /etc/hiera.yaml ]
|
30
|
+
then
|
29
31
|
( cat <<'EOP'
|
30
32
|
---
|
31
33
|
:merge_behavior: deeper
|
@@ -41,5 +43,9 @@ mkdir -p /var/corl/config || exit 65
|
|
41
43
|
EOP
|
42
44
|
) > /etc/hiera.yaml || exit 66
|
43
45
|
chmod 0440 /etc/hiera.yaml || exit 67
|
46
|
+
fi
|
44
47
|
|
45
|
-
|
48
|
+
if [ ! -e /etc/puppet/hiera.yaml ]
|
49
|
+
then
|
50
|
+
ln -fs /etc/hiera.yaml /etc/puppet/hiera.yaml || exit 68
|
51
|
+
fi
|
data/corl.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: corl 0.4.
|
5
|
+
# stub: corl 0.4.22 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "corl"
|
9
|
-
s.version = "0.4.
|
9
|
+
s.version = "0.4.22"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
13
13
|
s.authors = ["Adrian Webb"]
|
14
|
-
s.date = "2014-
|
14
|
+
s.date = "2014-05-02"
|
15
15
|
s.description = "Framework that provides a simple foundation for growing organically in the cloud"
|
16
16
|
s.email = "adrian.webb@coralnexus.com"
|
17
17
|
s.executables = ["corl"]
|
data/lib/CORL/action/lookup.rb
CHANGED
@@ -9,6 +9,15 @@ class Lookup < Plugin::CloudAction
|
|
9
9
|
def configure
|
10
10
|
super do
|
11
11
|
register :property, :str, nil
|
12
|
+
register :context, :str, :priority do |value|
|
13
|
+
success = true
|
14
|
+
options = [ :priority, :array, :hash ]
|
15
|
+
unless options.include?(value.to_sym)
|
16
|
+
warn('corl.actions.lookup.errors.context', { :value => value, :options => options.join(', ') })
|
17
|
+
success = false
|
18
|
+
end
|
19
|
+
success
|
20
|
+
end
|
12
21
|
end
|
13
22
|
end
|
14
23
|
|
data/lib/core/mixin/lookup.rb
CHANGED
@@ -141,7 +141,7 @@ module Lookup
|
|
141
141
|
|
142
142
|
def lookup_array(properties, default = [], options = {})
|
143
143
|
config = Config.ensure(options)
|
144
|
-
value, property = lookup(properties, nil, config.import({ :return_property => true }))
|
144
|
+
value, property = lookup(properties, nil, config.import({ :return_property => true, :context => :array }))
|
145
145
|
|
146
146
|
if Util::Data.undef?(value)
|
147
147
|
value = default
|
@@ -170,7 +170,7 @@ module Lookup
|
|
170
170
|
|
171
171
|
def lookup_hash(properties, default = {}, options = {})
|
172
172
|
config = Config.ensure(options)
|
173
|
-
value, property = lookup(properties, nil, config.import({ :return_property => true }))
|
173
|
+
value, property = lookup(properties, nil, config.import({ :return_property => true, :context => :hash }))
|
174
174
|
|
175
175
|
if Util::Data.undef?(value)
|
176
176
|
value = default
|
@@ -198,7 +198,7 @@ module Lookup
|
|
198
198
|
#---
|
199
199
|
|
200
200
|
def normalize(data, override = nil, options = {})
|
201
|
-
config = Config.ensure(options)
|
201
|
+
config = Config.ensure(options).import({ :context => :hash })
|
202
202
|
results = {}
|
203
203
|
|
204
204
|
unless Util::Data.undef?(override)
|
data/lib/core/plugin/node.rb
CHANGED
@@ -593,7 +593,7 @@ class Node < CORL.plugin_class(:base)
|
|
593
593
|
default_error = Util::Shell::Result.new(:error, 255)
|
594
594
|
results = [ default_error ]
|
595
595
|
|
596
|
-
if machine && machine.running?
|
596
|
+
if local? && local_machine || machine && machine.running?
|
597
597
|
config = Config.ensure(options)
|
598
598
|
|
599
599
|
if extension_check(:exec, { :config => config })
|
@@ -121,6 +121,8 @@ class ResourceGroup < Core
|
|
121
121
|
resources = Data.value(resources)
|
122
122
|
|
123
123
|
unless Data.empty?(resources)
|
124
|
+
resource_names = {}
|
125
|
+
|
124
126
|
resources.keys.each do |name|
|
125
127
|
if ! resources[name] || resources[name].empty? || ! resources[name].is_a?(Hash)
|
126
128
|
resources.delete(name)
|
@@ -151,10 +153,13 @@ class ResourceGroup < Core
|
|
151
153
|
|
152
154
|
if normalize
|
153
155
|
resource = Resource.new(self, info, name, resources[name]).defaults(default, config)
|
154
|
-
|
156
|
+
resource_names[name] = true
|
157
|
+
resources[name] = resource
|
155
158
|
end
|
156
159
|
end
|
157
160
|
end
|
161
|
+
|
162
|
+
config[:resource_names] = resource_names
|
158
163
|
resources.each do |name, resource|
|
159
164
|
resource.process(config)
|
160
165
|
end
|
@@ -168,14 +173,7 @@ class ResourceGroup < Core
|
|
168
173
|
def translate(resources, options = {})
|
169
174
|
config = Config.ensure(options)
|
170
175
|
results = {}
|
171
|
-
|
172
|
-
prefix = config.get(:resource_prefix, '')
|
173
|
-
name_map = {}
|
174
|
-
|
175
|
-
resources.keys.each do |name|
|
176
|
-
name_map[name] = true
|
177
|
-
end
|
178
|
-
config[:resource_names] = name_map
|
176
|
+
prefix = config.get(:resource_prefix, '')
|
179
177
|
|
180
178
|
resources.each do |name, resource|
|
181
179
|
unless prefix.empty?
|
data/lib/core/util/puppet.rb
CHANGED
@@ -119,14 +119,16 @@ module Puppet
|
|
119
119
|
case type[:type]
|
120
120
|
when :type, :define
|
121
121
|
CORL.ui_group(Util::Console.cyan(display_name)) do |ui|
|
122
|
-
rendered_title
|
123
|
-
|
122
|
+
rendered_title = Util::Console.blue(title)
|
123
|
+
rendered_resource = Util::Console.green("#{type_name(type[:name])}[#{rendered_title}]")
|
124
|
+
ui.info("Adding #{rendered_resource}")
|
124
125
|
end
|
125
126
|
add_definition(type, title, properties, config)
|
126
127
|
when :class
|
127
128
|
CORL.ui_group(Util::Console.cyan(display_name)) do |ui|
|
128
|
-
rendered_title
|
129
|
-
|
129
|
+
rendered_title = Util::Console.blue(title)
|
130
|
+
rendered_resource = Util::Console.green("Class[#{rendered_title}]")
|
131
|
+
ui.info("Adding #{rendered_resource}")
|
130
132
|
end
|
131
133
|
add_class(title, properties, config)
|
132
134
|
end
|
@@ -214,7 +216,9 @@ module Puppet
|
|
214
216
|
if classes.is_a?(Array)
|
215
217
|
classes.each do |klass|
|
216
218
|
CORL.ui_group(Util::Console.cyan(display_name)) do |ui|
|
217
|
-
|
219
|
+
rendered_klass = Util::Console.blue(klass)
|
220
|
+
rendered_resource = Util::Console.green("Class[#{rendered_klass}]")
|
221
|
+
ui.info("Including #{rendered_resource}")
|
218
222
|
end
|
219
223
|
class_data[klass] = properties
|
220
224
|
end
|
data/locales/en.yml
CHANGED
@@ -141,6 +141,13 @@ en:
|
|
141
141
|
options:
|
142
142
|
command: |-
|
143
143
|
Command line executable and arguments to execute on machine
|
144
|
+
lookup:
|
145
|
+
options:
|
146
|
+
context: |-
|
147
|
+
Lookup evaluation context; priority, array, hash (default %{default_value})
|
148
|
+
errors:
|
149
|
+
context: |-
|
150
|
+
Lookup evaluation context %{value} is not valid >> Possible contexts: %{choices}
|
144
151
|
seed:
|
145
152
|
options:
|
146
153
|
project_branch: |-
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: corl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.22
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adrian Webb
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-05-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nucleon
|