mirror of
https://github.com/phfroidmont/self-hosting.git
synced 2025-12-25 21:57:00 +01:00
31 lines
932 B
Django/Jinja
31 lines
932 B
Django/Jinja
#jinja2: trim_blocks:False
|
|
{% macro etcd_hosts() %}
|
|
{%- for host in groups['k8s_etcd'] -%}
|
|
https://{{hostvars[host]['ansible_' + k8s_interface].ipv4.address}}:{{etcd_client_port}}{% if not loop.last %},{% endif %}
|
|
{%- endfor -%}
|
|
{% endmacro %}
|
|
|
|
{%- set x=flannel_settings.__setitem__('etcd-endpoints',etcd_hosts()) -%}
|
|
|
|
[Unit]
|
|
Description=Network fabric for containers
|
|
After=network.target
|
|
After=network-online.target
|
|
Wants=network-online.target
|
|
Before=docker.service
|
|
|
|
[Service]
|
|
Type=notify
|
|
Restart=always
|
|
RestartSec={{flannel_systemd_restartsec}}
|
|
LimitNOFILE={{flannel_systemd_limitnofile}}
|
|
LimitNPROC={{flannel_systemd_limitnproc}}
|
|
ExecStartPre=/bin/mkdir -p {{flannel_subnet_file_dir}}
|
|
ExecStart={{flannel_bin_dir}}/flanneld \
|
|
{%- for setting in flannel_settings|sort %}
|
|
-{{setting}}={{flannel_settings[setting]}} {% if not loop.last %}\{% endif %}
|
|
{%- endfor %}
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|
|
RequiredBy=docker.service
|