pupistry 1.3.0 → 1.3.1
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/lib/pupistry/agent.rb +28 -1
- data/lib/pupistry/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b194966f9998c32e6272e2d31c7cecded4d58c95
|
4
|
+
data.tar.gz: 824e9e3d6e695ede6524c805e12d3b8376521815
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e17bd516928ec6db3ddca4e65dc515a3273ddce0dd021622efa574244dd7721d27d3040961d885499b3760112729ed05f088e4c43c4ad700b3958c07514b639e
|
7
|
+
data.tar.gz: 0a0f8384d7260a0b1123c094a32cf49f35658361acc7eeb92e57905e7001bf9c033ebcd5553a7af7926eb7738c6b7eeafef171ff170a5117a70eacb8324fb966
|
data/lib/pupistry/agent.rb
CHANGED
@@ -142,7 +142,7 @@ module Pupistry
|
|
142
142
|
puppet_cmd += " --environment #{environment}"
|
143
143
|
puppet_cmd += " --confdir #{$config['agent']['puppetcode']}"
|
144
144
|
puppet_cmd += " --environmentpath #{$config['agent']['puppetcode']}"
|
145
|
-
puppet_cmd += " --modulepath #{
|
145
|
+
puppet_cmd += " --modulepath #{build_modulepath(environment)}"
|
146
146
|
puppet_cmd += " --hiera_config #{$config['agent']['puppetcode']}/#{environment}/hiera.yaml"
|
147
147
|
puppet_cmd += " #{$config['agent']['puppetcode']}/#{environment}/manifests/site.pp"
|
148
148
|
|
@@ -151,6 +151,33 @@ module Pupistry
|
|
151
151
|
|
152
152
|
$logger.error 'An unexpected issue occured when running puppet' unless system puppet_cmd
|
153
153
|
end
|
154
|
+
|
155
|
+
def self.build_modulepath(environment)
|
156
|
+
|
157
|
+
environment_path = "#{$config['agent']['puppetcode']}/#{environment}"
|
158
|
+
environment_conf = "#{environment_path}/environment.conf"
|
159
|
+
|
160
|
+
configured_paths = []
|
161
|
+
|
162
|
+
if File.exist?(environment_conf)
|
163
|
+
$logger.debug "Adding modulepath config from '#{environment_path}'"
|
164
|
+
|
165
|
+
File.open(environment_conf, 'r').readlines.each do |line|
|
166
|
+
if line !~ /^\s*#/ && /^(.*)=(.*)/ =~ line
|
167
|
+
key, val = $1.strip, $2.strip
|
168
|
+
configured_paths = val.split(':') if key == 'modulepath'
|
169
|
+
end
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
173
|
+
modulepaths = configured_paths.map { |path| File.expand_path(path, environment_path) }
|
174
|
+
|
175
|
+
# Ensure '<environment_path>/modules' in modulepath.
|
176
|
+
ensure_path = File.expand_path('modules', environment_path)
|
177
|
+
modulepaths.insert(0, ensure_path) unless modulepaths.include? ensure_path
|
178
|
+
|
179
|
+
modulepaths.join(File::PATH_SEPARATOR)
|
180
|
+
end
|
154
181
|
end
|
155
182
|
end
|
156
183
|
|
data/lib/pupistry/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pupistry
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jethro Carr
|
@@ -237,3 +237,4 @@ signing_key:
|
|
237
237
|
specification_version: 4
|
238
238
|
summary: A workflow tool for Puppet Masterless Deployments
|
239
239
|
test_files: []
|
240
|
+
has_rdoc:
|