librarian-puppet 0.9.15 → 0.9.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/README.md +7 -7
- data/lib/librarian/puppet.rb +4 -31
- data/lib/librarian/puppet/source/forge.rb +18 -7
- data/lib/librarian/puppet/source/git.rb +2 -6
- data/lib/librarian/puppet/source/githubtarball.rb +6 -2
- data/lib/librarian/puppet/source/local.rb +3 -5
- data/lib/librarian/puppet/templates/Puppetfile +3 -0
- data/lib/librarian/puppet/version.rb +1 -1
- metadata +24 -36
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
OGM1ODBkNzUxNzk1MjQyNDk3NzI4NDg5OWE0ZmVjZjRlNzc2ZTM5OQ==
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 54463e29423057063ec5adeda81c88af20dcb792
|
4
|
+
data.tar.gz: 6e4031576cfc15cc883c6de125175d5e60a2f5a6
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
NGRiNzQyMjljODFjMDk3YzI5ZDk5NjdhYTBhZGVmZjJhZmUyMWYxMGM1YTVl
|
11
|
-
MGEyMDYxYjJlMTMwYzFmNGJhNDI5ZDdjMGNhZTQ3ODRmOWU3ZGU=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
ZmE5N2ExNTQwYmI4OWNmMDkyZjYyYWVjNjJmYTk0MzY1YWIwZjlkNWI2MTAy
|
14
|
-
MzAzYTk2M2VlMWU2MDYyNDU5YWFjNjFhNjdhMTk3NjJjMWM2OTdlNDRlZjlm
|
15
|
-
NDFkMmJkYzc4ZWY4YmYwODg3NDJiYjgzMzgzZjc2OWI5ZjA1NzY=
|
6
|
+
metadata.gz: 38b2d8ad9114c859f95986966c63892087510c5684e6825691294d845717c0d56f53d1972cb8f27963fb5af686e300e3b856db7d693391b2b64afcccc92fc8b9
|
7
|
+
data.tar.gz: 1e7a9a199b12c1793c2b9114748136e5b60105ed2fe2bdcc3ca9edc301f8b294c65ae716febd9f3f4cf2f2884f47fe878cdbc75a0e53aa06960550972c2ef721
|
data/README.md
CHANGED
@@ -40,10 +40,10 @@ This Puppetfile will download all the dependencies listed in your Modulefile fro
|
|
40
40
|
mod "puppetlabs/razor"
|
41
41
|
mod "puppetlabs/ntp", "0.0.3"
|
42
42
|
|
43
|
-
mod "apt",
|
43
|
+
mod "puppetlabs/apt",
|
44
44
|
:git => "git://github.com/puppetlabs/puppetlabs-apt.git"
|
45
45
|
|
46
|
-
mod "stdlib",
|
46
|
+
mod "puppetlabs/stdlib",
|
47
47
|
:git => "git://github.com/puppetlabs/puppetlabs-stdlib.git"
|
48
48
|
|
49
49
|
*See [jenkins-appliance](https://github.com/aussielunix/jenkins-appliance) for
|
@@ -51,7 +51,7 @@ a puppet repo already setup to use librarian-puppet.*
|
|
51
51
|
|
52
52
|
### Recursive module dependency resolving
|
53
53
|
|
54
|
-
When fetching a module
|
54
|
+
When fetching a module all dependencies specified in its
|
55
55
|
`Modulefile` and `Puppetfile` will be resolved and installed.
|
56
56
|
|
57
57
|
### Puppetfile Breakdown
|
@@ -71,20 +71,20 @@ source.
|
|
71
71
|
|
72
72
|
Pull in version 0.0.3 of the Puppet Labs NTP module from the default source.
|
73
73
|
|
74
|
-
mod "apt",
|
74
|
+
mod "puppetlabs/apt",
|
75
75
|
:git => "git://github.com/puppetlabs/puppetlabs-apt.git"
|
76
76
|
|
77
77
|
Our puppet infrastructure repository depends on the `apt` module from the
|
78
78
|
Puppet Labs GitHub repos and checks out the `master` branch.
|
79
79
|
|
80
|
-
mod "apt",
|
80
|
+
mod "puppetlabs/apt",
|
81
81
|
:git => "git://github.com/puppetlabs/puppetlabs-apt.git",
|
82
82
|
:ref => '0.0.3'
|
83
83
|
|
84
84
|
Our puppet infrastructure repository depends on the `apt` module from the
|
85
85
|
Puppet Labs GitHub repos and checks out a tag of `0.0.3`.
|
86
86
|
|
87
|
-
mod "apt",
|
87
|
+
mod "puppetlabs/apt",
|
88
88
|
:git => "git://github.com/puppetlabs/puppetlabs-apt.git",
|
89
89
|
:ref => 'feature/master/dans_refactor'
|
90
90
|
|
@@ -106,7 +106,7 @@ with many modules in it. If we need a module from such a repository, we can
|
|
106
106
|
use the `:path =>` option here to help Librarian-puppet drill down and find the
|
107
107
|
module subdirectory.
|
108
108
|
|
109
|
-
mod "apt",
|
109
|
+
mod "puppetlabs/apt",
|
110
110
|
:git => "git://github.com/fake/puppet-modules.git",
|
111
111
|
:path => "modules/apt"
|
112
112
|
|
data/lib/librarian/puppet.rb
CHANGED
@@ -1,42 +1,15 @@
|
|
1
1
|
require 'librarian'
|
2
2
|
require 'fileutils'
|
3
|
-
require 'open3'
|
4
|
-
require 'open3_backport' if RUBY_VERSION < '1.9'
|
5
3
|
|
6
|
-
status = nil
|
7
4
|
out = nil
|
8
|
-
err = nil
|
9
|
-
error = nil
|
10
|
-
|
11
5
|
begin
|
12
|
-
|
13
|
-
|
14
|
-
# Not sanitizing the environment for the moment.
|
15
|
-
Open3.popen3('puppet --version') { |stdin, stdout, stderr, wait_thr|
|
16
|
-
pid = wait_thr.pid # pid of the started process.
|
17
|
-
out = stdout.read
|
18
|
-
err = stderr.read
|
19
|
-
status = wait_thr.value # Process::Status object returned.
|
20
|
-
}
|
21
|
-
else
|
22
|
-
env_reset = {'GEM_PATH' => nil, 'BUNDLE_APP_CONFIG' => nil, 'BUNDLE_CONFIG' => nil, 'BUNDLE_GEMFILE' => nil}
|
23
|
-
Open3.popen3(env_reset, 'puppet --version') { |stdin, stdout, stderr, wait_thr|
|
24
|
-
pid = wait_thr.pid # pid of the started process.
|
25
|
-
out = stdout.read
|
26
|
-
err = stderr.read
|
27
|
-
status = wait_thr.value # Process::Status object returned.
|
28
|
-
}
|
29
|
-
end
|
30
|
-
rescue => e
|
31
|
-
error = e
|
32
|
-
end
|
6
|
+
out = Librarian::Posix.run!(%W{puppet --version})
|
7
|
+
rescue Librarian::Posix::CommandFailure => error
|
33
8
|
|
34
|
-
if status.nil? or status.exitstatus != 0
|
35
9
|
$stderr.puts <<-EOF
|
36
10
|
Unable to load puppet. Please install it using native packages for your platform (eg .deb, .rpm, .dmg, etc).
|
37
|
-
|
38
|
-
#{error.message unless error.nil?}
|
39
|
-
#{err unless err.nil?}
|
11
|
+
puppet --version returned #{status.exitstatus}
|
12
|
+
#{error.message unless error.message.nil?}
|
40
13
|
EOF
|
41
14
|
exit 1
|
42
15
|
end
|
@@ -101,18 +101,29 @@ module Librarian
|
|
101
101
|
|
102
102
|
path.mkpath
|
103
103
|
|
104
|
-
target = vendored?(name, version) ? vendored_path(name, version) : name
|
104
|
+
target = vendored?(name, version) ? vendored_path(name, version).to_s : name
|
105
105
|
|
106
106
|
|
107
|
-
command =
|
107
|
+
command = %W{puppet module install --version #{version} --target-dir}
|
108
|
+
command.push(*[path.to_s, "--module_repository", source.to_s, "--modulepath", path.to_s, "--module_working_dir", path.to_s, "--ignore-dependencies", target])
|
108
109
|
debug { "Executing puppet module install for #{name} #{version}" }
|
109
|
-
output = `#{command}`
|
110
110
|
|
111
|
-
|
112
|
-
|
111
|
+
begin
|
112
|
+
Librarian::Posix.run!(command)
|
113
|
+
rescue Posix::CommandFailure => e
|
113
114
|
# Rollback the directory if the puppet module had an error
|
114
|
-
|
115
|
-
|
115
|
+
begin
|
116
|
+
path.unlink
|
117
|
+
rescue => u
|
118
|
+
warn("Unable to rollback path #{path}: #{u}")
|
119
|
+
end
|
120
|
+
tar = Dir[File.join(path.to_s, "**/*.tar.gz")]
|
121
|
+
msg = ""
|
122
|
+
if e.message =~ /Unexpected EOF in archive/ and !tar.empty?
|
123
|
+
file = tar.first
|
124
|
+
msg = " (looks like an incomplete download of #{file})"
|
125
|
+
end
|
126
|
+
raise Error, "Error executing puppet module install#{msg}:\n#{command.join(" ")}\nError:\n#{e.message}"
|
116
127
|
end
|
117
128
|
|
118
129
|
end
|
@@ -48,17 +48,13 @@ module Librarian
|
|
48
48
|
repository.path.rmtree if repository.path.exist?
|
49
49
|
repository.path.mkpath
|
50
50
|
|
51
|
-
|
52
|
-
%x{tar xzf #{vendor_tgz}}
|
53
|
-
end
|
51
|
+
run!(%W{tar xzf #{vendor_tgz}}, :chdir => repository.path.to_s)
|
54
52
|
|
55
53
|
repository_cached!
|
56
54
|
end
|
57
55
|
|
58
56
|
def cache_in_vendor(tmp_path)
|
59
|
-
|
60
|
-
%x{git archive #{sha} | gzip > #{vendor_tgz}}
|
61
|
-
end
|
57
|
+
run!(%W{git archive #{sha} | gzip > #{vendor_tgz}}, :chdir => tmp_path.to_s)
|
62
58
|
end
|
63
59
|
|
64
60
|
end
|
@@ -22,9 +22,11 @@ module Librarian
|
|
22
22
|
def initialize(source, name)
|
23
23
|
self.source = source
|
24
24
|
self.name = name
|
25
|
+
warn { "githubtarball sources are deprecated: #{name} [#{source}]" }
|
25
26
|
end
|
26
27
|
|
27
28
|
def versions
|
29
|
+
return @versions if @versions
|
28
30
|
data = api_call("/repos/#{source.uri}/tags")
|
29
31
|
if data.nil?
|
30
32
|
raise Error, "Unable to find module '#{source.uri}' on https://github.com"
|
@@ -36,7 +38,9 @@ module Librarian
|
|
36
38
|
version !~ /\A\d\.\d(\.\d.*)?\z/
|
37
39
|
end
|
38
40
|
|
39
|
-
all_versions.compact
|
41
|
+
@versions = all_versions.compact
|
42
|
+
debug { " Module #{name} found versions: #{@versions.join(", ")}" }
|
43
|
+
@versions
|
40
44
|
end
|
41
45
|
|
42
46
|
def manifests
|
@@ -86,7 +90,7 @@ module Librarian
|
|
86
90
|
|
87
91
|
target = vendored?(source.uri, version) ? vendored_path(source.uri, version) : name
|
88
92
|
|
89
|
-
|
93
|
+
Librarian::Posix.run!(%W{tar xzf #{target} -C #{path}})
|
90
94
|
end
|
91
95
|
|
92
96
|
def vendored?(name, version)
|
@@ -23,13 +23,11 @@ module Librarian
|
|
23
23
|
found_path = found_path(name)
|
24
24
|
raise Error, "Path for #{name} doesn't contain a puppet module" if found_path.nil?
|
25
25
|
|
26
|
-
|
27
|
-
|
28
|
-
debug { "Invalid module name '#{name}', guessing you meant '#{new_name}'" }
|
29
|
-
name = new_name
|
26
|
+
unless name.include? '/'
|
27
|
+
warn { "Invalid module name '#{name}', you should qualify it with 'ORGANIZATION/#{name}' for resolution to work correctly" }
|
30
28
|
end
|
31
29
|
|
32
|
-
install_path = environment.install_path.join(name)
|
30
|
+
install_path = environment.install_path.join(name.split('/').last)
|
33
31
|
if install_path.exist?
|
34
32
|
debug { "Deleting #{relative_path_to(install_path)}" }
|
35
33
|
install_path.rmtree
|
metadata
CHANGED
@@ -1,125 +1,111 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: librarian-puppet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Sharpe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03
|
11
|
+
date: 2014-04-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: librarian
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - '>='
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 0.1.2
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 0.1.2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: json
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - '>='
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: open3_backport
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ! '>='
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
48
|
-
type: :runtime
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ! '>='
|
38
|
+
- - '>='
|
53
39
|
- !ruby/object:Gem::Version
|
54
40
|
version: '0'
|
55
41
|
- !ruby/object:Gem::Dependency
|
56
42
|
name: rake
|
57
43
|
requirement: !ruby/object:Gem::Requirement
|
58
44
|
requirements:
|
59
|
-
- -
|
45
|
+
- - '>='
|
60
46
|
- !ruby/object:Gem::Version
|
61
47
|
version: '0'
|
62
48
|
type: :development
|
63
49
|
prerelease: false
|
64
50
|
version_requirements: !ruby/object:Gem::Requirement
|
65
51
|
requirements:
|
66
|
-
- -
|
52
|
+
- - '>='
|
67
53
|
- !ruby/object:Gem::Version
|
68
54
|
version: '0'
|
69
55
|
- !ruby/object:Gem::Dependency
|
70
56
|
name: rspec
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|
72
58
|
requirements:
|
73
|
-
- -
|
59
|
+
- - '>='
|
74
60
|
- !ruby/object:Gem::Version
|
75
61
|
version: '0'
|
76
62
|
type: :development
|
77
63
|
prerelease: false
|
78
64
|
version_requirements: !ruby/object:Gem::Requirement
|
79
65
|
requirements:
|
80
|
-
- -
|
66
|
+
- - '>='
|
81
67
|
- !ruby/object:Gem::Version
|
82
68
|
version: '0'
|
83
69
|
- !ruby/object:Gem::Dependency
|
84
70
|
name: cucumber
|
85
71
|
requirement: !ruby/object:Gem::Requirement
|
86
72
|
requirements:
|
87
|
-
- -
|
73
|
+
- - '>='
|
88
74
|
- !ruby/object:Gem::Version
|
89
75
|
version: '0'
|
90
76
|
type: :development
|
91
77
|
prerelease: false
|
92
78
|
version_requirements: !ruby/object:Gem::Requirement
|
93
79
|
requirements:
|
94
|
-
- -
|
80
|
+
- - '>='
|
95
81
|
- !ruby/object:Gem::Version
|
96
82
|
version: '0'
|
97
83
|
- !ruby/object:Gem::Dependency
|
98
84
|
name: aruba
|
99
85
|
requirement: !ruby/object:Gem::Requirement
|
100
86
|
requirements:
|
101
|
-
- -
|
87
|
+
- - '>='
|
102
88
|
- !ruby/object:Gem::Version
|
103
89
|
version: '0'
|
104
90
|
type: :development
|
105
91
|
prerelease: false
|
106
92
|
version_requirements: !ruby/object:Gem::Requirement
|
107
93
|
requirements:
|
108
|
-
- -
|
94
|
+
- - '>='
|
109
95
|
- !ruby/object:Gem::Version
|
110
96
|
version: '0'
|
111
97
|
- !ruby/object:Gem::Dependency
|
112
98
|
name: puppet
|
113
99
|
requirement: !ruby/object:Gem::Requirement
|
114
100
|
requirements:
|
115
|
-
- -
|
101
|
+
- - '>='
|
116
102
|
- !ruby/object:Gem::Version
|
117
103
|
version: '0'
|
118
104
|
type: :development
|
119
105
|
prerelease: false
|
120
106
|
version_requirements: !ruby/object:Gem::Requirement
|
121
107
|
requirements:
|
122
|
-
- -
|
108
|
+
- - '>='
|
123
109
|
- !ruby/object:Gem::Version
|
124
110
|
version: '0'
|
125
111
|
- !ruby/object:Gem::Dependency
|
@@ -140,18 +126,20 @@ dependencies:
|
|
140
126
|
name: mocha
|
141
127
|
requirement: !ruby/object:Gem::Requirement
|
142
128
|
requirements:
|
143
|
-
- -
|
129
|
+
- - '>='
|
144
130
|
- !ruby/object:Gem::Version
|
145
131
|
version: '0'
|
146
132
|
type: :development
|
147
133
|
prerelease: false
|
148
134
|
version_requirements: !ruby/object:Gem::Requirement
|
149
135
|
requirements:
|
150
|
-
- -
|
136
|
+
- - '>='
|
151
137
|
- !ruby/object:Gem::Version
|
152
138
|
version: '0'
|
153
|
-
description:
|
154
|
-
|
139
|
+
description: |-
|
140
|
+
Simplify deployment of your Puppet infrastructure by
|
141
|
+
automatically pulling in modules from the forge and git repositories with
|
142
|
+
a single command.
|
155
143
|
email:
|
156
144
|
- tim@sharpe.id.au
|
157
145
|
executables:
|
@@ -189,12 +177,12 @@ require_paths:
|
|
189
177
|
- lib
|
190
178
|
required_ruby_version: !ruby/object:Gem::Requirement
|
191
179
|
requirements:
|
192
|
-
- -
|
180
|
+
- - '>='
|
193
181
|
- !ruby/object:Gem::Version
|
194
182
|
version: '0'
|
195
183
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
196
184
|
requirements:
|
197
|
-
- -
|
185
|
+
- - '>='
|
198
186
|
- !ruby/object:Gem::Version
|
199
187
|
version: '0'
|
200
188
|
requirements: []
|