2020-06-21 20:00:53 +00:00
|
|
|
#jinja2:lstrip_blocks: True
|
|
|
|
{{ ansible_managed | comment }}
|
|
|
|
version: "2.4"
|
|
|
|
|
|
|
|
services:
|
2021-05-15 20:09:29 +00:00
|
|
|
vaultwarden_ldap:
|
|
|
|
container_name: {{ vaultwarden_ldap_container_name }}
|
|
|
|
image: {{ vaultwarden_ldap_image }}
|
|
|
|
restart: {{ vaultwarden_ldap_restart_policy }}
|
|
|
|
{% if vaultwarden_ldap_volumes | default([]) %}
|
2020-06-21 20:00:53 +00:00
|
|
|
volumes:
|
2021-05-15 20:09:29 +00:00
|
|
|
{% for volume in vaultwarden_ldap_volumes %}
|
2020-06-21 20:00:53 +00:00
|
|
|
- "{{ volume.name }}:{{ volume.dest }}"
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
2021-05-15 20:09:29 +00:00
|
|
|
{% if vaultwarden_ldap_networks_applied | default([]) %}
|
2020-06-21 20:00:53 +00:00
|
|
|
networks:
|
2021-05-15 20:09:29 +00:00
|
|
|
{% for network in vaultwarden_ldap_networks_applied %}
|
2020-06-21 20:00:53 +00:00
|
|
|
- {{ network }}
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
|
|
|
environment:
|
2021-05-15 20:09:29 +00:00
|
|
|
- VAULTWARDEN_LDAP_VAULTWARDEN_URL={{ vaultwarden_ldap_vaultwarden_url }}
|
|
|
|
- VAULTWARDEN_LDAP_VAULTWARDEN_ADMIN_TOKEN={{ vaultwarden_ldap_vaultwarden_admin_token }}
|
|
|
|
- VAULTWARDEN_LDAP_HOST={{ vaultwarden_ldap_host }}
|
|
|
|
{% if vaultwarden_ldap_scheme is defined and vaultwarden_ldap_scheme %}
|
|
|
|
- VAULTWARDEN_LDAP_SCHEME={{ vaultwarden_ldap_scheme }}
|
2020-06-21 20:00:53 +00:00
|
|
|
{% endif %}
|
2021-05-15 20:09:29 +00:00
|
|
|
- VAULTWARDEN_LDAP_SSL={{ vaultwarden_ldap_ssl }}
|
|
|
|
{% if vaultwarden_ldap_port is defined and vaultwarden_ldap_port %}
|
|
|
|
- VAULTWARDEN_LDAP_PORT={{ vaultwarden_ldap_port }}
|
2020-06-21 20:00:53 +00:00
|
|
|
{% endif %}
|
2021-05-15 20:09:29 +00:00
|
|
|
- VAULTWARDEN_LDAP_BIND_DN={{ vaultwarden_ldap_bind_dn }}
|
|
|
|
- VAULTWARDEN_LDAP_BIND_PASSWORD={{ vaultwarden_ldap_bind_password }}
|
|
|
|
- VAULTWARDEN_LDAP_SEARCH_BASE_DN={{ vaultwarden_ldap_search_base_dn }}
|
|
|
|
- VAULTWARDEN_LDAP_SEARCH_FILTER={{ vaultwarden_ldap_search_filter }}
|
|
|
|
- VAULTWARDEN_LDAP_MAIL_FIELD={{ vaultwarden_ldap_mail_field }}
|
|
|
|
- VAULTWARDEN_LDAP_SYNC_INTERVAL_SECONDS={{ vaultwarden_ldap_sync_interval_seconds }}
|
|
|
|
- VAULTWARDEN_LDAP_SYNC_LOOP={{ vaultwarden_ldap_sync_loop }}
|
|
|
|
{% if vaultwarden_ldap_memory_limit is defined %}
|
|
|
|
mem_limit: {{ vaultwarden_ldap_memory_limit }}
|
2020-06-21 20:00:53 +00:00
|
|
|
{% endif %}
|
2021-05-15 20:09:29 +00:00
|
|
|
{% if vaultwarden_ldap_memory_reservation is defined %}
|
|
|
|
mem_reservation: {{ vaultwarden_ldap_memory_reservation }}
|
2020-06-21 20:00:53 +00:00
|
|
|
{% endif %}
|
2021-05-15 20:09:29 +00:00
|
|
|
{% if vaultwarden_ldap_cpu_shares is defined %}
|
|
|
|
cpu_shares: {{ vaultwarden_ldap_cpu_shares }}
|
2020-06-21 20:00:53 +00:00
|
|
|
{% endif %}
|
2021-05-15 20:09:29 +00:00
|
|
|
{% if not vaultwarden_ldap_cap_add | length == 0 %}
|
2020-06-21 20:00:53 +00:00
|
|
|
cap_add:
|
2021-05-15 20:09:29 +00:00
|
|
|
{% for item in vaultwarden_ldap_cap_add %}
|
2020-06-21 20:00:53 +00:00
|
|
|
- {{ item }}
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
2021-05-15 20:09:29 +00:00
|
|
|
{% if not vaultwarden_ldap_cap_drop | length == 0 %}
|
2020-06-21 20:00:53 +00:00
|
|
|
cap_drop:
|
2021-05-15 20:09:29 +00:00
|
|
|
{% for item in vaultwarden_ldap_cap_drop %}
|
2020-06-21 20:00:53 +00:00
|
|
|
- {{ item }}
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
2021-05-15 20:09:29 +00:00
|
|
|
{% if not vaultwarden_ldap_security_opt | length == 0 %}
|
2020-06-21 20:00:53 +00:00
|
|
|
security_opt:
|
2021-05-15 20:09:29 +00:00
|
|
|
{% for item in vaultwarden_ldap_security_opt %}
|
2020-06-21 20:00:53 +00:00
|
|
|
- {{ item }}
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
2021-05-15 20:09:29 +00:00
|
|
|
{% if vaultwarden_ldap_pids_limit is defined %}
|
|
|
|
pids_limit: {{ vaultwarden_ldap_pids_limit }}
|
2020-06-21 20:00:53 +00:00
|
|
|
{% endif %}
|
2021-05-15 20:09:29 +00:00
|
|
|
{% if vaultwarden_ldap_networks | default([]) | length > 0 %}
|
2020-06-21 20:00:53 +00:00
|
|
|
|
|
|
|
networks:
|
2021-05-15 20:09:29 +00:00
|
|
|
{% for network in vaultwarden_ldap_networks %}
|
2020-06-21 20:00:53 +00:00
|
|
|
{{ network.name }}:
|
|
|
|
{% if network.external | default(False) | bool %}
|
|
|
|
external: true
|
|
|
|
{% else %}
|
|
|
|
driver: {{ network.backend | default("bridge") }}
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|