File puppet-4.8.1-change-default-cache-dir.patch of Package rubygem-puppet.26170

diff --git a/lib/puppet/face/config.rb b/lib/puppet/face/config.rb
index 65e7318..79050e7 100644
--- a/lib/puppet/face/config.rb
+++ b/lib/puppet/face/config.rb
@@ -102,7 +102,7 @@ Puppet::Face.define(:config, '0.0.1') do
 
       Set the vardir for only the agent:
 
-      $ puppet config set vardir /opt/puppetlabs/puppet/cache --section agent
+      $ puppet config set vardir /var/cache/puppetlabs/puppet --section agent
     EOT
 
     when_invoked do |name, value, options|
diff --git a/lib/puppet/reference/configuration.rb b/lib/puppet/reference/configuration.rb
index ac00cab..3e3a34d 100644
--- a/lib/puppet/reference/configuration.rb
+++ b/lib/puppet/reference/configuration.rb
@@ -23,7 +23,7 @@ config = Puppet::Util::Reference.newreference(:configuration, :depth => 1, :doc
     # Now print the data about the item.
     val = object.default
     if name.to_s == 'vardir'
-      val = 'Unix/Linux: /opt/puppetlabs/puppet/cache -- Windows: C:\ProgramData\PuppetLabs\puppet\cache -- Non-root user: ~/.puppetlabs/opt/puppet/cache'
+      val = 'Unix/Linux: /var/cache/puppetlabs/puppet -- Windows: C:\ProgramData\PuppetLabs\puppet\cache -- Non-root user: ~/.puppetlabs/opt/puppet/cache'
     elsif name.to_s == 'confdir'
       val = 'Unix/Linux: /etc/puppetlabs/puppet -- Windows: C:\ProgramData\PuppetLabs\puppet\etc -- Non-root user: ~/.puppetlabs/etc/puppet'
     elsif name.to_s == 'codedir'
diff --git a/lib/puppet/util/run_mode.rb b/lib/puppet/util/run_mode.rb
index cf6c461..48345bc 100644
--- a/lib/puppet/util/run_mode.rb
+++ b/lib/puppet/util/run_mode.rb
@@ -67,7 +67,7 @@ module Puppet
       end
 
       def var_dir
-        which_dir("/opt/puppetlabs/puppet/cache", "~/.puppetlabs/opt/puppet/cache")
+        which_dir("/var/cache/puppetlabs/puppet", "~/.puppetlabs/opt/puppet/cache")
       end
 
       def run_dir
diff --git a/man/man5/puppet.conf.5 b/man/man5/puppet.conf.5
index ff23f71..0da9694 100644
--- a/man/man5/puppet.conf.5
+++ b/man/man5/puppet.conf.5
@@ -1730,7 +1730,7 @@ The user puppet master should run as\.
 Where Puppet stores dynamic and growing data\. The default for this setting is calculated specially, like \fBconfdir\fR_\.
 .
 .IP "\(bu" 4
-\fIDefault\fR: /opt/puppetlabs/puppet/cache
+\fIDefault\fR: /var/cache/puppetlabs/puppet
 .
 .IP "" 0
 .
diff --git a/man/man8/puppet-config.8 b/man/man8/puppet-config.8
index 35310d0..78e1149 100644
--- a/man/man8/puppet-config.8
+++ b/man/man8/puppet-config.8
@@ -111,7 +111,7 @@ $ puppet config set rundir /var/run/puppetlabs
 Set the vardir for only the agent:
 .
 .P
-$ puppet config set vardir /opt/puppetlabs/puppet/cache \-\-section agent
+$ puppet config set vardir /var/cache/puppetlabs/puppet \-\-section agent
 .
 .SH "COPYRIGHT AND LICENSE"
 Copyright 2011 by Puppet Labs Apache 2 license; see COPYING
diff --git a/spec/unit/util/run_mode_spec.rb b/spec/unit/util/run_mode_spec.rb
index bd7759a..36be3f7 100644
--- a/spec/unit/util/run_mode_spec.rb
+++ b/spec/unit/util/run_mode_spec.rb
@@ -67,8 +67,8 @@ describe Puppet::Util::RunMode do
     end
 
     describe "#var_dir" do
-      it "has vardir /opt/puppetlabs/puppet/cache when run as root" do
-        as_root { expect(@run_mode.var_dir).to eq(File.expand_path('/opt/puppetlabs/puppet/cache')) }
+      it "has vardir /var/cache/puppetlabs/puppet when run as root" do
+        as_root { expect(@run_mode.var_dir).to eq(File.expand_path('/var/cache/puppetlabs/puppet')) }
       end
 
       it "has vardir ~/.puppetlabs/opt/puppet/cache when run as non-root" do
openSUSE Build Service is sponsored by