include: - gnuviechadmin.base - gnuviechadmin.celery gvaldap-packages: pkg.installed: - pkgs: - libldap2-dev - libsasl2-dev - require_in: - pkg: gnuviechadmin-packages base-ldap-objects: cmd.script: - source: salt://gnuviechadmin/gvaldap/create_base_ldap_objects.sh - template: jinja - user: root - group: root - unless: ldapsearch -Y EXTERNAL -H ldapi:// -b "{{ salt['pillar.get']('gnuviechadmin:ldap_base_dn') }}" "cn={{ salt['pillar.get']('gnuviechadmin:ldap_admin_user') }}" | grep -q numEntries