chef-boneyard / push-jobs-cookbook

Development repository for Chef Cookbook push-jobs
https://supermarket.chef.io/cookbooks/push-jobs
Apache License 2.0
21 stars 43 forks source link

Unix path used on Windows for logging_dir by default #113

Closed mattlqx closed 7 years ago

mattlqx commented 7 years ago

Cookbook version

4.0.1

Chef-client version

12.18.31

Platform Details

Windows 2012r2

Scenario:

push-jobs::default errors out

Steps to Reproduce:

Run it on Windows with defaults.

Expected Result:

Successful run.

Actual Result:

Error Log & Stacktrace

directory[/var/log/chef] (push-jobs::config line 33) had an error: Chef::Exceptions::EnclosingDirectoryDoesNotExist: Parent directory /var/log does not exist, cannot create /var/log/chef

Chef::Exceptions::EnclosingDirectoryDoesNotExist
----------------------------------------------------
Parent directory /var/log does not exist, cannot create /var/log/chef

Resource Declaration:
----------------------------------------------------
# In C:/chef/cache/cookbooks/push-jobs/recipes/config.rb

 33: directory node['push_jobs']['logging_dir'] do
 34:   unless platform_family?('windows')
 35:     owner 'root'
 36:     group 'root'
 37:     mode 00755
 38:     recursive true
 39:     not_if { node['push_jobs']['logging_dir'].nil? }
 40:   end
 41: end

https://github.com/chef-cookbooks/push-jobs/commit/ee58603926c12b8c57a899ca914a2fe4638d8016#diff-a163eaf3dde8487f582a7cc6f557ee5e added the logging_dir attribute which the base directory resource will always be applied with the Unix path despite being on Windows.