Skip to content
This repository was archived by the owner on May 12, 2025. It is now read-only.

Commit 1a64235

Browse files
Adjusted mongod.conf template to ldap config
1 parent af7d52b commit 1a64235

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

templates/mongod.conf.j2

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,27 @@ security:
8282
javascriptEnabled: {{ mongodb_security_javascript_enabled | to_nice_json }}
8383
{% if mongodb_config['security'] is defined and mongodb_config['security'] is iterable -%}
8484
{% for item in mongodb_config['security'] -%}
85+
{% if item == 'ldap' -%}
86+
ldap:
87+
transportSecurity: "{{ mongodb_config['security']['ldap'].transportSecurity }}"
88+
servers: "{{ mongodb_config['security']['ldap'].servers }}"
89+
bind:
90+
queryUser: "{{ mongodb_config['security']['ldap'].bind.queryUser }}"
91+
queryPassword: "{{ mongodb_config['security']['ldap'].bind.queryPassword }}"
92+
authz:
93+
queryTemplate: "{{ mongodb_config['security']['ldap'].authz.queryTemplate }}"
94+
userToDNMapping:
95+
{{ mongodb_config['security']['ldap'].userToDNMapping }}
96+
{% else -%}
97+
{% if mongodb_config['security'][item] is mapping -%}
8598
{{ item }}:
8699
{% for key, value in mongodb_config['security'][item].items() %}
87100
{{ key }}: {{ value | to_nice_json }}
88101
{% endfor -%}
102+
{% else -%}
103+
{{ item }}: {{ mongodb_config['security'][item] | to_nice_json }}
104+
{% endif -%}
105+
{% endif -%}
89106
{% endfor %}
90107
{% endif %}
91108

0 commit comments

Comments
 (0)