Skip to content

Commit

Permalink
Fix the ordering of the logrotate attributes.
Browse files Browse the repository at this point in the history
These have to be set *after* the init_style is determined.
Add a config suite to .kitchen.yml so this can be validated.
  • Loading branch information
Julian C. Dunn committed Feb 2, 2015
1 parent 353237d commit 830deac
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .kitchen.yml
Expand Up @@ -56,6 +56,11 @@ suites:
- recipe[chef-client::cron]
attributes: {}

- name: config
run_list:
- recipe[chef-client::config]
attributes: {}

- name: delete_validation
run_list:
- recipe[chef-client::delete_validation]
Expand Down
16 changes: 9 additions & 7 deletions attributes/default.rb
Expand Up @@ -38,13 +38,6 @@

# log_file has no effect when using runit
default['chef_client']['log_file'] = 'client.log'
default['chef_client']['log_rotation']['options'] = ['compress']
default['chef_client']['log_rotation']['postrotate'] = case node['chef_client']['init_style']
when 'systemd'
'systemctl reload chef-client.service >/dev/null || :'
else
'/etc/init.d/chef-client reload >/dev/null || :'
end
default['chef_client']['interval'] = '1800'
default['chef_client']['splay'] = '300'
default['chef_client']['conf_dir'] = '/etc/chef'
Expand Down Expand Up @@ -172,3 +165,12 @@
default['chef_client']['cache_path'] = '/var/chef/cache'
default['chef_client']['backup_path'] = '/var/chef/backup'
end

# Must appear after init_style to take effect correctly
default['chef_client']['log_rotation']['options'] = ['compress']
default['chef_client']['log_rotation']['postrotate'] = case node['chef_client']['init_style']
when 'systemd'
'systemctl reload chef-client.service >/dev/null || :'
else
'/etc/init.d/chef-client reload >/dev/null || :'
end

0 comments on commit 830deac

Please sign in to comment.