Closed hboetes closed 1 month ago
Hello,
You can use the resource attribute _tempdir to override where files are temporarily unpacked, as per https://github.com/voxpupuli/puppet-archive?tab=readme-ov-file#reference, specifically:
_tempdir: Specify an alternative temporary directory to use for copying files, if unset then the operating system default will be used.
So I added:
temp_dir => '/usr/local/MATLAB/',
To the recipe above as the last line and I got the following error:
Error: Could not set 'present' on ensure: no implicit conversion of nil into String (file: /etc/puppetlabs/code/modules/matlab/manifests/matlab22a.pp, line: 2)
Error: Could not set 'present' on ensure: no implicit conversion of nil into String (file: /etc/puppetlabs/code/modules/matlab/manifests/matlab22a.pp, line: 2)
Wrapped exception:
no implicit conversion of nil into String
Error: /Stage[main]/Matlab::Matlab22a/Archive[/usr/local/MATLAB-R2022a.tgz]/ensure: change from 'absent' to 'present' failed: Could not set 'present' on ensure: no implicit conversion of nil into String (file: /etc/puppetlabs/code/modules/matlab/manifests/matlab22a.pp, line: 2)
What am I missing here?
I was getting complaints from my users that /tmp was getting full. Inspecting the system I noticed the new Matlab release attempted to be unpacked in /tmp, and that will never fit since /tmp is 2Gb
Here is the recipe I used.
Now if I run
puppet agent -t
manually, things go fine. This is probably due to the fact I've set my$TMP
to$HOME/.local/tmp
, which is not only a much larger partition, but also not prone to symlink attacks.Please make sure
archive
avoids unpacking in/tmp
and uses the given path —/usr/local/MATLAB
in this case — to unpack the files.This will not only enable unpacking larger packages but also be more efficient since the unpacked directory is already in the right partition.