librarian-puppet 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/librarian/puppet/dsl.rb +13 -2
- data/lib/librarian/puppet/source/forge.rb +8 -0
- data/lib/librarian/puppet/source/local.rb +8 -4
- data/lib/librarian/puppet/util.rb +1 -1
- data/lib/librarian/puppet/version.rb +1 -1
- metadata +28 -28
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2c4916fdcbc9dcfa3dcd3ce80abf048d41ba1a29
|
4
|
+
data.tar.gz: 2de58a47da5361bb2f149c05ffd2b298f08c4fb9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33e658e4b1a2513faf6bc4b3b9c3d0fa408b00e500735ee54d14f03578350f15dd829d54538ee4597d724b8645713c131c54f93bc601828e104a22886e9c0924
|
7
|
+
data.tar.gz: f1cfaacbdff4df3e3842611a49eb359f27281845f064fac2208772613000d488c1b59250295d9165b55558c34233cedd8263aab0edfef60fa182c3e46972f566
|
data/README.md
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
Librarian-puppet is a bundler for your puppet infrastructure. You can use
|
8
8
|
librarian-puppet to manage the puppet modules your infrastructure depends on,
|
9
9
|
whether the modules come from the [Puppet Forge](https://forge.puppetlabs.com/),
|
10
|
-
Git repositories or
|
10
|
+
Git repositories or just a path.
|
11
11
|
|
12
12
|
* Librarian-puppet can reuse the dependencies listed in your `Modulefile` or `metadata.json`
|
13
13
|
* Forge modules can be installed from [Puppetlabs Forge](https://forge.puppetlabs.com/) or an internal Forge such as [Pulp](http://www.pulpproject.org/)
|
data/lib/librarian/puppet/dsl.rb
CHANGED
@@ -6,6 +6,8 @@ module Librarian
|
|
6
6
|
module Puppet
|
7
7
|
class Dsl < Librarian::Dsl
|
8
8
|
|
9
|
+
FORGE_URL = "https://forgeapi.puppetlabs.com"
|
10
|
+
|
9
11
|
dependency :mod
|
10
12
|
|
11
13
|
source :forge => Source::Forge
|
@@ -20,7 +22,7 @@ module Librarian
|
|
20
22
|
if specfile.kind_of?(Pathname) and !File.exists?(specfile)
|
21
23
|
debug { "Specfile not found, using defaults: #{specfile}" }
|
22
24
|
specfile = Proc.new do
|
23
|
-
forge
|
25
|
+
forge FORGE_URL
|
24
26
|
metadata
|
25
27
|
end
|
26
28
|
end
|
@@ -33,6 +35,10 @@ module Librarian
|
|
33
35
|
receiver = Receiver.new(target)
|
34
36
|
receiver.run(specfile)
|
35
37
|
|
38
|
+
# save the default forge defined
|
39
|
+
default_forge = target.sources.select {|s| s.is_a? Librarian::Puppet::Source::Forge}.first
|
40
|
+
Librarian::Puppet::Source::Forge.default = default_forge || Librarian::Puppet::Source::Forge.from_lock_options(environment, :remote => FORGE_URL)
|
41
|
+
|
36
42
|
debug_named_source_cache("Post-Cached Sources", target)
|
37
43
|
end.to_spec
|
38
44
|
end
|
@@ -70,7 +76,12 @@ module Librarian
|
|
70
76
|
raise Error, msg
|
71
77
|
end
|
72
78
|
end
|
73
|
-
|
79
|
+
begin
|
80
|
+
json = JSON.parse(File.read(f))
|
81
|
+
rescue JSON::ParserError => e
|
82
|
+
raise Error, "Unable to parse json file #{f}: #{e}"
|
83
|
+
end
|
84
|
+
dependencyList = json['dependencies']
|
74
85
|
dependencyList.each do |d|
|
75
86
|
mod(d['name'], d['version_requirement'])
|
76
87
|
end
|
@@ -55,7 +55,7 @@ module Librarian
|
|
55
55
|
end
|
56
56
|
|
57
57
|
def forge_source
|
58
|
-
Forge.
|
58
|
+
Forge.default
|
59
59
|
end
|
60
60
|
|
61
61
|
private
|
@@ -105,7 +105,11 @@ module Librarian
|
|
105
105
|
def parsed_metadata
|
106
106
|
if @metadata.nil?
|
107
107
|
@metadata = if metadata?
|
108
|
-
|
108
|
+
begin
|
109
|
+
JSON.parse(File.read(metadata))
|
110
|
+
rescue JSON::ParserError => e
|
111
|
+
raise Error, "Unable to parse json file #{metadata}: #{e}"
|
112
|
+
end
|
109
113
|
elsif modulefile?
|
110
114
|
# translate Modulefile to metadata.json
|
111
115
|
evaluated = evaluate_modulefile(modulefile)
|
@@ -159,8 +163,8 @@ module Librarian
|
|
159
163
|
return true if path.join('manifests').exist?
|
160
164
|
return true if path.join('lib').join('puppet').exist?
|
161
165
|
return true if path.join('lib').join('facter').exist?
|
162
|
-
debug { "Could not find manifests, lib/puppet or lib/facter under #{path},
|
163
|
-
|
166
|
+
debug { "Could not find manifests, lib/puppet or lib/facter under #{path}, maybe it is not a puppet module" }
|
167
|
+
true
|
164
168
|
end
|
165
169
|
end
|
166
170
|
end
|
@@ -30,7 +30,7 @@ module Librarian
|
|
30
30
|
else
|
31
31
|
begin
|
32
32
|
FileUtils.cp_r(src, dest, :preserve => true)
|
33
|
-
rescue Errno::ENOENT
|
33
|
+
rescue Errno::ENOENT, Errno::EACCES
|
34
34
|
debug { "Failed to copy from #{src} to #{dest} preserving file types, trying again without preserving them" }
|
35
35
|
FileUtils.rm_rf(dest)
|
36
36
|
FileUtils.cp_r(src, dest)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: librarian-puppet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Sharpe
|
@@ -9,160 +9,160 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-12-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: librarian
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- -
|
18
|
+
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
20
|
version: 0.1.2
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- -
|
25
|
+
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: 0.1.2
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: rsync
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
|
-
- -
|
32
|
+
- - ">="
|
33
33
|
- !ruby/object:Gem::Version
|
34
34
|
version: '0'
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
|
-
- -
|
39
|
+
- - ">="
|
40
40
|
- !ruby/object:Gem::Version
|
41
41
|
version: '0'
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: puppet_forge
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
|
-
- -
|
46
|
+
- - ">="
|
47
47
|
- !ruby/object:Gem::Version
|
48
48
|
version: '0'
|
49
49
|
type: :runtime
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
|
-
- -
|
53
|
+
- - ">="
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: '0'
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: rake
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
|
-
- -
|
60
|
+
- - ">="
|
61
61
|
- !ruby/object:Gem::Version
|
62
62
|
version: '0'
|
63
63
|
type: :development
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
|
-
- -
|
67
|
+
- - ">="
|
68
68
|
- !ruby/object:Gem::Version
|
69
69
|
version: '0'
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: rspec
|
72
72
|
requirement: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
|
-
- -
|
74
|
+
- - ">="
|
75
75
|
- !ruby/object:Gem::Version
|
76
76
|
version: '0'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
79
|
version_requirements: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
|
-
- -
|
81
|
+
- - ">="
|
82
82
|
- !ruby/object:Gem::Version
|
83
83
|
version: '0'
|
84
84
|
- !ruby/object:Gem::Dependency
|
85
85
|
name: cucumber
|
86
86
|
requirement: !ruby/object:Gem::Requirement
|
87
87
|
requirements:
|
88
|
-
- -
|
88
|
+
- - ">="
|
89
89
|
- !ruby/object:Gem::Version
|
90
90
|
version: '0'
|
91
91
|
type: :development
|
92
92
|
prerelease: false
|
93
93
|
version_requirements: !ruby/object:Gem::Requirement
|
94
94
|
requirements:
|
95
|
-
- -
|
95
|
+
- - ">="
|
96
96
|
- !ruby/object:Gem::Version
|
97
97
|
version: '0'
|
98
98
|
- !ruby/object:Gem::Dependency
|
99
99
|
name: aruba
|
100
100
|
requirement: !ruby/object:Gem::Requirement
|
101
101
|
requirements:
|
102
|
-
- -
|
102
|
+
- - ">="
|
103
103
|
- !ruby/object:Gem::Version
|
104
104
|
version: '0'
|
105
105
|
type: :development
|
106
106
|
prerelease: false
|
107
107
|
version_requirements: !ruby/object:Gem::Requirement
|
108
108
|
requirements:
|
109
|
-
- -
|
109
|
+
- - ">="
|
110
110
|
- !ruby/object:Gem::Version
|
111
111
|
version: '0'
|
112
112
|
- !ruby/object:Gem::Dependency
|
113
113
|
name: puppet
|
114
114
|
requirement: !ruby/object:Gem::Requirement
|
115
115
|
requirements:
|
116
|
-
- -
|
116
|
+
- - ">="
|
117
117
|
- !ruby/object:Gem::Version
|
118
118
|
version: '0'
|
119
119
|
type: :development
|
120
120
|
prerelease: false
|
121
121
|
version_requirements: !ruby/object:Gem::Requirement
|
122
122
|
requirements:
|
123
|
-
- -
|
123
|
+
- - ">="
|
124
124
|
- !ruby/object:Gem::Version
|
125
125
|
version: '0'
|
126
126
|
- !ruby/object:Gem::Dependency
|
127
127
|
name: minitest
|
128
128
|
requirement: !ruby/object:Gem::Requirement
|
129
129
|
requirements:
|
130
|
-
- - ~>
|
130
|
+
- - "~>"
|
131
131
|
- !ruby/object:Gem::Version
|
132
132
|
version: '5'
|
133
133
|
type: :development
|
134
134
|
prerelease: false
|
135
135
|
version_requirements: !ruby/object:Gem::Requirement
|
136
136
|
requirements:
|
137
|
-
- - ~>
|
137
|
+
- - "~>"
|
138
138
|
- !ruby/object:Gem::Version
|
139
139
|
version: '5'
|
140
140
|
- !ruby/object:Gem::Dependency
|
141
141
|
name: mocha
|
142
142
|
requirement: !ruby/object:Gem::Requirement
|
143
143
|
requirements:
|
144
|
-
- -
|
144
|
+
- - ">="
|
145
145
|
- !ruby/object:Gem::Version
|
146
146
|
version: '0'
|
147
147
|
type: :development
|
148
148
|
prerelease: false
|
149
149
|
version_requirements: !ruby/object:Gem::Requirement
|
150
150
|
requirements:
|
151
|
-
- -
|
151
|
+
- - ">="
|
152
152
|
- !ruby/object:Gem::Version
|
153
153
|
version: '0'
|
154
154
|
- !ruby/object:Gem::Dependency
|
155
155
|
name: simplecov
|
156
156
|
requirement: !ruby/object:Gem::Requirement
|
157
157
|
requirements:
|
158
|
-
- -
|
158
|
+
- - ">="
|
159
159
|
- !ruby/object:Gem::Version
|
160
160
|
version: 0.9.0
|
161
161
|
type: :development
|
162
162
|
prerelease: false
|
163
163
|
version_requirements: !ruby/object:Gem::Requirement
|
164
164
|
requirements:
|
165
|
-
- -
|
165
|
+
- - ">="
|
166
166
|
- !ruby/object:Gem::Version
|
167
167
|
version: 0.9.0
|
168
168
|
description: |-
|
@@ -177,7 +177,7 @@ executables:
|
|
177
177
|
extensions: []
|
178
178
|
extra_rdoc_files: []
|
179
179
|
files:
|
180
|
-
- .gitignore
|
180
|
+
- ".gitignore"
|
181
181
|
- LICENSE
|
182
182
|
- README.md
|
183
183
|
- bin/librarian-puppet
|
@@ -214,17 +214,17 @@ require_paths:
|
|
214
214
|
- lib
|
215
215
|
required_ruby_version: !ruby/object:Gem::Requirement
|
216
216
|
requirements:
|
217
|
-
- -
|
217
|
+
- - ">="
|
218
218
|
- !ruby/object:Gem::Version
|
219
219
|
version: 1.9.0
|
220
220
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
221
221
|
requirements:
|
222
|
-
- -
|
222
|
+
- - ">="
|
223
223
|
- !ruby/object:Gem::Version
|
224
224
|
version: '0'
|
225
225
|
requirements: []
|
226
226
|
rubyforge_project:
|
227
|
-
rubygems_version: 2.2.
|
227
|
+
rubygems_version: 2.2.0
|
228
228
|
signing_key:
|
229
229
|
specification_version: 4
|
230
230
|
summary: Bundler for your Puppet modules
|