133 lines
5.9 KiB
Django/Jinja
133 lines
5.9 KiB
Django/Jinja
#jinja2:lstrip_blocks: True
|
|
{{ ansible_managed | comment }}
|
|
version: "2.4"
|
|
|
|
services:
|
|
bitwardenrs:
|
|
container_name: {{ bitwardenrs_container_name }}
|
|
image: {{ bitwardenrs_image }}
|
|
restart: {{ bitwardenrs_restart_policy }}
|
|
{% if bitwardenrs_exposed_ports | default([]) %}
|
|
ports:
|
|
{% for port in bitwardenrs_exposed_ports %}
|
|
- {{ port | quote }}
|
|
{% endfor %}
|
|
{% endif %}
|
|
{% if bitwardenrs_volumes | default([]) %}
|
|
volumes:
|
|
{% for volume in bitwardenrs_volumes %}
|
|
- "{{ volume.name }}:{{ volume.dest }}"
|
|
{% endfor %}
|
|
{% endif %}
|
|
{% if bitwardenrs_networks_applied | default([]) %}
|
|
networks:
|
|
{% for network in bitwardenrs_networks_applied %}
|
|
- {{ network }}
|
|
{% endfor %}
|
|
{% endif %}
|
|
{% if bitwardenrs_extra_hosts | default([]) %}
|
|
extra_hosts:
|
|
{% for host in bitwardenrs_extra_hosts %}
|
|
- {{ host | quote }}
|
|
{% endfor %}
|
|
{% endif %}
|
|
environment:
|
|
- BITWARDENRS_DOMAIN={{ bitwardenrs_base_url }}
|
|
- BITWARDENRS_DATABASE_URL=postgresql://{{ bitwardenrs_db_user }}:{{ bitwardenrs_db_password | urlencode }}@{{ bitwardenrs_db_server }}:{{ bitwardenrs_db_port }}/{{ bitwardenrs_db_name }}?sslmode={{ bitwardenrs_db_ssl_mode }}&sslrootcert={{ bitwardenrs_db_ssl_rootcert }}
|
|
- BITWARDENRS_USER_ATTACHMENT_LIMIT={{ bitwardenrs_user_attachment_limit }}
|
|
- BITWARDENRS_ORG_ATTACHMENT_LIMIT={{ bitwardenrs_org_attachment_limit }}
|
|
- BITWARDENRS_WEBSOCKET_ENABLED={{ bitwardenrs_websocket_enabled }}
|
|
{% if bitwardenrs_templates_folder is defined and bitwardenrs_templates_folder %}
|
|
- BITWARDENRS_TEMPLATES_FOLDER={{ bitwardenrs_templates_folder }}
|
|
{% endif %}
|
|
- BITWARDENRS_RELOAD_TEMPLATES={{ bitwardenrs_reload_templates }}
|
|
- BITWARDENRS_IP_HEADER={{ bitwardenrs_ip_header }}
|
|
- BITWARDENRS_ICON_CACHE_TTL={{ bitwardenrs_icon_cache_ttl }}
|
|
- BITWARDENRS_ICON_CACHE_NEGTTL="{{ bitwardenrs_icon_cache_negttl }}"
|
|
- BITWARDENRS_WEB_VAULT_ENABLED={{ bitwardenrs_web_vault_enabled }}
|
|
- BITWARDENRS_EXTENDED_LOGGING={{ bitwardenrs_extended_logging }}
|
|
- BITWARDENRS_LOG_LEVEL={{ bitwardenrs_log_level }}
|
|
- BITWARDENRS_DISABLE_ICON_DOWNLOAD={{ bitwardenrs_disable_icon_download }}
|
|
- BITWARDENRS_ICON_DOWNLOAD_TIMEOUT={{ bitwardenrs_icon_download_timeout }}
|
|
{% if bitwardenrs_icon_blacklist_regexl is defined and bitwardenrs_icon_blacklist_regexl %}
|
|
- BITWARDENRS_ICON_BLACKLIST_REGEXL={{ bitwardenrs_icon_blacklist_regexl }}
|
|
{% endif %}
|
|
- BITWARDENRS_ICON_BLACKLIST_NON_GLOBAL_IPS={{ bitwardenrs_icon_blacklist_non_global_ips }}
|
|
- BITWARDENRS_DISABLE_2FA_REMEMBER={{ bitwardenrs_disable_2fa_remember }}
|
|
- BITWARDENRS_SIGNUPS_ALLOWED={{ bitwardenrs_signups_allowed }}
|
|
- BITWARDENRS_SIGNUPS_VERIFY={{ bitwardenrs_signups_verify }}
|
|
- BITWARDENRS_SIGNUPS_VERIFY_RESEND_TIME={{ bitwardenrs_signups_verify_resend_time }}
|
|
- BITWARDENRS_SIGNUPS_VERIFY_RESEND_LIMIT={{ bitwardenrs_signups_verify_resend_limit }}
|
|
{% if bitwardenrs_signups_domains_whitelist is defined and bitwardenrs_signups_domains_whitelist %}
|
|
- BITWARDENRS_SIGNUPS_DOMAINS_WHITELIST={{ bitwardenrs_signups_domains_whitelist }}
|
|
{% endif %}
|
|
- BITWARDENRS_INVITATIONS_ALLOWED={{ bitwardenrs_invitations_allowed }}
|
|
{% if bitwardenrs_admin_token is defined and bitwardenrs_admin_token %}
|
|
- BITWARDENRS_ADMIN_TOKEN={{ bitwardenrs_admin_token }}
|
|
{% endif %}
|
|
- BITWARDENRS_PASSWORD_ITERATIONS={{ bitwardenrs_password_iterations }}
|
|
- BITWARDENRS_SHOW_PASSWORD_HINT={{ bitwardenrs_show_password_hint }}
|
|
- BITWARDENRS_AUTHENTICATOR_DISABLE_TIME_DRIFT={{ bitwardenrs_authenticator_disable_time_drift }}
|
|
{% if bitwardenrs_smtp_host is defined and bitwardenrs_smtp_host %}
|
|
- BITWARDENRS_SMTP_HOST={{ bitwardenrs_smtp_host }}
|
|
- BITWARDENRS_SMTP_FROM={{ bitwardenrs_smtp_from }}
|
|
- BITWARDENRS_SMTP_FROM_NAME={{ bitwardenrs_smtp_from_name }}
|
|
- BITWARDENRS_SMTP_PORT={{ bitwardenrs_smtp_port }}
|
|
- BITWARDENRS_SMTP_SSL={{ bitwardenrs_smtp_ssl }}
|
|
{% if bitwardenrs_smtp_username is defined and bitwardenrs_smtp_username %}
|
|
- BITWARDENRS_SMTP_USERNAME={{ bitwardenrs_smtp_username }}
|
|
- BITWARDENRS_SMTP_PASSWORD={{ bitwardenrs_smtp_password }}
|
|
{% endif %}
|
|
- BITWARDENRS_SMTP_AUTH_MECHANISM={{ bitwardenrs_smtp_auth_mechanism }}
|
|
- BITWARDENRS_SMTP_TIMEOUT={{ bitwardenrs_smtp_timeout }}
|
|
{% endif %}
|
|
{% if bitwardenrs_memory_limit is defined %}
|
|
mem_limit: {{ bitwardenrs_memory_limit }}
|
|
{% endif %}
|
|
{% if bitwardenrs_memory_reservation is defined %}
|
|
mem_reservation: {{ bitwardenrs_memory_reservation }}
|
|
{% endif %}
|
|
{% if bitwardenrs_cpu_shares is defined %}
|
|
cpu_shares: {{ bitwardenrs_cpu_shares }}
|
|
{% endif %}
|
|
{% if not bitwardenrs_cap_add | length == 0 %}
|
|
cap_add:
|
|
{% for item in bitwardenrs_cap_add %}
|
|
- {{ item }}
|
|
{% endfor %}
|
|
{% endif %}
|
|
{% if not bitwardenrs_cap_drop | length == 0 %}
|
|
cap_drop:
|
|
{% for item in bitwardenrs_cap_drop %}
|
|
- {{ item }}
|
|
{% endfor %}
|
|
{% endif %}
|
|
{% if not bitwardenrs_security_opt | length == 0 %}
|
|
security_opt:
|
|
{% for item in bitwardenrs_security_opt %}
|
|
- {{ item }}
|
|
{% endfor %}
|
|
{% endif %}
|
|
healthcheck:
|
|
{% for key, value in bitwardenrs_healthcheck.items() %}
|
|
{{ key }}: {{ value }}
|
|
{% endfor %}
|
|
{% if bitwardenrs_pids_limit is defined %}
|
|
pids_limit: {{ bitwardenrs_pids_limit }}
|
|
{% endif %}
|
|
{% if bitwardenrs_volumes | default([]) | rejectattr("bind") | list | length > 0 %}
|
|
|
|
volumes:
|
|
{% for volume in bitwardenrs_volumes | rejectattr("bind") %}
|
|
{{ volume.name }}:
|
|
{% endfor %}
|
|
{% endif %}
|
|
{% if bitwardenrs_networks | default([]) | length > 0 %}
|
|
|
|
networks:
|
|
{% for network in bitwardenrs_networks %}
|
|
{{ network.name }}:
|
|
driver: {{ network.backend | default("bridge") }}
|
|
{% endfor %}
|
|
{% endif %}
|