Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add overlay configutation #19

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions openldap/files/slapd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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',
Expand Down
7 changes: 3 additions & 4 deletions openldap/server.sls
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
5 changes: 5 additions & 0 deletions pillar.example
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,8 @@ openldap:
content
of
my_include_file
database_config:
maxsize: 1073741824
checkpoint: '512 30'
overlay:
- memberof