Commit 766fa6a9 authored by nimrod's avatar nimrod
Browse files

Instead of crontab entry, place a script in /etc/cron.daily (more package...

Instead of crontab entry, place a script in /etc/cron.daily (more package like, more portable to a different CM) for backups.
parent 2be95e19
Loading
Loading
Loading
Loading
+6 −6
Changes for tasks/main.yml: 6 added lines, 6 removed lines.
Original line number Diff line number Diff line
@@ -90,11 +90,11 @@
    - Restart OpenLDAP

- name: Add backup cron job
  cron:
    name: OpenLDAP daily backup
    special_time: daily
    job: 'ldapsearch -L -Y EXTERNAL -H ldapi:/// -D "cn=admin,{{ basedn }}" > /var/backups/{{ basedn }}.ldif 2>/dev/null'
    state: present
    user: root
  template:
    src: slapd.j2
    dest: /etc/cron.daily/slapd
    owner: root
    group: root
    mode: '0755'

- include: phpldapadmin.yml
+2
Changes for templates/slapd.j2: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
#!/bin/sh -e
ldapsearch -L -Y EXTERNAL -H ldapi:/// -D "cn=admin,{{ basedn }}" > /var/backups/{{ basedn }}.ldif 2>/dev/null