gvasalt/states/gnuviechadmin/gvaldap.sls
Jan Dittberner 7381b5bfd8 Implement proper provisioning for gvaldap
- merge improvements from the internal saltstack repository
- define dummy secrets in the pillars
- use systemd to setup the gvaldap celery worker
2020-03-04 00:10:16 +01:00

19 lines
750 B
Text

{% set gvaappname = salt['grains.get']('gnuviechadmin:appname') %}
{% set purpose = "for LDAP data management" %}
{% from 'gnuviechadmin/gvaapp_macros.sls' import create_celery_worker with context %}
{{ create_celery_worker(gvaappname, purpose) }}
{{ gvaappname }}-dependencies:
pkg.installed:
- pkgs:
- libldap2-dev
- libsasl2-dev
- require_in:
- cmd: {{ gvaappname }}-requirements
base-ldap-objects:
cmd.script:
- source: salt://gnuviechadmin/gvaldap/create_base_ldap_objects.sh
- template: jinja
- runas: 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