infrastructure/templates/infrastructure.d2.j2

92 lines
1.5 KiB
Text
Raw Permalink Normal View History

2024-10-14 20:11:20 +00:00
vars: {
d2-config: {
layout-engine: elk
theme-id: 101
}
}
external: {
scaleway: {
s3
}
restic: {
icon: https://cdn.jsdelivr.net/gh/selfhst/icons/webp/restic.webp
}
}
{% for host in hosts %}
{{ host.key }}: {
}
{{ host.key }}.backup -> external.restic {
style: {
stroke: "#0f0"
stroke-dash: 3
}
}
2024-10-14 20:11:20 +00:00
{% endfor %}{# host #}
{% for svc in svcs %}
{{ svc.key }}: {
label: {{ svc.label }}
label.near: top-left
icon: {{ svc.icon }}
icon.near: top-right
}
{% for backup in svc.backup or [] %}
{{ svc.key }} -> {{ svc.host_key }}.backup: {{ backup.name }} {
2024-10-14 20:11:20 +00:00
style: {
stroke: "#0f0"
stroke-dash: 3
}
}
{% endfor %}{# backup #}
{% if svc.monitoring %}
{{ monitoring_key }} -> {{ svc.key }}: {
style.stroke: "#1E9025"
}
{% endif %}
{% if svc.database %}
{{ svc.key }} -> {{ db_key }}: {
style.stroke: "#336791"
}
{{ db_key }}.{{ svc.name }}
{% endif %}
{% if svc.auth %}
{{ svc.key }} -> {{ auth_key }}: {
style.stroke: "#FD4B2D"
}
{{ auth_key }}.{{ svc.name }}
{% endif %}
{% if svc.s3 %}
{{ svc.key }} -> external.scaleway.s3: {
style: {
stroke: "#110B1E"
stroke-dash: 3
}
}
external.scaleway.s3.{{ svc.name }}
{% endif %}
2024-10-29 21:43:05 +00:00
{% if svc.mail %}
{{ svc.key }} -> {{ mail_key }}: {
style.stroke: "#C9B81F"
}
{{ mail_key }}.{{ svc.name }}
{% endif %}
2024-10-14 20:11:20 +00:00
{% endfor %}{# svc #}
{% for svc in grid_svcs %}
{{ svc }}: {
grid-columns: 3
grid-gap: 0
}
{% endfor %}