|
1 From dcd2568b4bcb30962da54a4a12c3d75b3f5da2b5 Mon Sep 17 00:00:00 2001 |
|
2 From: Shawn Ferry <[email protected]> |
|
3 Date: Fri, 9 Dec 2016 15:01:26 -0500 |
|
4 Subject: [PATCH] Puppet4 paths |
|
5 |
|
6 Patches not suitable for upstream |
|
7 25232171 puppet hard codes new path locations |
|
8 25232111 puppet install.rb vardir argument has no impact |
|
9 --- |
|
10 install.rb | 4 ++-- |
|
11 lib/puppet/defaults.rb | 2 +- |
|
12 lib/puppet/face/config.rb | 2 +- |
|
13 lib/puppet/face/module/install.rb | 12 ++++++------ |
|
14 lib/puppet/face/module/list.rb | 10 +++++----- |
|
15 lib/puppet/face/module/uninstall.rb | 4 ++-- |
|
16 lib/puppet/provider/package/puppet_gem.rb | 2 +- |
|
17 lib/puppet/reference/configuration.rb | 2 +- |
|
18 lib/puppet/util/run_mode.rb | 2 +- |
|
19 man/man5/puppet.conf.5 | 4 ++-- |
|
20 man/man8/puppet-config.8 | 2 +- |
|
21 man/man8/puppet-module.8 | 14 +++++++------- |
|
22 spec/unit/provider/package/puppet_gem_spec.rb | 2 +- |
|
23 spec/unit/util/run_mode_spec.rb | 4 ++-- |
|
24 14 files changed, 33 insertions(+), 33 deletions(-) |
|
25 |
|
26 diff --git a/install.rb b/install.rb |
|
27 index bed64d0..dccf787 100755 |
|
28 --- a/install.rb |
|
29 +++ b/install.rb |
|
30 @@ -178,7 +178,7 @@ def prepare_installation |
|
31 opts.on('--codedir[=OPTIONAL]', 'Installation directory for code files', 'Default /etc/puppetlabs/code') do |codedir| |
|
32 InstallOptions.codedir = codedir |
|
33 end |
|
34 - opts.on('--vardir[=OPTIONAL]', 'Installation directory for var files', 'Default /opt/puppetlabs/puppet/cache') do |vardir| |
|
35 + opts.on('--vardir[=OPTIONAL]', 'Installation directory for var files', 'Default /var/puppetlabs/puppet/cache') do |vardir| |
|
36 InstallOptions.vardir = vardir |
|
37 end |
|
38 opts.on('--rundir[=OPTIONAL]', 'Installation directory for state files', 'Default /var/run/puppetlabs') do |rundir| |
|
39 @@ -269,7 +269,7 @@ def prepare_installation |
|
40 elsif $operatingsystem == "windows" |
|
41 vardir = File.join(Dir::COMMON_APPDATA, "PuppetLabs", "puppet", "cache") |
|
42 else |
|
43 - vardir = "/opt/puppetlabs/puppet/cache" |
|
44 + vardir = "/var/puppetlabs/puppet/cache" |
|
45 end |
|
46 |
|
47 if not InstallOptions.rundir.nil? |
|
48 diff --git a/lib/puppet/defaults.rb b/lib/puppet/defaults.rb |
|
49 index fa1aeaa..ff4f210 100644 |
|
50 --- a/lib/puppet/defaults.rb |
|
51 +++ b/lib/puppet/defaults.rb |
|
52 @@ -1207,7 +1207,7 @@ EOT |
|
53 :desc => "File that provides mapping between custom SSL oids and user-friendly names" |
|
54 }, |
|
55 :basemodulepath => { |
|
56 - :default => "$codedir/modules#{File::PATH_SEPARATOR}/opt/puppetlabs/puppet/modules", |
|
57 + :default => "$codedir/modules#{File::PATH_SEPARATOR}/usr/puppetlabs/puppet/modules", |
|
58 :type => :path, |
|
59 :desc => "The search path for **global** modules. Should be specified as a |
|
60 list of directories separated by the system path separator character. (The |
|
61 diff --git a/lib/puppet/face/config.rb b/lib/puppet/face/config.rb |
|
62 index cd8e746..82a9463 100644 |
|
63 --- a/lib/puppet/face/config.rb |
|
64 +++ b/lib/puppet/face/config.rb |
|
65 @@ -102,7 +102,7 @@ Puppet::Face.define(:config, '0.0.1') do |
|
66 |
|
67 Set the vardir for only the agent: |
|
68 |
|
69 - $ puppet config set vardir /opt/puppetlabs/puppet/cache --section agent |
|
70 + $ puppet config set vardir /var/puppetlabs/puppet/cache --section agent |
|
71 EOT |
|
72 |
|
73 when_invoked do |name, value, options| |
|
74 diff --git a/lib/puppet/face/module/install.rb b/lib/puppet/face/module/install.rb |
|
75 index d0ab01e..d533547 100644 |
|
76 --- a/lib/puppet/face/module/install.rb |
|
77 +++ b/lib/puppet/face/module/install.rb |
|
78 @@ -46,20 +46,20 @@ Puppet::Face.define(:module, '1.0.0') do |
|
79 |
|
80 Install a module into a specific directory: |
|
81 |
|
82 - $ puppet module install puppetlabs-vcsrepo --target-dir=/opt/puppetlabs/puppet/modules |
|
83 - Preparing to install into /opt/puppetlabs/puppet/modules ... |
|
84 + $ puppet module install puppetlabs-vcsrepo --target-dir=/usr/puppetlabs/puppet/modules |
|
85 + Preparing to install into /usr/puppetlabs/puppet/modules ... |
|
86 Downloading from https://forgeapi.puppetlabs.com ... |
|
87 Installing -- do not interrupt ... |
|
88 - /opt/puppetlabs/puppet/modules |
|
89 + /usr/puppetlabs/puppet/modules |
|
90 └── puppetlabs-vcsrepo (v0.0.4) |
|
91 |
|
92 Install a module into a specific directory and check for dependencies in other directories: |
|
93 |
|
94 - $ puppet module install puppetlabs-vcsrepo --target-dir=/opt/puppetlabs/puppet/modules --modulepath /etc/puppetlabs/code/modules |
|
95 - Preparing to install into /opt/puppetlabs/puppet/modules ... |
|
96 + $ puppet module install puppetlabs-vcsrepo --target-dir=/usr/puppetlabs/puppet/modules --modulepath /etc/puppetlabs/code/modules |
|
97 + Preparing to install into /usr/puppetlabs/puppet/modules ... |
|
98 Downloading from https://forgeapi.puppetlabs.com ... |
|
99 Installing -- do not interrupt ... |
|
100 - /opt/puppetlabs/puppet/modules |
|
101 + /usr/puppetlabs/puppet/modules |
|
102 └── puppetlabs-vcsrepo (v0.0.4) |
|
103 |
|
104 Install a module from a release archive: |
|
105 diff --git a/lib/puppet/face/module/list.rb b/lib/puppet/face/module/list.rb |
|
106 index cecaf5b..df51df6 100644 |
|
107 --- a/lib/puppet/face/module/list.rb |
|
108 +++ b/lib/puppet/face/module/list.rb |
|
109 @@ -27,7 +27,7 @@ Puppet::Face.define(:module, '1.0.0') do |
|
110 ├── puppetlabs-mysql (v0.0.1) |
|
111 ├── puppetlabs-sqlite (v0.0.1) |
|
112 └── puppetlabs-stdlib (v2.2.1) |
|
113 - /opt/puppetlabs/puppet/modules (no modules installed) |
|
114 + /usr/puppetlabs/puppet/modules (no modules installed) |
|
115 |
|
116 List installed modules in a tree view: |
|
117 |
|
118 @@ -38,7 +38,7 @@ Puppet::Face.define(:module, '1.0.0') do |
|
119 ├─┬ puppetlabs-mysql (v0.0.1) |
|
120 │ └── bodepd-create_resources (v0.0.1) |
|
121 └── puppetlabs-sqlite (v0.0.1) |
|
122 - /opt/puppetlabs/puppet/modules (no modules installed) |
|
123 + /usr/puppetlabs/puppet/modules (no modules installed) |
|
124 |
|
125 List installed modules from a specified environment: |
|
126 |
|
127 @@ -49,12 +49,12 @@ Puppet::Face.define(:module, '1.0.0') do |
|
128 ├── puppetlabs-mysql (v0.0.1) |
|
129 ├── puppetlabs-sqlite (v0.0.1) |
|
130 └── puppetlabs-stdlib (v2.2.1) |
|
131 - /opt/puppetlabs/puppet/modules (no modules installed) |
|
132 + /usr/puppetlabs/puppet/modules (no modules installed) |
|
133 |
|
134 List installed modules from a specified modulepath: |
|
135 |
|
136 - $ puppet module list --modulepath /opt/puppetlabs/puppet/modules |
|
137 - /opt/puppetlabs/puppet/modules (no modules installed) |
|
138 + $ puppet module list --modulepath /usr/puppetlabs/puppet/modules |
|
139 + /usr/puppetlabs/puppet/modules (no modules installed) |
|
140 EOT |
|
141 |
|
142 when_invoked do |options| |
|
143 diff --git a/lib/puppet/face/module/uninstall.rb b/lib/puppet/face/module/uninstall.rb |
|
144 index e3c74c5..90c6ed4 100644 |
|
145 --- a/lib/puppet/face/module/uninstall.rb |
|
146 +++ b/lib/puppet/face/module/uninstall.rb |
|
147 @@ -16,8 +16,8 @@ Puppet::Face.define(:module, '1.0.0') do |
|
148 |
|
149 Uninstall a module from a specific directory: |
|
150 |
|
151 - $ puppet module uninstall puppetlabs-ssh --modulepath /opt/puppetlabs/puppet/modules |
|
152 - Removed /opt/puppetlabs/puppet/modules/ssh (v1.0.0) |
|
153 + $ puppet module uninstall puppetlabs-ssh --modulepath /usr/puppetlabs/puppet/modules |
|
154 + Removed /usr/puppetlabs/puppet/modules/ssh (v1.0.0) |
|
155 |
|
156 Uninstall a module from a specific environment: |
|
157 |
|
158 diff --git a/lib/puppet/provider/package/puppet_gem.rb b/lib/puppet/provider/package/puppet_gem.rb |
|
159 index 8d876a0..86752b7 100644 |
|
160 --- a/lib/puppet/provider/package/puppet_gem.rb |
|
161 +++ b/lib/puppet/provider/package/puppet_gem.rb |
|
162 @@ -12,6 +12,6 @@ Puppet::Type.type(:package).provide :puppet_gem, :parent => :gem do |
|
163 # sort out the absolute path. |
|
164 commands :gemcmd => "gem" |
|
165 else |
|
166 - commands :gemcmd => "/opt/puppetlabs/puppet/bin/gem" |
|
167 + commands :gemcmd => "/usr/bin/gem" |
|
168 end |
|
169 end |
|
170 diff --git a/lib/puppet/reference/configuration.rb b/lib/puppet/reference/configuration.rb |
|
171 index ac00cab..384077a 100644 |
|
172 --- a/lib/puppet/reference/configuration.rb |
|
173 +++ b/lib/puppet/reference/configuration.rb |
|
174 @@ -23,7 +23,7 @@ config = Puppet::Util::Reference.newreference(:configuration, :depth => 1, :doc |
|
175 # Now print the data about the item. |
|
176 val = object.default |
|
177 if name.to_s == 'vardir' |
|
178 - val = 'Unix/Linux: /opt/puppetlabs/puppet/cache -- Windows: C:\ProgramData\PuppetLabs\puppet\cache -- Non-root user: ~/.puppetlabs/opt/puppet/cache' |
|
179 + val = 'Unix/Linux: /var/puppetlabs/puppet/cache -- Windows: C:\ProgramData\PuppetLabs\puppet\cache -- Non-root user: ~/.puppetlabs/opt/puppet/cache' |
|
180 elsif name.to_s == 'confdir' |
|
181 val = 'Unix/Linux: /etc/puppetlabs/puppet -- Windows: C:\ProgramData\PuppetLabs\puppet\etc -- Non-root user: ~/.puppetlabs/etc/puppet' |
|
182 elsif name.to_s == 'codedir' |
|
183 diff --git a/lib/puppet/util/run_mode.rb b/lib/puppet/util/run_mode.rb |
|
184 index cf6c461..21968ce 100644 |
|
185 --- a/lib/puppet/util/run_mode.rb |
|
186 +++ b/lib/puppet/util/run_mode.rb |
|
187 @@ -67,7 +67,7 @@ module Puppet |
|
188 end |
|
189 |
|
190 def var_dir |
|
191 - which_dir("/opt/puppetlabs/puppet/cache", "~/.puppetlabs/opt/puppet/cache") |
|
192 + which_dir("/var/puppetlabs/puppet/cache", "~/.puppetlabs/opt/puppet/cache") |
|
193 end |
|
194 |
|
195 def run_dir |
|
196 diff --git a/man/man5/puppet.conf.5 b/man/man5/puppet.conf.5 |
|
197 index ff23f71..414cfc8 100644 |
|
198 --- a/man/man5/puppet.conf.5 |
|
199 +++ b/man/man5/puppet.conf.5 |
|
200 @@ -121,7 +121,7 @@ The search path for \fBglobal\fR modules\. Should be specified as a list of dire |
|
201 These are the modules that will be used by \fIall\fR environments\. Note that the \fBmodules\fR directory of the active environment will have priority over any global directories\. For more info, see https://docs\.puppetlabs\.com/puppet/latest/reference/environments\.html |
|
202 . |
|
203 .IP "\(bu" 4 |
|
204 -\fIDefault\fR: $codedir/modules:/opt/puppetlabs/puppet/modules |
|
205 +\fIDefault\fR: $codedir/modules:/usr/puppetlabs/puppet/modules |
|
206 . |
|
207 .IP "" 0 |
|
208 . |
|
209 @@ -1730,7 +1730,7 @@ The user puppet master should run as\. |
|
210 Where Puppet stores dynamic and growing data\. The default for this setting is calculated specially, like \fBconfdir\fR_\. |
|
211 . |
|
212 .IP "\(bu" 4 |
|
213 -\fIDefault\fR: /opt/puppetlabs/puppet/cache |
|
214 +\fIDefault\fR: /var/puppetlabs/puppet/cache |
|
215 . |
|
216 .IP "" 0 |
|
217 . |
|
218 diff --git a/man/man8/puppet-config.8 b/man/man8/puppet-config.8 |
|
219 index 35310d0..5df37e4 100644 |
|
220 --- a/man/man8/puppet-config.8 |
|
221 +++ b/man/man8/puppet-config.8 |
|
222 @@ -111,7 +111,7 @@ $ puppet config set rundir /var/run/puppetlabs |
|
223 Set the vardir for only the agent: |
|
224 . |
|
225 .P |
|
226 -$ puppet config set vardir /opt/puppetlabs/puppet/cache \-\-section agent |
|
227 +$ puppet config set vardir /var/puppetlabs/puppet/cache \-\-section agent |
|
228 . |
|
229 .SH "COPYRIGHT AND LICENSE" |
|
230 Copyright 2011 by Puppet Labs Apache 2 license; see COPYING |
|
231 diff --git a/man/man8/puppet-module.8 b/man/man8/puppet-module.8 |
|
232 index 62591fe..b5b05a5 100644 |
|
233 --- a/man/man8/puppet-module.8 |
|
234 +++ b/man/man8/puppet-module.8 |
|
235 @@ -340,13 +340,13 @@ $ puppet module install puppetlabs\-vcsrepo \-v 0\.0\.4 Preparing to install int |
|
236 Install a module into a specific directory: |
|
237 . |
|
238 .P |
|
239 -$ puppet module install puppetlabs\-vcsrepo \-\-target\-dir=/opt/puppetlabs/puppet/modules Preparing to install into /opt/puppetlabs/puppet/modules \.\.\. Downloading from https://forgeapi\.puppetlabs\.com \.\.\. Installing \-\- do not interrupt \.\.\. /opt/puppetlabs/puppet/modules └── puppetlabs\-vcsrepo (v0\.0\.4) |
|
240 +$ puppet module install puppetlabs\-vcsrepo \-\-target\-dir=/usr/puppetlabs/puppet/modules Preparing to install into /usr/puppetlabs/puppet/modules \.\.\. Downloading from https://forgeapi\.puppetlabs\.com \.\.\. Installing \-\- do not interrupt \.\.\. /usr/puppetlabs/puppet/modules └── puppetlabs\-vcsrepo (v0\.0\.4) |
|
241 . |
|
242 .P |
|
243 Install a module into a specific directory and check for dependencies in other directories: |
|
244 . |
|
245 .P |
|
246 -$ puppet module install puppetlabs\-vcsrepo \-\-target\-dir=/opt/puppetlabs/puppet/modules \-\-modulepath /etc/puppetlabs/code/modules Preparing to install into /opt/puppetlabs/puppet/modules \.\.\. Downloading from https://forgeapi\.puppetlabs\.com \.\.\. Installing \-\- do not interrupt \.\.\. /opt/puppetlabs/puppet/modules └── puppetlabs\-vcsrepo (v0\.0\.4) |
|
247 +$ puppet module install puppetlabs\-vcsrepo \-\-target\-dir=/usr/puppetlabs/puppet/modules \-\-modulepath /etc/puppetlabs/code/modules Preparing to install into /usr/puppetlabs/puppet/modules \.\.\. Downloading from https://forgeapi\.puppetlabs\.com \.\.\. Installing \-\- do not interrupt \.\.\. /usr/puppetlabs/puppet/modules └── puppetlabs\-vcsrepo (v0\.0\.4) |
|
248 . |
|
249 .P |
|
250 Install a module from a release archive: |
|
251 @@ -367,25 +367,25 @@ $ puppet module install puppetlabs\-vcsrepo\-0\.0\.4\.tar\.gz \-\-ignore\-depend |
|
252 List installed modules: |
|
253 . |
|
254 .P |
|
255 -$ puppet module list /etc/puppetlabs/code/modules ├── bodepd\-create_resources (v0\.0\.1) ├── puppetlabs\-bacula (v0\.0\.2) ├── puppetlabs\-mysql (v0\.0\.1) ├── puppetlabs\-sqlite (v0\.0\.1) └── puppetlabs\-stdlib (v2\.2\.1) /opt/puppetlabs/puppet/modules (no modules installed) |
|
256 +$ puppet module list /etc/puppetlabs/code/modules ├── bodepd\-create_resources (v0\.0\.1) ├── puppetlabs\-bacula (v0\.0\.2) ├── puppetlabs\-mysql (v0\.0\.1) ├── puppetlabs\-sqlite (v0\.0\.1) └── puppetlabs\-stdlib (v2\.2\.1) /usr/puppetlabs/puppet/modules (no modules installed) |
|
257 . |
|
258 .P |
|
259 List installed modules in a tree view: |
|
260 . |
|
261 .P |
|
262 -$ puppet module list \-\-tree /etc/puppetlabs/code/modules └─┬ puppetlabs\-bacula (v0\.0\.2) ├── puppetlabs\-stdlib (v2\.2\.1) ├─┬ puppetlabs\-mysql (v0\.0\.1) │ └── bodepd\-create_resources (v0\.0\.1) └── puppetlabs\-sqlite (v0\.0\.1) /opt/puppetlabs/puppet/modules (no modules installed) |
|
263 +$ puppet module list \-\-tree /etc/puppetlabs/code/modules └─┬ puppetlabs\-bacula (v0\.0\.2) ├── puppetlabs\-stdlib (v2\.2\.1) ├─┬ puppetlabs\-mysql (v0\.0\.1) │ └── bodepd\-create_resources (v0\.0\.1) └── puppetlabs\-sqlite (v0\.0\.1) /usr/puppetlabs/puppet/modules (no modules installed) |
|
264 . |
|
265 .P |
|
266 List installed modules from a specified environment: |
|
267 . |
|
268 .P |
|
269 -$ puppet module list \-\-environment production /etc/puppetlabs/code/modules ├── bodepd\-create_resources (v0\.0\.1) ├── puppetlabs\-bacula (v0\.0\.2) ├── puppetlabs\-mysql (v0\.0\.1) ├── puppetlabs\-sqlite (v0\.0\.1) └── puppetlabs\-stdlib (v2\.2\.1) /opt/puppetlabs/puppet/modules (no modules installed) |
|
270 +$ puppet module list \-\-environment production /etc/puppetlabs/code/modules ├── bodepd\-create_resources (v0\.0\.1) ├── puppetlabs\-bacula (v0\.0\.2) ├── puppetlabs\-mysql (v0\.0\.1) ├── puppetlabs\-sqlite (v0\.0\.1) └── puppetlabs\-stdlib (v2\.2\.1) /usr/puppetlabs/puppet/modules (no modules installed) |
|
271 . |
|
272 .P |
|
273 List installed modules from a specified modulepath: |
|
274 . |
|
275 .P |
|
276 -$ puppet module list \-\-modulepath /opt/puppetlabs/puppet/modules /opt/puppetlabs/puppet/modules (no modules installed) |
|
277 +$ puppet module list \-\-modulepath /usr/puppetlabs/puppet/modules /usr/puppetlabs/puppet/modules (no modules installed) |
|
278 . |
|
279 .P |
|
280 \fBsearch\fR |
|
281 @@ -409,7 +409,7 @@ $ puppet module uninstall puppetlabs\-ssh Removed /etc/puppetlabs/code/modules/s |
|
282 Uninstall a module from a specific directory: |
|
283 . |
|
284 .P |
|
285 -$ puppet module uninstall puppetlabs\-ssh \-\-modulepath /opt/puppetlabs/puppet/modules Removed /opt/puppetlabs/puppet/modules/ssh (v1\.0\.0) |
|
286 +$ puppet module uninstall puppetlabs\-ssh \-\-modulepath /usr/puppetlabs/puppet/modules Removed /usr/puppetlabs/puppet/modules/ssh (v1\.0\.0) |
|
287 . |
|
288 .P |
|
289 Uninstall a module from a specific environment: |
|
290 diff --git a/spec/unit/provider/package/puppet_gem_spec.rb b/spec/unit/provider/package/puppet_gem_spec.rb |
|
291 index 017e0c4..2817701 100644 |
|
292 --- a/spec/unit/provider/package/puppet_gem_spec.rb |
|
293 +++ b/spec/unit/provider/package/puppet_gem_spec.rb |
|
294 @@ -20,7 +20,7 @@ describe provider_class do |
|
295 if Puppet.features.microsoft_windows? |
|
296 let(:puppet_gem) { 'gem' } |
|
297 else |
|
298 - let(:puppet_gem) { '/opt/puppetlabs/puppet/bin/gem' } |
|
299 + let(:puppet_gem) { '/usr/bin/gem' } |
|
300 end |
|
301 |
|
302 before :each do |
|
303 diff --git a/spec/unit/util/run_mode_spec.rb b/spec/unit/util/run_mode_spec.rb |
|
304 index bd7759a..657d40c 100644 |
|
305 --- a/spec/unit/util/run_mode_spec.rb |
|
306 +++ b/spec/unit/util/run_mode_spec.rb |
|
307 @@ -67,8 +67,8 @@ describe Puppet::Util::RunMode do |
|
308 end |
|
309 |
|
310 describe "#var_dir" do |
|
311 - it "has vardir /opt/puppetlabs/puppet/cache when run as root" do |
|
312 - as_root { expect(@run_mode.var_dir).to eq(File.expand_path('/opt/puppetlabs/puppet/cache')) } |
|
313 + it "has vardir /var/puppetlabs/puppet/cache when run as root" do |
|
314 + as_root { expect(@run_mode.var_dir).to eq(File.expand_path('/var/puppetlabs/puppet/cache')) } |
|
315 end |
|
316 |
|
317 it "has vardir ~/.puppetlabs/opt/puppet/cache when run as non-root" do |
|
318 -- |
|
319 2.9.3 (Apple Git-75) |
|
320 |
|
321 |