#
# Cookbook:: irrigate-orchard_base
# Recipe:: chef_client_wrapper
#
# Copyright: The Orchard
#

# TODO: The chef-client cookbook is deprecated. We should change this to use the native resources for configuring Chef to run on a schedule.

node.override['chef_client']['interval'] = 3600

chef_client_log_dir = '/var/log/chef_client'
directory chef_client_log_dir do
  owner 'root'
  group 'root'
  mode '0755'
end

node.override['chef_client']['log_dir'] = chef_client_log_dir

# Ensure correct conf dir is used regardless of whether Chef or Cinc client is used
node.override['chef_client']['conf_dir'] = ChefConfig::Config.etc_chef_dir

# Ensure cinc-client binary is used if running Cinc, or chef-client if using Chef
node.override['chef_client']['bin'] = "/opt/#{ChefUtils::Dist::Infra::DIR_SUFFIX}/bin/#{ChefUtils::Dist::Infra::CLIENT}"

include_recipe 'chef-client'
