diff --git a/openldap/files/slapd.conf b/openldap/files/slapd.conf index 16fb367..6ade761 100644 --- a/openldap/files/slapd.conf +++ b/openldap/files/slapd.conf @@ -9,7 +9,7 @@ include {{ file }} {%- for file in salt['pillar.get']('openldap:includes',{}).keys() %} include /etc/ldap/include/{{file}} -{% endfor %} +{%- endfor %} # Define global ACLs to disable default read access. @@ -59,12 +59,30 @@ moduleload back_{{ openldap.database }} # # rootdn can always read and write EVERYTHING! +{%- if salt['pillar.get']('openldap:overlay', False) %} +# START: add overlay from pillars +{%- for overlay in salt['pillar.get']('openldap:overlay','') %} +overlay {{overlay}} +{%- endfor %} +# END: database values from pillars +{%- endif %} + + + ####################################################################### # backend database definitions ####################################################################### database {{ openldap.database }} -maxsize 1073741824 +{%- if salt['pillar.get']('openldap:database_config', False) %} +# START: database values from pillars +{%- for key, value in salt['pillar.get']('openldap:database_config','').items() %} +{{key}} {{value}} +{%- endfor %} +# END: database values from pillars +{%- else %} +maxsize 1073741824 +{%- endif %} {%- set ldap_base = salt['pillar.get']('openldap:base') %} suffix {{ ldap_base }} rootdn "{{ salt['pillar.get']('openldap:rootdn', diff --git a/openldap/server.sls b/openldap/server.sls index f82cb34..e925b32 100644 --- a/openldap/server.sls +++ b/openldap/server.sls @@ -35,12 +35,11 @@ slapd_service: - user: root - group: {{ openldap.su_group }} - clean: True -{% for file in salt['pillar.get']('openldap:includes',{}).keys() %} - - exclude_pat: '{{file}}' +{%- for file in salt['pillar.get']('openldap:includes',{}).keys() %} /etc/ldap/include/{{file}}: file.managed: - contents_pillar: openldap:includes:{{file}} - - require: + - require_in: - file: /etc/ldap/include -{% endfor %} +{%- endfor %} diff --git a/pillar.example b/pillar.example index ab80f8a..4b9456c 100644 --- a/pillar.example +++ b/pillar.example @@ -13,3 +13,8 @@ openldap: content of my_include_file + database_config: + maxsize: 1073741824 + checkpoint: '512 30' + overlay: + - memberof