Comments (11)
Not sure the best way to implement this. Originally was going to add this in the provider code but it felt like feature creep since it overlaps with the file resource. For now, the owner/group management can be specified in a define resource similar to https://github.com/nanliu/puppet-archive/blob/master/manifests/go.pp.
Writing a generic define resource wrapper is pretty straightforward, I'm not sure what's a good name (archive::file ???).
from puppet-archive.
The owner/group management in go.pp and artifactory.pp sets the owner and group of the archive file but I was more interested in the extracted files themselves. In nanliu-staging, you executed the tar command as the specified user - would that work as well here? The archive resource could take a user / group and pass that to the the Puppet::Util::Execution call?
Tar files also support the -o option for extraction which would ignore the owner specified within the tar file and use the process owner executing the tar command. That could help as well.
from puppet-archive.
You can pass custom flags to via extraction_flags. I'll take a look and see what it takes to specify user/group option to the extraction command.
from puppet-archive.
I don't believe for tar that you can specify a user or a group. The only way is to run the tar command as the user you would prefer. puppet-staging does this by running an exec as the user/group.
I would very much like this feature.
from puppet-archive.
GNU tar supports --owner
and --group
flags.
from puppet-archive.
It looks like BSD tar does not, though, so the best option is probably to run the tar command as the desired user/group.
from puppet-archive.
yeah i am pretty sure --owner and --group does not work as you would expect it too.
from puppet-archive.
--group=NAME
force NAME as group for added files
--owner=NAME
force NAME as owner for added files
Having had some experience with this, its only when adding files to an archive and not extracting the files.
from puppet-archive.
Ah, whoops. Well, either way, it makes more sense to just run the command as the desired user/group, as that'll work on all platforms and is a pretty simple change to make.
from puppet-archive.
The changes require puppet::util::execution to pass in the option uid, gid:
https://github.com/nanliu/puppet-archive/blob/master/lib/puppet_x/bodeco/archive.rb#L41
The changes will be fairly similar to the following:
https://github.com/boxen/puppet-vagrant/blob/master/lib/puppet/provider/vagrant.rb#L19-L30
I'll try to tackle this as time permits, in the mean time if someone needs it sooner, hopefully this provides enough pointers.
from puppet-archive.
I've added support for this. Please test and provide feedback.
from puppet-archive.
Related Issues (20)
- Do not add auth and cookie header when redirecting HOT 2
- Example in README doesn't make sense.
- uninitialized constant PuppetX::Bodeco::PUPPET HOT 4
- add support for Ubuntu 22.04
- Changing back and forth between different version of an archive does not re-extract HOT 1
- Enhancement: allow multiple sources
- curl provider: array of multiple headers does not work HOT 2
- Checksum not being verified HOT 1
- Files unpacked in `/tmp` HOT 2
- Missing gem with ruby 3.1 HOT 13
- Artifactory has no authentication for latest url and checksum
- Allow passwords to be deferred
- archive does not enforce `owner:group` HOT 2
- archive has stopped working for us HOT 4
- weird issue with the proxy settings if 'proxy_server' seems to be set not fully correct
- archive module reveals sensitive information
- Provider curl to wget
- archive extraction fails
- Add support for Azure Blob Storage HOT 1
- Feature request: Add support for username|password to be passed as Sensitive[String]
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from puppet-archive.