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

Add attribute to skip settings permissions #18

Closed
LEDfan opened this issue Mar 4, 2015 · 4 comments
Closed

Add attribute to skip settings permissions #18

LEDfan opened this issue Mar 4, 2015 · 4 comments

Comments

@LEDfan
Copy link
Contributor

LEDfan commented Mar 4, 2015

Hey. Again thanks for this awesome cookbook 👍

In some situations settings the permissions of a directory is impossible. (Even as root). This is e.g. the case when you have mounted /var/www as a NFS share. (with vagrant)

This isn't really a problem since Apache & nginx are running as the same user who mounted the NFS share. (user vagrant and group vagrant). So the web server has write permission in this situation.

But because Chef fails and an exception is thrown, the cookbook can't finish.

Would it be possible to create an attribute skip_permissions? This would be really great!

Thanks in advance!

@zuazo
Copy link
Owner

zuazo commented Mar 9, 2015

Hi @LEDfan,

What permissions should be skipped? Only the main directory permissions, all the directory permissions or all the directory and file permissions inside /var/www?

@LEDfan
Copy link
Contributor Author

LEDfan commented Mar 13, 2015

Hey.
Al permissions on /var/www when using NFS. This is because NFS doesn't allow to set permissions.
Otherwise this will happen:


================================================================================
==> default: Error executing action `create` on resource 'directory[/var/www/owncloud/apps]'
==> default: ================================================================================
==> default: 
==> default: Errno::EPERM
==> default: ------------
==> default: Operation not permitted @ chown_internal - /var/www/owncloud/apps
==> default: 
==> default: Resource Declaration:
==> default: ---------------------
==> default: # In /tmp/vagrant-chef/a9c9497aab9382bd1c3d19712deea904/cookbooks/owncloud/recipes/default.rb
==> default: 
==> default: 289:   directory dir do
==> default: 290:     owner node[web_server]['user']
==> default: 291:     group node[web_server]['group']
==> default: 292:     mode 00750
==> default: 293:     action :create
==> default: 294:   end
==> default: 295: end
==> default: 
==> default: Compiled Resource:
==> default: ------------------
==> default: # Declared in /tmp/vagrant-chef/a9c9497aab9382bd1c3d19712deea904/cookbooks/owncloud/recipes/default.rb:289:in `block in from_file'
==> default: 
==> default: directory("/var/www/owncloud/apps") do
==> default:   action [:create]
==> default:   retries 0
==> default:   retry_delay 2
==> default:   default_guard_interpreter :default
==> default:   path "/var/www/owncloud/apps"
==> default:   declared_type :directory
==> default:   cookbook_name :owncloud
==> default:   recipe_name "default"
==> default:   mode 488
==> default:   owner "apache"
==> default:   group "apache"
==> default: end

When you don not set the permissions and use NFS the web server will have write/read permissions because it's running as the vagrant user and group.

@zuazo
Copy link
Owner

zuazo commented Mar 14, 2015

Closing this. Implemented in #20.

@zuazo zuazo closed this as completed Mar 14, 2015
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

2 participants