api_version: iobackup.io/v1
kind: BackupJob
metadata:
  job_id: openldap-local
  name: OpenLDAP backup to local destination
spec:
  enabled: true
  operation:
    type: backup
  artifact:
    mode: stream
    staging:
      enabled: false
  policies:
    verify:
      after_run: true
      limit_per_task: 1
  tasks:
    - task_id: ldap-directory
      source:
        type: openldap
        config:
          host: 127.0.0.1
          port: 18389
          bind_dn: cn=admin,dc=example,dc=org
          password_env: OPENLDAP_ADMIN_PASSWORD
          base_dn: dc=example,dc=org
          scope: sub
          filter: (objectClass=*)
          timeout: 30s
      backup:
        format: json
        checksum: sha256
      destination:
        type: local
        config:
          path: /add/tmp/backups-openldap
      policies:
        retention:
          keep_last_successful: 3
