
|
If you were logged in you would be able to see more operations.
|
|
|
It would be nice to set a umask on an execute or script resource so all affected files would be set with appropriate permissions.
-----------------
bigfleet: I'm working with a Rails app that needs both to be generated from a template and to have that RAILS_ROOT be chmod -R g+w (or the equivalent)
bigfleet: should I be doing that with a directory resource?
seancribbs: bigfleet: yep
bigfleet: Or execute?
seancribbs: bigfleet: make the directory first
bigfleet: OK, I do that
seancribbs: the rails generator shouldn't care
bigfleet: Right, OK, but the files that Rails generates, (e.g. public)
bigfleet: are not g+w
bigfleet: not out of the gate anyway
bigfleet: Just run the recipe again maybe?
seancribbs: you can run the generator as another user
bigfleet: I am doing that too
seancribbs: sounds good
seancribbs: bigfleet: set the umask when you run the command?
bigfleet: seancribbs: it would help if I knew how to do that, lol
seancribbs: bigfleet: not sure if Chef has that, checking
seancribbs: if not, you can run "umask 002 && command"
jtimberman: chef doesn't have a umask attribute for execute/script resources that I'm aware of.
seancribbs: yeah, go with the latter
bigfleet: Sweet, that's very cool
jtimberman: And open a ticket to add that feature?
seancribbs: jtimberman: we should definitely add that, yeah
seancribbs: jtimberman: i'll add ticket
|
|
Description
|
It would be nice to set a umask on an execute or script resource so all affected files would be set with appropriate permissions.
-----------------
bigfleet: I'm working with a Rails app that needs both to be generated from a template and to have that RAILS_ROOT be chmod -R g+w (or the equivalent)
bigfleet: should I be doing that with a directory resource?
seancribbs: bigfleet: yep
bigfleet: Or execute?
seancribbs: bigfleet: make the directory first
bigfleet: OK, I do that
seancribbs: the rails generator shouldn't care
bigfleet: Right, OK, but the files that Rails generates, (e.g. public)
bigfleet: are not g+w
bigfleet: not out of the gate anyway
bigfleet: Just run the recipe again maybe?
seancribbs: you can run the generator as another user
bigfleet: I am doing that too
seancribbs: sounds good
seancribbs: bigfleet: set the umask when you run the command?
bigfleet: seancribbs: it would help if I knew how to do that, lol
seancribbs: bigfleet: not sure if Chef has that, checking
seancribbs: if not, you can run "umask 002 && command"
jtimberman: chef doesn't have a umask attribute for execute/script resources that I'm aware of.
seancribbs: yeah, go with the latter
bigfleet: Sweet, that's very cool
jtimberman: And open a ticket to add that feature?
seancribbs: jtimberman: we should definitely add that, yeah
seancribbs: jtimberman: i'll add ticket |
Show » |
Sort Order:
|
Fixed. Now the umask value can be set when executing command. String or Oct number can be used as parameter(i.e. '777' or 0777).
Example:
execute "create-mastodon" do
umask '777'
command "echo wewt > /mastodon_rocks_umask"
end
Code files modified:
chef/lib/chef/mixin/command.rb
chef/lib/chef/resource/execute.rb
chef/lib/chef/provider/execute.rb
Details:
Test files modified:
features/execute_commands.feature
features/steps/files.rb
features/data/cookbooks/execute_commands/recipes/umask.rb
Details:
Note: Currently absolute path is used in the recipe because both of the relative path and the tmpdir refer to locations in the OS tmp folder which cannot be used to test umask.