ansible-roles/openldap-server/tasks/openldap_maintenance.yml

15 lines
779 B
YAML

---
- name: Install a script that removes the old transaction logs
template: src=ldap_logs_cleaner.sh.j2 dest=/usr/local/bin/ldap_logs_cleaner owner=root group=root mode=0500
tags: [ 'ldap_server', 'ldap', 'ldap_conf', 'ldap_db_cleaner' ]
- name: Install a cron job to run the ldap cleaner daily
cron: name="LDAP transaction logs cleaner" hour="0" job="/usr/local/bin/ldap_logs_cleaner"
when: openldap_cleaner_cron_job
tags: [ 'ldap_server', 'ldap', 'ldap_conf', 'ldap_db_cleaner' ]
- name: Remove the cron job that runs the ldap cleaner when it is not needed. When DB_LOG_AUTOREMOVE is set, for instance
cron: name="LDAP transaction logs cleaner" state=absent
when: not openldap_cleaner_cron_job
tags: [ 'ldap_server', 'ldap', 'ldap_conf', 'ldap_db_cleaner' ]