-
-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use same archive multiple times (change namevar) #427
Comments
As a workaround, you can set the name of the resource to something unique, and specify the |
Unless I miss something, which is perfectly possible, that does not help (already have that). From my understanding, correct me if I'm wrong, in the ruby file |
That just allows you to specify the
archive { 'something unique here':
ensure => present,
path => '/tmp/vagrant.deb',
source => 'https://releases.hashicorp.com/vagrant/2.2.3/vagrant_2.2.3_x86_64.deb',
} From the output of
|
I seem to be hitting the same behaviour too, I have an archive that already exists on the system and I'd like to extract it's contents multiple times however no combination of parameters seems to work for me. Let's say I have a archive that exists at '/opt/testing/test.tar.gz' if I try to extract it to two differing locations with the following: archive { "extract_test_1":
path => '/opt/testing/test.tar.gz',
extract => true,
extract_path => '/opt/test/test1',
creates => '/opt/test/test1/config.xml',
user => 'test_acc'
}
archive { "extract_test_2":
path => '/opt/testing/test.tar.gz',
extract => true,
extract_path => '/opt/test/test2',
creates => '/opt/test/test2/config.xml',
user => 'test_acc'
} I get the following error:
|
Affected Puppet, Ruby, OS and module versions/distributions
How to reproduce (e.g Puppet code you use)
Define the Archive resource 2 or more times where only the
extract_path
attribute is different. Then run puppet agentWhat are you seeing
command:
puppet agent --verbose --noop --onetime --no-daemonize --server server.puppet.domain
fails
What behaviour did you expect instead
That the same archive will be untarred to 2 different locations.
Output log
Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Resource Statement, Cannot alias Archive[archive.tar.xz] to ["/local/save/path/of/archive.tar.xz"] at (file: init.pp, line: 10); resource ["Archive", "/local/save/path/of/archive.tar.xz"] already declared (file: init.pp, line: 20) (file: init.pp, line: 10, on node client.puppet.domain
Any additional information you'd like to impart
The
namevar
is bound to thepath
attribute, while, I think, binding it to theextract_path
should be better (or a combination ofpath
andextract_path
, as this is the real unique combination).I did a quick check by changing the namevar in
lib/puppet/type/archive.rb
, but when i runpuppet agent
I get this message: Error: Failed to apply catalog: undefined method `value' for nil:NilClassThe text was updated successfully, but these errors were encountered: