From 00c6e1ed5b6c205e470758f09c848d3624a7aa82 Mon Sep 17 00:00:00 2001 From: Steve Yun Date: Thu, 1 Aug 2024 14:15:45 -0400 Subject: [PATCH] moved accesslog for test --- .../openldap-test/recipes/accesslog.rb | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/test/cookbooks/openldap-test/recipes/accesslog.rb b/test/cookbooks/openldap-test/recipes/accesslog.rb index 1018ab9..504316f 100644 --- a/test/cookbooks/openldap-test/recipes/accesslog.rb +++ b/test/cookbooks/openldap-test/recipes/accesslog.rb @@ -1,6 +1,16 @@ +ldap_dir = + case os.family + when 'debian' + '/etc/ldap' + when 'redhat', 'amazon', 'fedora', 'suse' + '/etc/openldap' + when 'bsd' + '/usr/local/etc/openldap' + end + node.default['openldap']['accesslog']['enabled'] = true node.default['openldap']['accesslog']['logdb'] = '"cn=accesslog"' -node.default['openldap']['accesslog']['directory'] = '/var/lib/ldap/accesslog' +node.default['openldap']['accesslog']['directory'] = '#{ldap_dir}/accesslog' node.default['openldap']['accesslog']['index'] = 'reqStart,reqEnd,reqResult eq' node.default['openldap']['accesslog']['logops'] = 'writes' node.default['openldap']['accesslog']['logold'] = '(objectclass=*)' @@ -8,10 +18,7 @@ node.default['openldap']['modules'] << 'accesslog' -directories = ['/var/lib/ldap', '/var/lib/ldap/accesslog'] - -directories.each do |dir| - directory dir do +directory '#{ldap_dir}/accesslog' do mode '0755' owner 'root' group 'root'