Directory/file ownership conflicts
Closed this issue · 0 comments
tmonk42 commented
Since the release of 4.0.2, the default recipe sets ownership on the "conf.d" directory to "node["sensu"]["user"], then the client provider sets the ownership to "node["sensu"]["admin_user"]".
Expected Behavior
Systems using the default recipe and client provider should not change ownership on conf.d directory twice on every chef-client run. Both conf.d directory and client.json files should be owned by node["sensu"]["user"].
Current Behavior
- A wrapper cookbook includes sensu::default
- conf.d directory is set to owner node["sensu"]["user"] https://github.com/sensu/sensu-chef/blob/develop/recipes/default.rb#L51
- A wrapper cookbook creates a sensu_client resource
- conf.d/client.json file is created with no owner explicitly defined, providers/json_file.rb sets owner to node["sensu"]["admin_user"] on the file AND the directory in which it lives https://github.com/sensu/sensu-chef/blob/develop/providers/client.rb#L37 https://github.com/sensu/sensu-chef/blob/develop/providers/json_file.rb#L9
Possible Solution
Update client provider to explicitly set owner
Steps to Reproduce (for bugs)
Create a wrapper cookbook
Include sensu::default
define a sensu_client
chef-client run
Context
Every chef-client run updates ownership on this directory twice. The client.json file is owned by admin_user instead of user.
Your Environment
- Version of this cookbook used: 4.0.2
- Version of Sensu used: 0.28.4-1
- Version of Chef used: 13.2.20-1
- Operating System and version (e.g. CentOS 7, Ubuntu 14.04): Ubuntu 14.04