Skip to content
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

puppet source #151

Closed
otteydw opened this issue Mar 30, 2016 · 11 comments
Closed

puppet source #151

otteydw opened this issue Mar 30, 2016 · 11 comments

Comments

@otteydw
Copy link

otteydw commented Mar 30, 2016

Does this module support a puppet:/// source? If not, is it planned?
This source works in nanliu-staging.

I tried

    archive { "/usr/java/jdk-${jdk_version}-linux-x64.tar.gz":
        ensure          => present,
        extract         => true,
        extract_path    => '/usr/java',
        source          => "puppet:///files/java/jdk-${jdk_version}-linux-x64.tar.gz",
        creates         => "${jdk_dir}",
        cleanup         => true,
    }

Got this error:

Error: Failed to apply catalog: Parameter source failed on Archive[/usr/java/jdk-7u55-linux-x64.tar.gz]: invalid source url: puppet:///files/java/jdk-7u55-linux-x64.tar.gz at /etc/puppetlabs/puppet/manifests/boomi-jdk2.pp:67
Wrapped exception:
invalid source url: puppet:///files/java/jdk-7u55-linux-x64.tar.gz
Wrapped exception:
invalid source url: puppet:///files/java/jdk-7u55-linux-x64.tar.gz

@jyaworski
Copy link
Member

@nanliu didn't this happen at some time?

@otteydw what version are you using? Of Archive, that is.

@otteydw
Copy link
Author

otteydw commented Mar 31, 2016

@jyaworski - I am using puppet-archive 0.5.1 which I installed today.

@nanliu
Copy link
Contributor

nanliu commented Apr 12, 2016

nope, it currently does not support puppet:///, you can use a file resource + archive with local path, but this won't allow cleanup. This is a new feature request.

@jhg03a
Copy link

jhg03a commented May 12, 2016

@nanliu How would you go about this workaround? There doesn't appear to be any documentation on local file archive usage.

@rnelson0
Copy link
Sponsor Member

The duplicate test implies that file:// will suffice.

@jhg03a
Copy link

jhg03a commented May 12, 2016

This works for me. However there was a lot of trial and error here. There are many, many ways to get a silent failure that looks like success.

  $docs_filename = 'help.tar.gz'
  $docs_gz_path  = "/tmp/${docs_filename}"
  $homedir = '/home/myuser/'

  file {$docs_gz_path:
    ensure => file,
    source => "puppet:///modules/profile/${docs_filename}",
  }

  archive { $docs_gz_path:
    path          => $docs_gz_path,
    extract       => true,
    extract_path  => $homedir,
    creates       => "${homedir}/help" #directory inside tgz
    require       => [ File[$homedir], File[$docs_gz_path] ],
  }

@rnelson0
Copy link
Sponsor Member

Would you be willing to open a PR to update the documentation, to help others avoid this issue?

jhg03a pushed a commit to jhg03a/puppet-archive that referenced this issue May 12, 2016
@jhg03a
Copy link

jhg03a commented May 12, 2016

Done.

@nanliu
Copy link
Contributor

nanliu commented May 12, 2016

If you have examples for those silent errors, please file an issue.

@jhg03a
Copy link

jhg03a commented May 13, 2016

They are mostly surrounding proper usage. For instance: use source instead of path or leave off the creates. The catalog will compile and run successfully, but no useful output will occur.

randradas pushed a commit to randradas/puppet-archive that referenced this issue Oct 30, 2016
@nanliu
Copy link
Contributor

nanliu commented Sep 9, 2017

This feature has been added and released in 2.0.0

@nanliu nanliu closed this as completed Sep 9, 2017
cegeka-jenkins pushed a commit to cegeka/puppet-archive that referenced this issue Mar 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants