diff options
144 files changed, 4863 insertions, 295 deletions
diff --git a/.settings.sh b/.settings.sh index 38b5e20..a166ade 100644 --- a/.settings.sh +++ b/.settings.sh @@ -5,8 +5,9 @@ basedir=$(cd "$basedir" && pwd) export ANSIBLE_CONFIG=$basedir/ansible/ansible.cfg -echo "Adding bin/ to path" +PATH="$basedir/bin/env/bin:$PATH" PATH="$basedir/bin:$PATH" +PATH="$HOME/.asdf/shims:$PATH" #echo "Adding bin/.tmp/asdf-data/shims/ to path" #PATH="$basedir/bin/.tmp/asdf-data/shims:$PATH" diff --git a/.tool-versions b/.tool-versions new file mode 100644 index 0000000..ad228d9 --- /dev/null +++ b/.tool-versions @@ -0,0 +1,7 @@ +golang 1.23.2 +sops 3.9.1 +yamlfmt 0.13.0 +kubectl 1.31.1 +helm 3.16.2 +cilium-cli 0.16.20 +terraform 1.9.5 diff --git a/README-snmp.md b/README-snmp.md new file mode 100644 index 0000000..e4ec3fe --- /dev/null +++ b/README-snmp.md @@ -0,0 +1,19 @@ +# Collecting SNMP data with Prometheus + +Use the `prometheus-snmp-exporter` package. + +## Generating snmp.yml + +This file is not included in the Debian packages for licensing reasons, and we +also want to include the Ubiquiti MIBs anyway. + +Main docs: https://github.com/prometheus/snmp_exporter/tree/main/generator + +Short story: + +* git clone https://github.com/prometheus/snmp_exporter.git +* make generate +* make mibs # downloads the MIBs, including the UBNT ones +* ./generator generate -m mibs -g generator.yml -o snmp.yml + +Copy `snmp.yml` to `/etc/prometheus/snmp.yml`. diff --git a/ansible/ansible.cfg b/ansible/ansible.cfg index 6f2b86b..2190846 100644 --- a/ansible/ansible.cfg +++ b/ansible/ansible.cfg @@ -7,6 +7,7 @@ stdout_callback = debug vault_password_file = ./.vault-password roles_path = roles:thirdparty retry_files_enabled = False +vars_plugins_enabled = host_group_vars,community.sops.sops [ssh_connection] pipelining = True diff --git a/ansible/group_vars/all/ipam.yml b/ansible/group_vars/all/ipam.yml index 6c61600..5621385 100644 --- a/ansible/group_vars/all/ipam.yml +++ b/ansible/group_vars/all/ipam.yml @@ -4,44 +4,102 @@ # 56: ffff:ffff:ffff:ff00:: # 60: ffff:ffff:ffff:fff0:: # 64: ffff:ffff:ffff:ffff:: +# 80: ffff:ffff:ffff:ffff:ffff: ipam6: networks: bitraf_dn42: - range: "fdb1:4242:3538:::/48" + range: "fdb1:4242:3538::/48" tnet_dn42: range: "fdb1:4242:3538:2000::/52" - conflatorio_dn42: - description: Internal network on host + unused_2001: range: "fdb1:4242:3538:2001::/64" - hosts: - conflatorio-ix: "fdb1:4242:3538:2001::ffff/64" - conflatorio_docker: - range: "fdb1:4242:3538:2001:1001::/112" node1_dn42: range: "fdb1:4242:3538:2002::/64" + hosts: + node1: "fdb1:4242:3538:2002::ffff" node2_dn42: range: "fdb1:4242:3538:2003::/64" + hosts: + node2: "fdb1:4242:3538:2003::ffff" knot_dn42: range: "fdb1:4242:3538:2004::/64" hosts: - knot: "fdb1:4242:3538:2004::ffff/64" + knot: "fdb1:4242:3538:2004::ffff" coregonus_dn42: range: "fdb1:4242:3538:2005::/64" hosts: - coregonus-ix: "fdb1:4242:3538:2005::ffff/64" - danneri: "fdb1:4242:3538:2005:9422:d355:95b7:f170" + kjell: "fdb1:4242:3538:2006:2f0:cbff:fefe:d98c/64" coregonus_docker: range: "fdb1:4242:3538:2005:df01:676a:ec28:0a00/120" + kv24_pub: + range: "2a01:799:111d:1801::/64" kv24_dn42: range: "fdb1:4242:3538:2006::/64" hosts: - kv24ix: "fdb1:4242:3538:2006::ffff/64" - conflatorio_dn42_2: + kv24ix: "fdb1:4242:3538:2006::ffff" + garasjepi: "fdb1:4242:3538:2006:e9f7:418f:49fd:8d2e" + ha-kv24: "fdb1:4242:3538:2006:18a:90f:4264:8ca0/64" + netbox: "fdb1:4242:3538:2006:be24:11ff:febb:5c7f/64" + coregonus: "fdb1:4242:3538:2006:2e0:4cff:fe98:1bb5/64" + hash_dn42: + range: "fdb1:4242:3538:2007::/64" + hosts: + hash: "fdb1:4242:3538:2007::ffff" + hash_docker_dn42: range: "fdb1:4242:3538:2007:1001::/112" lhn2_dn42: range: "fdb1:4242:3538:2008::/64" hosts: - lhn2pi: "fdb1:4242:3538:2008::ffff/64" + lhn2pi: "fdb1:4242:3538:2008::ffff" + lhn2-z2m: "fdb1:4242:3538:2008:9aed:e460:1711:07dd" + ha-lhn2: "fdb1:4242:3538:2008:9c59:926f:1dc9:89db" + conflatorio: "fdb1:4242:3538:2008:8042:32ff:fe0c:7161" + danneri: "fdb1:4242:3538:2008:9422:d355:95b7:f170" + unifi: "fdb1:4242:3538:2008:5054:ff:fe4d:96c" + +# k8s: +# range: "fdb1:4242:3538:3000::/52" + danneri_cluster: + range: "fdb1:4242:3538:2008:aaaa:aaaa:aaaa::/112" + danneri_service: + range: "fdb1:4242:3538:2008:bbbb:bbbb:bbbb::/112" +# danneri_service2: +# range: "fdb1:4242:3538:300a::/112" dn42: range: "fd00::/8" + +routers: + knot: + as: 4242423538 + peers: + hash: + routedbits_lon1: + as: 4242420207 + hash: + as: 4242423538 + peers: + knot: + lhn2: + as: 4242423538 + peers: + knot: + node1: + as: 4242423538 + peers: + knot: + hash: + node2: + as: 4242423538 + peers: + knot: + hash: + kv24: + as: 4242423538 + peers: + knot: + danneri: + as: 4242423538 + peers: + knot: + hash: diff --git a/ansible/host_vars/kjell-ct-102/traefik-server.yml b/ansible/host_vars/kjell-ct-102/traefik-server.yml new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/ansible/host_vars/kjell-ct-102/traefik-server.yml diff --git a/ansible/host_vars/kjell-ct-102/users.yml b/ansible/host_vars/kjell-ct-102/users.yml new file mode 100644 index 0000000..d0d4852 --- /dev/null +++ b/ansible/host_vars/kjell-ct-102/users.yml @@ -0,0 +1,5 @@ +lusers: + - trygvis + +superusers: + - trygvis diff --git a/ansible/host_vars/unifi/systemd-networkd.yml b/ansible/host_vars/unifi/systemd-networkd.yml new file mode 100644 index 0000000..4ee9ee6 --- /dev/null +++ b/ansible/host_vars/unifi/systemd-networkd.yml @@ -0,0 +1,2 @@ +systemd_networkd__files: + - unifi/systemd-networkd/enp1s0.network diff --git a/ansible/inventory b/ansible/inventory index 845580f..912b922 100644 --- a/ansible/inventory +++ b/ansible/inventory @@ -29,8 +29,6 @@ all: ansible_python_interpreter: /usr/bin/python3 nextcloud: ansible_host: 192.168.10.201 - unifi: - ansible_host: 192.168.10.202 babypi: ansible_host: 192.168.10.159 # astyanax: @@ -47,7 +45,11 @@ all: coregonus: ansible_host: 192.168.10.190 danneri: - ansible_host: 192.168.100.103 + ansible_host: danneri.dn42.trygvis.io + unifi: + ansible_host: unifi.dn42.trygvis.io + garasjepi: + ansible_host: garasjepi.dn42.trygvis.io node1: ansible_host: 9859f51e-1e3e-4c05-a826-b7fbe18d91be.pub.instances.scw.cloud @@ -57,6 +59,10 @@ all: zh2569.rsync.net: ansible_user: zh2569 + # Kjell + kjell-ct-102: + ansible_host: fdb1:4242:3538:2005:be24:11ff:fe34:b52c + children: workstation: children: @@ -85,7 +91,6 @@ all: malabaricus: nextcloud: numquam: - unifi: lxc_hosts: hosts: arius: @@ -102,7 +107,6 @@ all: debian_stretch: hosts: malabaricus: - unifi: vars: packages__version: stretch @@ -201,4 +205,9 @@ all: node1: node2: + zigbee2mqtt: + hosts: + garasjepi: + lhn2pi: + # vim: set filetype=yaml: diff --git a/ansible/netbox/pyproject.toml b/ansible/netbox/pyproject.toml new file mode 100644 index 0000000..84c0d6d --- /dev/null +++ b/ansible/netbox/pyproject.toml @@ -0,0 +1,10 @@ +[project] +name = "netbox" +version = "0.1.0" +description = "Add your description here" +readme = "README.md" +requires-python = ">=3.12" +dependencies = [ + "unifi-controller-api", + "pynetbox", +] diff --git a/ansible/netbox/sync-unifi.py b/ansible/netbox/sync-unifi.py new file mode 100644 index 0000000..4427b20 --- /dev/null +++ b/ansible/netbox/sync-unifi.py @@ -0,0 +1,363 @@ +import os +import sys +from unifi_controller_api import UnifiController, UnifiDevice +from unifi_controller_api.exceptions import UnifiAuthenticationError, UnifiAPIError +from pprint import pprint + +import pynetbox +from pynetbox.core.response import Record + +class Db(): + def __init__(self): + self.devices = [] + self.interfaces = [] + self.ips = [] + self.macs = [] + self.cables = [] + +class NotFoundException(Exception): + def __init__(self, msg): + super().__init__(msg) + +class Query(): + def __init__(self, args, query, projection=lambda x: x.id): + self.args = args + self.query = query + self.projection = projection + + def run(self, nb): + try: + ret = self.query() + except Exception as e: + print("Query failed: ") + print(f"Arguments: {value.args}") + print(e) + raise e + + if ret is None: + raise NotFoundException(f"resource not found, args={self.args}") + +# if len(ret) != 1: +# raise NotFoundException(f"multiple resources found, args={self.args}, result={ret}") + + return self.projection(ret) + +def find_device(nb, name: str): + return Query({}, lambda: nb.dcim.devices.get(name=name)) + +def find_interface_by_mac(nb, mac_address: str): + args = locals() + del args["nb"] + return Query(args, lambda: nb.dcim.interfaces.get(mac_address=mac_address)) + +def find_interface(nb, device: str, name: str): + args = locals() + del args["nb"] + return Query(args, lambda: nb.dcim.interfaces.get(device=device, name=name)) + +class NetboxCache(): + def __init__(self, nb): + self.nb = nb + self.device_roles = {} + self.device_types = {} + self.ip_addresses = {} + + def get_device_role(self, slug): + dt = self.device_roles.get(slug) + + if dt is not None: + return dt + + dt = self.nb.dcim.device_roles.get(slug=slug) + if dt is None: + raise Exception(f"No such device type: {slug}") + + self.device_roles[slug] = dt + return dt + + def get_device_type(self, slug): + dt = self.device_types.get(slug) + + if dt is not None: + return dt + + dt = self.nb.dcim.device_types.get(slug=slug) + if dt is None: + raise Exception(f"No such device type: {slug}") + + self.device_types[slug] = dt + return dt + + def get_or_create_ip_address(self, addr: str, vrf: Record | None, data): + vrf_id = vrf.id if vrf is not None else None + key = (addr, vrf_id) + ip = self.ip_addresses.get(key) + if ip is not None: + return ip + + ip = self.nb.ipam.ip_addresses.get(address=addr, vrf_id=vrf_id) + if ip is not None: + print(f"Found IP address {ip.id} address={ip.address}, vrf={ip.vrf}") + ip.update(data) + ip = self.nb.ipam.ip_addresses.get(address=addr, vrf_id=vrf_id) + self.ip_addresses[key] = ip + return ip + + ip = self.nb.ipam.ip_addresses.create(address=addr, vrf=vrf_id, status="active") + self.ip_addresses[key] = ip + return ip + +def create_or_update_device(nb, d): + device = nb.dcim.devices.get(name = d["name"]) + if device is None: + device = nb.dcim.devices.create(d) + print(f"Created device id={device.id}, name={device.name}") + + return device + + print(f"Updating device id={device.id}, name={device.name}") + device.update(d) + + return nb.dcim.devices.get(id=device.id) + +def create_or_update_interface(nb, i): + iface = nb.dcim.interfaces.get(device_id=i["device"], name=i["name"]) + if iface is None: + iface = nb.dcim.interfaces.create(i) + print(f"Created interface id={iface.id}, name={iface.name}") + + return iface + + print(f"Updating interface id={iface.id}, name={iface.name}") + iface.update(i) + return nb.dcim.interfaces.get(id=iface.id) + +def create_or_update_mac_address(nb, data): + ma = nb.dcim.mac_addresses.get(mac_address=data["mac_address"]) + if ma is None: + ma = nb.dcim.mac_addresses.create(data) + print(f"Created MAC address id={ma.id}, address={ma.mac_address}") + + return ma + + print(f"Updating MAC address id={ma.id}, address={ma.mac_address}") + ma.update(data) + return nb.dcim.mac_addresses.get(id=ma.id) + +def create_or_update_ip_address(nb, data): + ip = nb.ipam.ip_addresses.get(address=data["address"]) + if ip is None: + ip = nb.ipam.ip_addresses.create(data) + print(f"Created IP address id={ip.id}, ip={ip.address}") + + return ip + + print(f"Updating IP address id={ip.id}, ip={ip.address}") + ip.update(data) + return nb.ipam.ip_addresses.get(id=ip.id) + +def create_or_update_cable(nb, data): + if len(data["a_terminations"]) == 1: + a = data["a_terminations"][0] + else: + raise Exception("only single termination is supported") + + if len(data["b_terminations"]) == 1: + b = data["b_terminations"][0] + else: + raise Exception("only single termination is supported") + + cable = nb.dcim.cables.get( + termination_a_type=a["object_type"], + termination_a_id=a["object_id"], + termination_b_type=b["object_type"], + termination_b_id=b["object_id"], + ) + if cable is None: + cable = nb.dcim.cables.create(data) + print(f"Created Cable address id={ip.id}") + + return cable + + print(f"Updating cable id={ip.id}") + cable.update(data) + return nb.dcim.cables.get(id=cable.id) + +def process_switch(d: UnifiDevice, db: Db, nb: NetboxCache, site, vrf): +# db.devices.append({ +# "name": d.name, +# "device_type": nb.get_device_type("ubiquiti-us-8-150w").id, +# "role": nb.get_device_role("switch").id, +# "serial": d.serial, +# "site_name": site, +# }) +# +# db.interfaces.append({ +# "device": find_device(nb.nb, name=d.name), +# "name": "switch0", +# "type": "virtual", +# }) +# +# db.ips.append({ +# "address": f"{d.ip}/32", +# "is_primary": "true", +# "vrf": vrf.id, +# "assigned_object_id": find_interface(nb.nb, device=d.name, name="switch0"), +# "assigned_object_type": "dcim.interface", +## "is_primary": "true" TODO: does not work +# }) +# +# db.macs.append({ +# "mac_address": d.mac, +# "assigned_object_id": find_interface(nb.nb, device=d.name, name="switch0"), +# "assigned_object_type": "dcim.interface", +## "is_primary": "true" TODO: does not work +# }) + + pprint(d.lldp_info) + + for e in d.lldp_info: + a = [ + { + "object_type": "dcim.interface", + "object_id": find_interface(nb.nb, device=d.name, name=f"Port {e.local_port_idx} (PoE)"), + } + ] + b = [ + { + "object_type": "dcim.interface", + "object_id": find_interface_by_mac(nb.nb, e.chassis_id), + } + ] + + if e.chassis_id > d.mac: + a, b = b, a + + db.cables.append({ + "a_terminations": a, + "b_terminations": b, + "status": "connected", + }) + +def sync_db(db: Db, nb): + def resolve_query(value): + if value is None or isinstance(value, str) or isinstance(value, int): + return value + elif isinstance(value, Query): + return value.run(nb) + elif isinstance(value, dict): + for k, v in value.items(): + value[k] = resolve_query(v) + elif isinstance(value, list): + for i, item in enumerate(value): + value[i] = resolve_query(item) + else: + raise Exception(f"unsupported type: {value}") + return value + + for device in db.devices: + device = resolve_query(device) + create_or_update_device(nb, device) + + for iface in db.interfaces: + iface = resolve_query(iface) + create_or_update_interface(nb, iface) + + for mac in db.macs: + mac = resolve_query(mac) + create_or_update_mac_address(nb, mac) + + for ip in db.ips: + ip = resolve_query(ip) + create_or_update_ip_address(nb, ip) + + for cable in db.cables: + try: + cable = resolve_query(cable) + pprint(cable) + create_or_update_cable(nb, cable) + except NotFoundException: + print("Cable failed, could not find endpoint") + continue + +def main(): + unifi_url=os.getenv("UNIFI_URL") + unifi_username=os.getenv("UNIFI_USERNAME") + unifi_password=os.getenv("UNIFI_PASSWORD") + unifi_site=os.getenv("UNIFI_SITE") + + netbox_url=os.getenv("NETBOX_URL") + netbox_token=os.getenv("NETBOX_TOKEN") + netbox_vrf_name=os.getenv("NETBOX_VRF") + netbox_site_name=os.getenv("NETBOX_SITE") + + controller = controller_login(unifi_url, unifi_username, unifi_password) + + (nb, netbox_site, netbox_vrf) = netbox_login(netbox_url, netbox_token, netbox_site_name, netbox_vrf_name) + status = nb.status() + print(f"NetBox status: {status}") + + devices = collect_devices(controller, unifi_site) + + nb_cache = NetboxCache(nb) + db = Db() + for d in devices: +# pprint(d) + if d.model == "US8P150": + process_switch(d, db, nb_cache, netbox_site, netbox_vrf) + + sync_db(db, nb) + +def controller_login(url, username, password) -> UnifiController: +# try: + controller = UnifiController( + controller_url=url, + username=username, + password=password, + is_udm_pro=False, + verify_ssl=True, + ) + + # Just to check that there is a valid authentication + controller.get_unifi_site(include_health=False, raw=False) + + return controller +# except UnifiAuthenticationError: +# print("Authentication failed - please check your UniFi Controller credentials and URL.") +# except UnifiAPIError as e: +# print(f"UniFi API error: {e}") +# except Exception as e: +# print(f"An unexpected error occurred: {e}") + +def collect_devices(controller: UnifiController, site_name: str) -> list[UnifiDevice]: + try: + return controller.get_unifi_site_device(site_name=site_name, detailed=True, raw=False) + except UnifiAPIError as e: + print(f"Error fetching device information: {e}") + except Exception as e: + print(f"An unexpected error occurred: {e}") + +def netbox_login(url: str, token: str, site_name: str, vrf_name: str) -> pynetbox.core.api.Api: + nb = pynetbox.api(url, token=token) + + site = nb.dcim.sites.get(name=site_name) + if site is None: + site = nb.dcim.sites.get(slug=site_name) + if site is None: + print(f"Could not look up site by name or slug: {site_name}") + exit(1) + print(f"NetBox site {site.name}") + + vrf = None + vrf_id = None + if vrf_name is not None: + vrf = nb.ipam.vrfs.get(site=site, name=vrf_name) + if vrf is None: + print(f"Could not look up VRF by slug: {vrf_name}") + exit(1) + vrf_id = vrf.id + + return nb, site, vrf + +if __name__ == "__main__": + main() diff --git a/ansible/netbox/uv.lock b/ansible/netbox/uv.lock new file mode 100644 index 0000000..96a71dd --- /dev/null +++ b/ansible/netbox/uv.lock @@ -0,0 +1,129 @@ +version = 1 +revision = 2 +requires-python = ">=3.12" + +[[package]] +name = "certifi" +version = "2025.4.26" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/e8/9e/c05b3920a3b7d20d3d3310465f50348e5b3694f4f88c6daf736eef3024c4/certifi-2025.4.26.tar.gz", hash = "sha256:0a816057ea3cdefcef70270d2c515e4506bbc954f417fa5ade2021213bb8f0c6", size = 160705, upload-time = "2025-04-26T02:12:29.51Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/4a/7e/3db2bd1b1f9e95f7cddca6d6e75e2f2bd9f51b1246e546d88addca0106bd/certifi-2025.4.26-py3-none-any.whl", hash = "sha256:30350364dfe371162649852c63336a15c70c6510c2ad5015b21c2345311805f3", size = 159618, upload-time = "2025-04-26T02:12:27.662Z" }, +] + +[[package]] +name = "charset-normalizer" +version = "3.4.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/e4/33/89c2ced2b67d1c2a61c19c6751aa8902d46ce3dacb23600a283619f5a12d/charset_normalizer-3.4.2.tar.gz", hash = "sha256:5baececa9ecba31eff645232d59845c07aa030f0c81ee70184a90d35099a0e63", size = 126367, upload-time = "2025-05-02T08:34:42.01Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d7/a4/37f4d6035c89cac7930395a35cc0f1b872e652eaafb76a6075943754f095/charset_normalizer-3.4.2-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:0c29de6a1a95f24b9a1aa7aefd27d2487263f00dfd55a77719b530788f75cff7", size = 199936, upload-time = "2025-05-02T08:32:33.712Z" }, + { url = "https://files.pythonhosted.org/packages/ee/8a/1a5e33b73e0d9287274f899d967907cd0bf9c343e651755d9307e0dbf2b3/charset_normalizer-3.4.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cddf7bd982eaa998934a91f69d182aec997c6c468898efe6679af88283b498d3", size = 143790, upload-time = "2025-05-02T08:32:35.768Z" }, + { url = "https://files.pythonhosted.org/packages/66/52/59521f1d8e6ab1482164fa21409c5ef44da3e9f653c13ba71becdd98dec3/charset_normalizer-3.4.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:fcbe676a55d7445b22c10967bceaaf0ee69407fbe0ece4d032b6eb8d4565982a", size = 153924, upload-time = "2025-05-02T08:32:37.284Z" }, + { url = "https://files.pythonhosted.org/packages/86/2d/fb55fdf41964ec782febbf33cb64be480a6b8f16ded2dbe8db27a405c09f/charset_normalizer-3.4.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d41c4d287cfc69060fa91cae9683eacffad989f1a10811995fa309df656ec214", size = 146626, upload-time = "2025-05-02T08:32:38.803Z" }, + { url = "https://files.pythonhosted.org/packages/8c/73/6ede2ec59bce19b3edf4209d70004253ec5f4e319f9a2e3f2f15601ed5f7/charset_normalizer-3.4.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4e594135de17ab3866138f496755f302b72157d115086d100c3f19370839dd3a", size = 148567, upload-time = "2025-05-02T08:32:40.251Z" }, + { url = "https://files.pythonhosted.org/packages/09/14/957d03c6dc343c04904530b6bef4e5efae5ec7d7990a7cbb868e4595ee30/charset_normalizer-3.4.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:cf713fe9a71ef6fd5adf7a79670135081cd4431c2943864757f0fa3a65b1fafd", size = 150957, upload-time = "2025-05-02T08:32:41.705Z" }, + { url = "https://files.pythonhosted.org/packages/0d/c8/8174d0e5c10ccebdcb1b53cc959591c4c722a3ad92461a273e86b9f5a302/charset_normalizer-3.4.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:a370b3e078e418187da8c3674eddb9d983ec09445c99a3a263c2011993522981", size = 145408, upload-time = "2025-05-02T08:32:43.709Z" }, + { url = "https://files.pythonhosted.org/packages/58/aa/8904b84bc8084ac19dc52feb4f5952c6df03ffb460a887b42615ee1382e8/charset_normalizer-3.4.2-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:a955b438e62efdf7e0b7b52a64dc5c3396e2634baa62471768a64bc2adb73d5c", size = 153399, upload-time = "2025-05-02T08:32:46.197Z" }, + { url = "https://files.pythonhosted.org/packages/c2/26/89ee1f0e264d201cb65cf054aca6038c03b1a0c6b4ae998070392a3ce605/charset_normalizer-3.4.2-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:7222ffd5e4de8e57e03ce2cef95a4c43c98fcb72ad86909abdfc2c17d227fc1b", size = 156815, upload-time = "2025-05-02T08:32:48.105Z" }, + { url = "https://files.pythonhosted.org/packages/fd/07/68e95b4b345bad3dbbd3a8681737b4338ff2c9df29856a6d6d23ac4c73cb/charset_normalizer-3.4.2-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:bee093bf902e1d8fc0ac143c88902c3dfc8941f7ea1d6a8dd2bcb786d33db03d", size = 154537, upload-time = "2025-05-02T08:32:49.719Z" }, + { url = "https://files.pythonhosted.org/packages/77/1a/5eefc0ce04affb98af07bc05f3bac9094513c0e23b0562d64af46a06aae4/charset_normalizer-3.4.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:dedb8adb91d11846ee08bec4c8236c8549ac721c245678282dcb06b221aab59f", size = 149565, upload-time = "2025-05-02T08:32:51.404Z" }, + { url = "https://files.pythonhosted.org/packages/37/a0/2410e5e6032a174c95e0806b1a6585eb21e12f445ebe239fac441995226a/charset_normalizer-3.4.2-cp312-cp312-win32.whl", hash = "sha256:db4c7bf0e07fc3b7d89ac2a5880a6a8062056801b83ff56d8464b70f65482b6c", size = 98357, upload-time = "2025-05-02T08:32:53.079Z" }, + { url = "https://files.pythonhosted.org/packages/6c/4f/c02d5c493967af3eda9c771ad4d2bbc8df6f99ddbeb37ceea6e8716a32bc/charset_normalizer-3.4.2-cp312-cp312-win_amd64.whl", hash = "sha256:5a9979887252a82fefd3d3ed2a8e3b937a7a809f65dcb1e068b090e165bbe99e", size = 105776, upload-time = "2025-05-02T08:32:54.573Z" }, + { url = "https://files.pythonhosted.org/packages/ea/12/a93df3366ed32db1d907d7593a94f1fe6293903e3e92967bebd6950ed12c/charset_normalizer-3.4.2-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:926ca93accd5d36ccdabd803392ddc3e03e6d4cd1cf17deff3b989ab8e9dbcf0", size = 199622, upload-time = "2025-05-02T08:32:56.363Z" }, + { url = "https://files.pythonhosted.org/packages/04/93/bf204e6f344c39d9937d3c13c8cd5bbfc266472e51fc8c07cb7f64fcd2de/charset_normalizer-3.4.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:eba9904b0f38a143592d9fc0e19e2df0fa2e41c3c3745554761c5f6447eedabf", size = 143435, upload-time = "2025-05-02T08:32:58.551Z" }, + { url = "https://files.pythonhosted.org/packages/22/2a/ea8a2095b0bafa6c5b5a55ffdc2f924455233ee7b91c69b7edfcc9e02284/charset_normalizer-3.4.2-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3fddb7e2c84ac87ac3a947cb4e66d143ca5863ef48e4a5ecb83bd48619e4634e", size = 153653, upload-time = "2025-05-02T08:33:00.342Z" }, + { url = "https://files.pythonhosted.org/packages/b6/57/1b090ff183d13cef485dfbe272e2fe57622a76694061353c59da52c9a659/charset_normalizer-3.4.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:98f862da73774290f251b9df8d11161b6cf25b599a66baf087c1ffe340e9bfd1", size = 146231, upload-time = "2025-05-02T08:33:02.081Z" }, + { url = "https://files.pythonhosted.org/packages/e2/28/ffc026b26f441fc67bd21ab7f03b313ab3fe46714a14b516f931abe1a2d8/charset_normalizer-3.4.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c9379d65defcab82d07b2a9dfbfc2e95bc8fe0ebb1b176a3190230a3ef0e07c", size = 148243, upload-time = "2025-05-02T08:33:04.063Z" }, + { url = "https://files.pythonhosted.org/packages/c0/0f/9abe9bd191629c33e69e47c6ef45ef99773320e9ad8e9cb08b8ab4a8d4cb/charset_normalizer-3.4.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e635b87f01ebc977342e2697d05b56632f5f879a4f15955dfe8cef2448b51691", size = 150442, upload-time = "2025-05-02T08:33:06.418Z" }, + { url = "https://files.pythonhosted.org/packages/67/7c/a123bbcedca91d5916c056407f89a7f5e8fdfce12ba825d7d6b9954a1a3c/charset_normalizer-3.4.2-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:1c95a1e2902a8b722868587c0e1184ad5c55631de5afc0eb96bc4b0d738092c0", size = 145147, upload-time = "2025-05-02T08:33:08.183Z" }, + { url = "https://files.pythonhosted.org/packages/ec/fe/1ac556fa4899d967b83e9893788e86b6af4d83e4726511eaaad035e36595/charset_normalizer-3.4.2-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:ef8de666d6179b009dce7bcb2ad4c4a779f113f12caf8dc77f0162c29d20490b", size = 153057, upload-time = "2025-05-02T08:33:09.986Z" }, + { url = "https://files.pythonhosted.org/packages/2b/ff/acfc0b0a70b19e3e54febdd5301a98b72fa07635e56f24f60502e954c461/charset_normalizer-3.4.2-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:32fc0341d72e0f73f80acb0a2c94216bd704f4f0bce10aedea38f30502b271ff", size = 156454, upload-time = "2025-05-02T08:33:11.814Z" }, + { url = "https://files.pythonhosted.org/packages/92/08/95b458ce9c740d0645feb0e96cea1f5ec946ea9c580a94adfe0b617f3573/charset_normalizer-3.4.2-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:289200a18fa698949d2b39c671c2cc7a24d44096784e76614899a7ccf2574b7b", size = 154174, upload-time = "2025-05-02T08:33:13.707Z" }, + { url = "https://files.pythonhosted.org/packages/78/be/8392efc43487ac051eee6c36d5fbd63032d78f7728cb37aebcc98191f1ff/charset_normalizer-3.4.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:4a476b06fbcf359ad25d34a057b7219281286ae2477cc5ff5e3f70a246971148", size = 149166, upload-time = "2025-05-02T08:33:15.458Z" }, + { url = "https://files.pythonhosted.org/packages/44/96/392abd49b094d30b91d9fbda6a69519e95802250b777841cf3bda8fe136c/charset_normalizer-3.4.2-cp313-cp313-win32.whl", hash = "sha256:aaeeb6a479c7667fbe1099af9617c83aaca22182d6cf8c53966491a0f1b7ffb7", size = 98064, upload-time = "2025-05-02T08:33:17.06Z" }, + { url = "https://files.pythonhosted.org/packages/e9/b0/0200da600134e001d91851ddc797809e2fe0ea72de90e09bec5a2fbdaccb/charset_normalizer-3.4.2-cp313-cp313-win_amd64.whl", hash = "sha256:aa6af9e7d59f9c12b33ae4e9450619cf2488e2bbe9b44030905877f0b2324980", size = 105641, upload-time = "2025-05-02T08:33:18.753Z" }, + { url = "https://files.pythonhosted.org/packages/20/94/c5790835a017658cbfabd07f3bfb549140c3ac458cfc196323996b10095a/charset_normalizer-3.4.2-py3-none-any.whl", hash = "sha256:7f56930ab0abd1c45cd15be65cc741c28b1c9a34876ce8c17a2fa107810c0af0", size = 52626, upload-time = "2025-05-02T08:34:40.053Z" }, +] + +[[package]] +name = "idna" +version = "3.10" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/f1/70/7703c29685631f5a7590aa73f1f1d3fa9a380e654b86af429e0934a32f7d/idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9", size = 190490, upload-time = "2024-09-15T18:07:39.745Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/76/c6/c88e154df9c4e1a2a66ccf0005a88dfb2650c1dffb6f5ce603dfbd452ce3/idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3", size = 70442, upload-time = "2024-09-15T18:07:37.964Z" }, +] + +[[package]] +name = "netbox" +version = "0.1.0" +source = { virtual = "." } +dependencies = [ + { name = "pynetbox" }, + { name = "unifi-controller-api" }, +] + +[package.metadata] +requires-dist = [ + { name = "pynetbox" }, + { name = "unifi-controller-api" }, +] + +[[package]] +name = "packaging" +version = "25.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/a1/d4/1fc4078c65507b51b96ca8f8c3ba19e6a61c8253c72794544580a7b6c24d/packaging-25.0.tar.gz", hash = "sha256:d443872c98d677bf60f6a1f2f8c1cb748e8fe762d2bf9d3148b5599295b0fc4f", size = 165727, upload-time = "2025-04-19T11:48:59.673Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/20/12/38679034af332785aac8774540895e234f4d07f7545804097de4b666afd8/packaging-25.0-py3-none-any.whl", hash = "sha256:29572ef2b1f17581046b3a2227d5c611fb25ec70ca1ba8554b24b0e69331a484", size = 66469, upload-time = "2025-04-19T11:48:57.875Z" }, +] + +[[package]] +name = "pynetbox" +version = "7.5.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "packaging" }, + { name = "requests" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/d3/0b/695021a23c373991d07c1e4cb510287a521318cfc4b29f68ebbecb19fcd2/pynetbox-7.5.0.tar.gz", hash = "sha256:780064c800fb8c079c9828df472203146442ed3dd0b522a28a501204eb00c066", size = 73850, upload-time = "2025-05-20T16:03:03.831Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/44/b7/a24bc58f0e27f0cd847bf14ffbe9722604f5abe3ec9c12dd8f89cb965be8/pynetbox-7.5.0-py3-none-any.whl", hash = "sha256:ab755a0020c0abb09b4d24c8f8ba89df26f04fa56c35de73302e29a39352f031", size = 35808, upload-time = "2025-05-20T16:03:02.445Z" }, +] + +[[package]] +name = "requests" +version = "2.32.3" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "certifi" }, + { name = "charset-normalizer" }, + { name = "idna" }, + { name = "urllib3" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/63/70/2bf7780ad2d390a8d301ad0b550f1581eadbd9a20f896afe06353c2a2913/requests-2.32.3.tar.gz", hash = "sha256:55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760", size = 131218, upload-time = "2024-05-29T15:37:49.536Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/f9/9b/335f9764261e915ed497fcdeb11df5dfd6f7bf257d4a6a2a686d80da4d54/requests-2.32.3-py3-none-any.whl", hash = "sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6", size = 64928, upload-time = "2024-05-29T15:37:47.027Z" }, +] + +[[package]] +name = "unifi-controller-api" +version = "0.3.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "requests" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/a6/62/0e12da83245655872fed6fdfea66fa05b36b76dd31994a8dc17fafe164c8/unifi_controller_api-0.3.0.tar.gz", hash = "sha256:a5ebaf0e739b825921ed3b94c80b0113cad6e295539397653571ad2286c81287", size = 54194, upload-time = "2025-04-14T18:57:24.028Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/33/32/38c5483b2a8dc57d3d76c3dcffbe3a47b1dfc671753ee2b62bfb529683a6/unifi_controller_api-0.3.0-py3-none-any.whl", hash = "sha256:b312aab9b460ee5d5189d704b7855d03452bfe0649cc569d8ce20c4417c75d71", size = 59134, upload-time = "2025-04-14T18:57:22.674Z" }, +] + +[[package]] +name = "urllib3" +version = "2.4.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/8a/78/16493d9c386d8e60e442a35feac5e00f0913c0f4b7c217c11e8ec2ff53e0/urllib3-2.4.0.tar.gz", hash = "sha256:414bc6535b787febd7567804cc015fee39daab8ad86268f1310a9250697de466", size = 390672, upload-time = "2025-04-10T15:23:39.232Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/6b/11/cc635220681e93a0183390e26485430ca2c7b5f9d33b15c74c2861cb8091/urllib3-2.4.0-py3-none-any.whl", hash = "sha256:4e16665048960a0900c702d4a66415956a584919c03361cac9f1df5c5dd7e813", size = 128680, upload-time = "2025-04-10T15:23:37.377Z" }, +] diff --git a/ansible/plays/danneri.yml b/ansible/plays/danneri.yml index 2e960ee..6b4265a 100644 --- a/ansible/plays/danneri.yml +++ b/ansible/plays/danneri.yml @@ -12,3 +12,16 @@ - etckeeper - import_role: name: timezone + + - become: yes + tags: k3s + copy: + dest: /etc/rancher/k3s/config.yaml + content: | + tls-san: + - "danneri.dn42.trygvis.io" + - "{{ ipam6.networks.lhn2_dn42.hosts.danneri }}" + - "2a06:2240:f00d:b500:9422:d355:95b7:f170" + cluster-cidr: "{{ ipam6.networks.danneri_cluster.range }}" + service-cidr: "{{ ipam6.networks.danneri_service.range }}" + diff --git a/ansible/plays/files/danneri/systemd-networkd/enp1s0.network b/ansible/plays/files/danneri/systemd-networkd/enp1s0.network deleted file mode 100644 index 7e12c2e..0000000 --- a/ansible/plays/files/danneri/systemd-networkd/enp1s0.network +++ /dev/null @@ -1,6 +0,0 @@ -[Match] -Name=enp1s0 - -[Network] -DHCP=yes -IPv6AcceptRA=true diff --git a/ansible/plays/files/zigbee2mqtt/garasjepi/configuration.yaml b/ansible/plays/files/zigbee2mqtt/garasjepi/configuration.yaml new file mode 100644 index 0000000..b0b8f5a --- /dev/null +++ b/ansible/plays/files/zigbee2mqtt/garasjepi/configuration.yaml @@ -0,0 +1,43 @@ +homeassistant: + enabled: false +frontend: + enabled: true +mqtt: + base_topic: zigbee2mqtt + #server: mqtt://ha-kv24.dn42.trygvis.io + server: mqtt://192.168.10.159 + user: z2m + password: zigbee2mqtt + version: 5 +serial: + port: /dev/ttyACM0 + adapter: deconz +advanced: + network_key: + - 107 + - 142 + - 62 + - 67 + - 150 + - 226 + - 182 + - 69 + - 47 + - 194 + - 244 + - 95 + - 73 + - 125 + - 135 + - 61 + pan_id: 43701 + ext_pan_id: + - 181 + - 224 + - 197 + - 29 + - 98 + - 176 + - 205 + - 241 +version: 4
\ No newline at end of file diff --git a/ansible/plays/host-garasjepi.yml b/ansible/plays/host-garasjepi.yml new file mode 100644 index 0000000..62b0b3d --- /dev/null +++ b/ansible/plays/host-garasjepi.yml @@ -0,0 +1,28 @@ +- hosts: + - garasjepi + tasks: + # These first + - become: yes + apt: + name: + - etckeeper + - git + + - become: yes + apt: + name: + - tmux + - aptitude + +# - import_role: +# name: timezone +# +# - import_role: +# name: systemd-networkd + + - become: yes + apt: + name: + - docker.io + - tmux + - aptitude diff --git a/ansible/plays/host-hash.yml b/ansible/plays/host-hash.yml new file mode 100644 index 0000000..62b781f --- /dev/null +++ b/ansible/plays/host-hash.yml @@ -0,0 +1,10 @@ +- hosts: hash + tasks: + - become: yes + copy: + dest: /etc/docker/daemon.json + content: | + { + "ipv6": true, + "fixed-cidr-v6": "{{ ipam6.networks.hash_docker_dn42.range }}" + } diff --git a/ansible/plays/host-lhn2pi.yml b/ansible/plays/host-lhn2pi.yml new file mode 100644 index 0000000..551c3dd --- /dev/null +++ b/ansible/plays/host-lhn2pi.yml @@ -0,0 +1,6 @@ +- hosts: + - lhn2pi + roles: + - systemd-networkd + - prometheus-bird-exporter + - prometheus-node-exporter diff --git a/ansible/plays/host-unifi.yml b/ansible/plays/host-unifi.yml new file mode 100644 index 0000000..41fb292 --- /dev/null +++ b/ansible/plays/host-unifi.yml @@ -0,0 +1,18 @@ +- hosts: + - unifi + tasks: + - become: yes + apt: + name: + - etckeeper + + - import_role: + name: timezone + + - import_role: + name: systemd-networkd + + - become: yes + apt: + name: + - docker.io diff --git a/ansible/plays/ipam-generate-dns.yml b/ansible/plays/ipam-generate-dns.yml new file mode 100644 index 0000000..25f8087 --- /dev/null +++ b/ansible/plays/ipam-generate-dns.yml @@ -0,0 +1,34 @@ +- hosts: localhost + gather_facts: no + connection: local + vars_files: + - ../group_vars/all/ipam.yml + tasks: + - set_fact: + content: | + {% set hosts = [] %} + {% for nw_name, network in ipam6.networks.items() %} + {% for host, address in (network.hosts|default({})).items() %} + {{- hosts.append({'name': host, 'address': address}) -}} + {% endfor %} + {% endfor %} + # Generated from ansible data + {% for h in hosts|sort(attribute='name') %} + + resource "linode_domain_record" "dn42-{{ h.name }}" { + domain_id = linode_domain.root.id + name = "{{ h.name }}.dn42" + record_type = "AAAA" + target = "{{ h.address|ansible.utils.ipv6('address') }}" + } + {% endfor %} + - debug: + msg: "{{ content }}" + when: false + - name: Generating ../../terraform/dns/dn42.tf + register: tf + copy: + dest: ../../terraform/dns/dn42.tf + content: "{{ content }}" + - shell: terraform fmt ../../terraform/ipam6/ipam6.tf + when: "tf.changed" diff --git a/ansible/plays/ipam-generate-tf.yml b/ansible/plays/ipam-generate-tf.yml new file mode 100644 index 0000000..d9888b4 --- /dev/null +++ b/ansible/plays/ipam-generate-tf.yml @@ -0,0 +1,55 @@ +- hosts: localhost + gather_facts: no + connection: local + vars_files: + - ../group_vars/all/ipam.yml + collections: + - ansible.utils + tasks: + - name: Generate terraform/ipam6/ipam6.tf + register: tf + copy: + dest: ../../terraform/ipam6/ipam6.tf + content: | + output "networks" { + value = { + {% for name, network in ipam6.networks.items() %} + {% if not (network.range | ansible.utils.ipv6) %} + Invalid network: {{ network.range }} + {% endif %} + {{ name }} = { + {% if network.description|default("") %} + description = "{{ network.description }}" + {% endif %} + range = "{{ network.range }}" + address = "{{ network.range|ansible.utils.ipaddr("network") }}" + prefix = "{{ network.range|ansible.utils.ipaddr("prefix") }}" + {% set hosts = network.hosts|default({}) %} + hosts = { + {% for name, addr in hosts.items() %} + {{ name }} = { + address: "{{ addr|ansible.utils.ipaddr("address") }}" + prefix: "{{ addr|ansible.utils.ipaddr("prefix") }}" + } + {% endfor %} + } + } + {% endfor %} + } + } + + output "hosts" { + value = { + {% for name, network in ipam6.networks.items() %} + {% set hosts = network.hosts|default({}) %} + {% for name, addr in hosts.items() %} + {{ name }} = { + address: "{{ addr|ansible.utils.ipaddr("address") }}" + prefix: "{{ addr|ansible.utils.ipaddr("prefix") }}" + } + {% endfor %} + {% endfor %} + } + } + - shell: terraform fmt ../../terraform/ipam6/ipam6.tf + when: "tf.changed" diff --git a/ansible/plays/kjell-ct-102.yml b/ansible/plays/kjell-ct-102.yml new file mode 100644 index 0000000..87b9459 --- /dev/null +++ b/ansible/plays/kjell-ct-102.yml @@ -0,0 +1,49 @@ +- hosts: + - kjell-ct-102 + vars: + traefik_version: 3.4.1 + traefik_checksum: md5:f299230ea9f247a672b187a79f2e76e6719ccbee + traefik_template: traefik-proxy.toml.j2 + tasks: + - become: yes + apt: + name: + - etckeeper + - sudo + tags: packages,never + + - import_role: + name: timezone + tags: timezone,never + + - name: Load values from sops.yml + community.sops.load_vars: + name: env + file: ../../sops.yml + tags: traefik-server,never + + - import_role: + name: traefik-server + vars: + traefik_environment: + LINODE_TOKEN: "{{ env.linode_token }}" + tags: traefik-server,never + + - name: /etc/systemd/services/traefik.service + become: true + template: + src: "{{ traefik_template }}" + dest: /etc/traefik/traefik.toml + owner: root + group: root + mode: 0644 + register: template + + - name: systemctl restart traefik + become: true + systemd: + daemon_reload: true + unit: traefik + enabled: true + state: restarted + when: template.changed diff --git a/ansible/plays/lhn2pi.yml b/ansible/plays/lhn2pi.yml deleted file mode 100644 index 614b926..0000000 --- a/ansible/plays/lhn2pi.yml +++ /dev/null @@ -1,4 +0,0 @@ -- hosts: - - lhn2pi - roles: - - systemd-networkd diff --git a/ansible/plays/otelcol-contrib.yml b/ansible/plays/otelcol-contrib.yml new file mode 100644 index 0000000..f667337 --- /dev/null +++ b/ansible/plays/otelcol-contrib.yml @@ -0,0 +1,29 @@ +- hosts: + - coregonus + - hash + - knot + tasks: + + # otelcol-contrib.deb needs to be installed first + # adduser otelcol-contrib systemd-journal + + - name: /etc/otelcol-contrib/config.yaml + become: yes + template: + src: otelcol-contrib/config.yaml + dest: /etc/otelcol-contrib/config.yaml + notify: systemctl restart otelcol-contrib + + - name: mkdir /var/lib/otelcol/file_storage + become: yes + file: + path: /var/lib/otelcol/file_storage + owner: otelcol-contrib + notify: systemctl restart otelcol-contrib + + handlers: + - name: systemctl restart otelcol-contrib + become: yes + systemd: + service: otelcol-contrib + state: restarted diff --git a/ansible/plays/templates/danneri/systemd-networkd/enp1s0.network b/ansible/plays/templates/danneri/systemd-networkd/enp1s0.network index a4c84ee..b38116c 100644 --- a/ansible/plays/templates/danneri/systemd-networkd/enp1s0.network +++ b/ansible/plays/templates/danneri/systemd-networkd/enp1s0.network @@ -5,4 +5,4 @@ Name=enp1s0 DHCP=ipv4 [IPv6AcceptRA] -Token=static:{{ ipam6.networks.coregonus_dn42.hosts.danneri }} +Token=static:{{ ipam6.networks.lhn2_dn42.hosts.danneri }} diff --git a/ansible/plays/templates/lhn2pi/systemd/network/10-eth0.network b/ansible/plays/templates/lhn2pi/systemd/network/10-eth0.network index f17b3f9..853556d 100644 --- a/ansible/plays/templates/lhn2pi/systemd/network/10-eth0.network +++ b/ansible/plays/templates/lhn2pi/systemd/network/10-eth0.network @@ -5,3 +5,7 @@ Name=eth0 DHCP=ipv4 Address={{ ipam6.networks.lhn2_dn42.hosts.lhn2pi }} # IPv6Forwarding=yes # needs newer systemd + +# Disables the automatic activation of DHCPv6 from RA packets +[IPv6AcceptRA] +DHCPv6Client=no diff --git a/ansible/plays/templates/otelcol-contrib/config.yaml b/ansible/plays/templates/otelcol-contrib/config.yaml new file mode 100644 index 0000000..671dbaa --- /dev/null +++ b/ansible/plays/templates/otelcol-contrib/config.yaml @@ -0,0 +1,65 @@ +receivers: + journald: + priority: debug + +exporters: + debug: + verbosity: detailed + + nop: + + otlphttp/hash: + endpoint: https://loki.trygvis.io/otlp + +extensions: + file_storage/journald: + +processors: + batch: {} + + transform/severity_parse: + log_statements: + - context: log + statements: + - set(resource.attributes["service.namespace"], "systemd") + - set(resource.attributes["service.name"], body["_SYSTEMD_UNIT"]) + - set(resource.attributes["systemd_unit"], body["_SYSTEMD_UNIT"]) + - set(resource.attributes["systemd_slice"], body["_SYSTEMD_SLICE"]) + - set(resource.attributes["node"], body["_HOSTNAME"]) + + - set(severity_number, SEVERITY_NUMBER_TRACE) where body["PRIORITY"] == "7" + - set(severity_text, "debug") where body["PRIORITY"] == "7" + - set(severity_number, SEVERITY_NUMBER_DEBUG) where body["PRIORITY"] == "6" + - set(severity_text, "info") where body["PRIORITY"] == "6" + - set(severity_number, SEVERITY_NUMBER_INFO) where body["PRIORITY"] == "5" + - set(severity_text, "notice") where body["PRIORITY"] == "5" + - set(severity_number, SEVERITY_NUMBER_WARN) where body["PRIORITY"] == "4" + - set(severity_text, "warning") where body["PRIORITY"] == "4" + - set(severity_number, SEVERITY_NUMBER_ERROR) where body["PRIORITY"] == "3" + - set(severity_text, "err") where body["PRIORITY"] == "3" + - set(severity_number, SEVERITY_NUMBER_FATAL) where body["PRIORITY"] == "2" + - set(severity_text, "crit") where body["PRIORITY"] == "2" + - set(severity_number, SEVERITY_NUMBER_FATAL) where body["PRIORITY"] == "1" + - set(severity_text, "alert") where body["PRIORITY"] == "1" + - set(severity_number, SEVERITY_NUMBER_FATAL) where body["PRIORITY"] == "0" + - set(severity_text, "emerg") where body["PRIORITY"] == "0" + + - set(body, body["MESSAGE"]) + +service: +# telemetry: +# logs: +# level: debug + extensions: + - file_storage/journald + pipelines: + logs: + receivers: + - journald + processors: + - transform/severity_parse + - batch + exporters: +# - debug +# - nop + - otlphttp/hash diff --git a/ansible/plays/templates/traefik-proxy.toml.j2 b/ansible/plays/templates/traefik-proxy.toml.j2 new file mode 100644 index 0000000..d538664 --- /dev/null +++ b/ansible/plays/templates/traefik-proxy.toml.j2 @@ -0,0 +1,126 @@ +[global] + checkNewVersion = true + sendAnonymousUsage = false + +################################################################ +# Entrypoints configuration +################################################################ + +[entryPoints] +# [entryPoints.web] +# address = ":80" + + [entryPoints.websecure] + address = ":443" + + [entryPoints.websecure.http.tls] + certResolver = "linode" + +[log] + + # Log level + # + # Optional + # Default: "ERROR" + # + level = "DEBUG" + + # Sets the filepath for the traefik log. If not specified, stdout will be used. + # Intermediate directories are created if necessary. + # + # Optional + # Default: os.Stdout + # + # filePath = "log/traefik.log" + + # Format is either "json" or "common". + # + # Optional + # Default: "common" + # + # format = "json" + +################################################################ +# Access logs configuration +################################################################ + +# Enable access logs +# By default it will write to stdout and produce logs in the textual +# Common Log Format (CLF), extended with additional fields. +# +# Optional +# +# [accessLog] + + # Sets the file path for the access log. If not specified, stdout will be used. + # Intermediate directories are created if necessary. + # + # Optional + # Default: os.Stdout + # + # filePath = "/path/to/log/log.txt" + + # Format is either "json" or "common". + # + # Optional + # Default: "common" + # + # format = "json" + +################################################################ +# API and dashboard configuration +################################################################ + +# Enable API and dashboard +[api] + + # Enable the API in insecure mode + # + # Optional + # Default: false + # + # insecure = true + + # Enabled Dashboard + # + # Optional + # Default: true + # + # dashboard = false + +################################################################ +# Ping configuration +################################################################ + +# Enable ping +[ping] + + # Name of the related entry point + # + # Optional + # Default: "traefik" + # + # entryPoint = "traefik" + + +[certificatesResolvers.linode.acme] + email = "root@trygvis.io" + storage = "acme.json" + [certificatesResolvers.linode.acme.dnsChallenge] + provider = "linode" + delayBeforeCheck = 1 + +[http] +[http.routers] + [http.routers.junk] + rule = "Host(`junk.dn42.trygvis.io`)" + service = "netbox" + + [http.routers.junk.tls] + certResolver = "linode" + + [http.services] + # Define how to reach an existing service on our infrastructure + [http.services.netbox.loadBalancer] + [[http.services.netbox.loadBalancer.servers]] + url = "http://[fdb1:4242:3538:2005:be24:11ff:febb:5c7f]:8080" diff --git a/ansible/plays/templates/unifi/systemd-networkd/enp1s0.network b/ansible/plays/templates/unifi/systemd-networkd/enp1s0.network new file mode 100644 index 0000000..251bf45 --- /dev/null +++ b/ansible/plays/templates/unifi/systemd-networkd/enp1s0.network @@ -0,0 +1,8 @@ +[Match] +Name=enp1s0 + +[Network] +DHCP=ipv4 + +[IPv6AcceptRA] +Token=static:{{ ipam6.networks.lhn2_dn42.hosts.unifi }} diff --git a/ansible/plays/zigbee2mqtt-backup.yml b/ansible/plays/zigbee2mqtt-backup.yml new file mode 100644 index 0000000..331045b --- /dev/null +++ b/ansible/plays/zigbee2mqtt-backup.yml @@ -0,0 +1,13 @@ +- hosts: + - zigbee2mqtt + tasks: + - become: yes + register: config + shell: + cmd: | + mp=$(docker volume inspect zigbee2mqtt --format '{{"{{.Mountpoint}}"}}') + cat $mp/configuration.yaml + - copy: + content: "{{ config.stdout }}" + dest: files/zigbee2mqtt/{{ ansible_hostname }}/configuration.yaml + delegate_to: localhost diff --git a/ansible/roles/prometheus-bird-exporter/handlers/main.yml b/ansible/roles/prometheus-bird-exporter/handlers/main.yml new file mode 100644 index 0000000..f4f9381 --- /dev/null +++ b/ansible/roles/prometheus-bird-exporter/handlers/main.yml @@ -0,0 +1,5 @@ +- name: restart + become: yes + systemd: + name: prometheus-bird-exporter + state: restarted diff --git a/ansible/roles/prometheus-bird-exporter/tasks/main.yml b/ansible/roles/prometheus-bird-exporter/tasks/main.yml new file mode 100644 index 0000000..6d8b999 --- /dev/null +++ b/ansible/roles/prometheus-bird-exporter/tasks/main.yml @@ -0,0 +1,18 @@ +- become: yes + package: + name: "{{ items }}" + state: present + vars: + items: + - prometheus-bird-exporter +- name: /etc/default/prometheus-bird-exporter + become: yes + copy: + dest: /etc/default/prometheus-bird-exporter + content: | + # Set the command-line arguments to pass to the server. + # Due to shell escaping, to pass backslashes for regexes, you need to double + # them (\\d for \d). If running under systemd, you need to double them again + # (\\\\d to mean \d), and escape newlines too. + ARGS="-bird.v2 -format.new" + notify: restart diff --git a/ansible/roles/prometheus-node-exporter/handlers/main.yml b/ansible/roles/prometheus-node-exporter/handlers/main.yml new file mode 100644 index 0000000..f4f9381 --- /dev/null +++ b/ansible/roles/prometheus-node-exporter/handlers/main.yml @@ -0,0 +1,5 @@ +- name: restart + become: yes + systemd: + name: prometheus-bird-exporter + state: restarted diff --git a/ansible/roles/prometheus-node-exporter/tasks/main.yml b/ansible/roles/prometheus-node-exporter/tasks/main.yml new file mode 100644 index 0000000..e7c6d18 --- /dev/null +++ b/ansible/roles/prometheus-node-exporter/tasks/main.yml @@ -0,0 +1,18 @@ +- become: yes + package: + name: "{{ items }}" + state: present + vars: + items: + - prometheus-node-exporter +- name: /etc/default/prometheus-node-exporter + become: yes + copy: + dest: /etc/default/prometheus-node-exporter + content: | + # Set the command-line arguments to pass to the server. + # Due to shell escaping, to pass backslashes for regexes, you need to double + # them (\\d for \d). If running under systemd, you need to double them again + # (\\\\d to mean \d), and escape newlines too. + ARGS="" + notify: restart diff --git a/ansible/roles/superusers/tasks/main.yml b/ansible/roles/superusers/tasks/main.yml index c1f5a47..12672ec 100644 --- a/ansible/roles/superusers/tasks/main.yml +++ b/ansible/roles/superusers/tasks/main.yml @@ -16,7 +16,7 @@ unix_groups: - sudo - systemd-journal - with_items: "{{ unix_groups }}" + with_items: "{{ unix_groups + (['docker'] if 'docker' in getent_group else []) }}" loop_control: loop_var: group include_tasks: adjust-group.yml diff --git a/ansible/roles/traefik-server/handlers/main.yml b/ansible/roles/traefik-server/handlers/main.yml new file mode 100644 index 0000000..6e34db4 --- /dev/null +++ b/ansible/roles/traefik-server/handlers/main.yml @@ -0,0 +1,5 @@ +- name: systemctl restart traefik + systemd: + daemon_reload: true + unit: traefik + state: restarted diff --git a/ansible/roles/traefik-server/tasks/main.yml b/ansible/roles/traefik-server/tasks/main.yml new file mode 100644 index 0000000..98d45e5 --- /dev/null +++ b/ansible/roles/traefik-server/tasks/main.yml @@ -0,0 +1,56 @@ +- name: Download traefik + become: true + ansible.builtin.get_url: + url: https://github.com/traefik/traefik/releases/download/v{{ traefik_version }}/traefik_v{{ traefik_version }}_linux_amd64.tar.gz + dest: /tmp/traefik-{{ traefik_version }}.tar.gz + checksum: "{{ traefik_download|default('') }}" + register: download + +- name: Download checksum + debug: + msg: download.checksum_src={{ download.checksum_src }} + when: download.status_code == 200 + +- name: mkdir /tmp/traefik-x.y.z + become: true + file: + path: /tmp/traefik-{{ traefik_version }} + state: directory + +- name: Extract traefik + become: true + unarchive: + remote_src: true + src: /tmp/traefik-{{ traefik_version }}.tar.gz + dest: /tmp/traefik-{{ traefik_version }} + +- name: Install traefik + become: true + copy: + remote_src: true + src: /tmp/traefik-{{ traefik_version }}/traefik + dest: /usr/local/bin/traefik + owner: root + group: root + mode: 0750 + +- name: /etc/systemd/services/traefik.service + become: true + template: + src: traefik.service.j2 + dest: /etc/systemd/system/traefik.service + owner: root + group: root + mode: 0644 + +- name: mkdir /etc/traefik + become: true + file: + path: /etc/traefik + state: directory + +- name: mkdir /etc/traefik/acme + become: true + file: + path: /etc/traefik/acme + state: directory diff --git a/ansible/roles/traefik-server/templates/traefik.service.j2 b/ansible/roles/traefik-server/templates/traefik.service.j2 new file mode 100644 index 0000000..14bc403 --- /dev/null +++ b/ansible/roles/traefik-server/templates/traefik.service.j2 @@ -0,0 +1,52 @@ +[Unit] +Description=traefik proxy +After=network-online.target +Wants=network-online.target systemd-networkd-wait-online.service + +AssertFileIsExecutable=/usr/local/bin/traefik +AssertPathExists=/etc/traefik/traefik.toml + +[Service] +Restart=on-abnormal + +#User=traefik +#Group=traefik + +; Always set "-root" to something safe in case it gets forgotten in the traefikfile. +ExecStart=/usr/local/bin/traefik --configfile=/etc/traefik/traefik.toml + +; Limit the number of file descriptors; see `man systemd.exec` for more limit settings. +LimitNOFILE=1048576 + +; Use private /tmp and /var/tmp, which are discarded after traefik stops. +PrivateTmp=true + +; Use a minimal /dev (May bring additional security if switched to 'true') +PrivateDevices=true + +; Hide /home, /root, and /run/user. Nobody will steal your SSH-keys. +ProtectHome=true + +; Make /usr, /boot, /etc and possibly some more folders read-only. +ProtectSystem=full + +; ... except /etc/ssl/traefik, because we want Letsencrypt-certificates there. +; This merely retains r/w access rights, it does not add any new. Must still be writable on the host! +#ReadWriteDirectories=/etc/traefik/acme + +; The following additional security directives only work with systemd v229 or later. +; They further restrict privileges that can be gained by traefik. Uncomment if you like. +; Note that you may have to add capabilities required by any plugins in use. +CapabilityBoundingSet=CAP_NET_BIND_SERVICE +AmbientCapabilities=CAP_NET_BIND_SERVICE +NoNewPrivileges=true +{% set env=traefik_environment.items()|default({}) %} +{% if env %} + +{% for k, v in env %} +Environment="{{ k }}={{ v }}" +{% endfor %} +{% endif %} + +[Install] +WantedBy=multi-user.target diff --git a/ansible/roles/unifi/handlers/main.yml b/ansible/roles/unifi/handlers/main.yml deleted file mode 100644 index ce78323..0000000 --- a/ansible/roles/unifi/handlers/main.yml +++ /dev/null @@ -1,3 +0,0 @@ -- name: update apt cache - apt: - update_cache: yes diff --git a/ansible/roles/unifi/tasks/main.yml b/ansible/roles/unifi/tasks/main.yml deleted file mode 100644 index 11c4c00..0000000 --- a/ansible/roles/unifi/tasks/main.yml +++ /dev/null @@ -1,23 +0,0 @@ ---- -- name: Ubiquiti APT key - notify: update apt cache - apt_key: - id: 06E85760C0A52C50 - keyserver: keyserver.ubuntu.com - -- name: Ubiquiti APT repository - notify: update apt cache - copy: - dest: /etc/apt/sources.list.d/unifi.list - content: 'deb http://www.ubnt.com/downloads/unifi/debian stable ubiquiti' - -- meta: flush_handlers - -- name: packages - apt: - name: "{{ items }}" - install_recommends: no - vars: - items: - - openjdk-8-jre - - unifi diff --git a/ansible/unifi.yml b/ansible/unifi.yml deleted file mode 100644 index d417a2a..0000000 --- a/ansible/unifi.yml +++ /dev/null @@ -1,6 +0,0 @@ -- hosts: - - unifi - roles: - - role: unifi - tags: unifi - become: yes diff --git a/ansible/zigbee2mqtt.yml b/ansible/zigbee2mqtt.yml new file mode 100644 index 0000000..3e8e55c --- /dev/null +++ b/ansible/zigbee2mqtt.yml @@ -0,0 +1,7 @@ +- hosts: + - zigbee2mqtt + roles: + - role: docker + tags: docker + become: yes + @@ -2,7 +2,7 @@ set -euo pipefail -v="0.14.0" +v="0.14.1" basedir="${0%/*}" self="${0##*/}" @@ -18,6 +18,4 @@ then curl -L "$url" | tar xfz - -C $dir fi -export ASDF_DATA_DIR="$dir/asdf-data" - exec "$bin" "${@}" diff --git a/bin/requirements.txt b/bin/requirements.txt index 26faaf7..b47e2cd 100644 --- a/bin/requirements.txt +++ b/bin/requirements.txt @@ -1,2 +1,5 @@ -ansible==10.3.0 +ansible==10.4.0 gns3fy==0.8.0 +netaddr==1.3.0 +swiplserver==1.0.2 +jinja2<3.1 diff --git a/bin/terraform b/bin/terraform index d90a3d8..e1a4dfc 100755 --- a/bin/terraform +++ b/bin/terraform @@ -2,7 +2,7 @@ set -euo pipefail -version=1.3.6 +version=1.9.5 basedir="${0%/*}" diff --git a/config/backup-kv24ix b/config/backup-kv24ix new file mode 100755 index 0000000..1abcc44 --- /dev/null +++ b/config/backup-kv24ix @@ -0,0 +1,13 @@ +#!/bin/bash + +set -euo pipefail + +basedir="${0%/*}" + +cd "$basedir" + +ssh ubnt@kv24ix.trygvis.io \ + /opt/vyatta/bin/vyatta-op-cmd-wrapper show configuration commands \ + > kv24ix.txt.new + +mv kv24ix.txt.new kv24ix.txt diff --git a/config/kv24ix.txt b/config/kv24ix.txt new file mode 100644 index 0000000..a29716b --- /dev/null +++ b/config/kv24ix.txt @@ -0,0 +1,193 @@ +set firewall all-ping enable +set firewall broadcast-ping disable +set firewall ipv6-name WANv6_IN default-action drop +set firewall ipv6-name WANv6_IN description 'WAN inbound traffic forwarded to LAN' +set firewall ipv6-name WANv6_IN enable-default-log +set firewall ipv6-name WANv6_IN rule 10 action accept +set firewall ipv6-name WANv6_IN rule 10 description 'Allow established/related sessions' +set firewall ipv6-name WANv6_IN rule 10 state established enable +set firewall ipv6-name WANv6_IN rule 10 state related enable +set firewall ipv6-name WANv6_IN rule 20 action drop +set firewall ipv6-name WANv6_IN rule 20 description 'Drop invalid state' +set firewall ipv6-name WANv6_IN rule 20 state invalid enable +set firewall ipv6-name WANv6_LOCAL default-action drop +set firewall ipv6-name WANv6_LOCAL description 'WAN inbound traffic to the router' +set firewall ipv6-name WANv6_LOCAL enable-default-log +set firewall ipv6-name WANv6_LOCAL rule 10 action accept +set firewall ipv6-name WANv6_LOCAL rule 10 description 'Allow established/related sessions' +set firewall ipv6-name WANv6_LOCAL rule 10 state established enable +set firewall ipv6-name WANv6_LOCAL rule 10 state related enable +set firewall ipv6-name WANv6_LOCAL rule 20 action drop +set firewall ipv6-name WANv6_LOCAL rule 20 description 'Drop invalid state' +set firewall ipv6-name WANv6_LOCAL rule 20 state invalid enable +set firewall ipv6-name WANv6_LOCAL rule 30 action accept +set firewall ipv6-name WANv6_LOCAL rule 30 description 'Allow IPv6 icmp' +set firewall ipv6-name WANv6_LOCAL rule 30 protocol ipv6-icmp +set firewall ipv6-name WANv6_LOCAL rule 40 action accept +set firewall ipv6-name WANv6_LOCAL rule 40 description 'allow dhcpv6' +set firewall ipv6-name WANv6_LOCAL rule 40 destination port 546 +set firewall ipv6-name WANv6_LOCAL rule 40 protocol udp +set firewall ipv6-name WANv6_LOCAL rule 40 source port 547 +set firewall ipv6-receive-redirects disable +set firewall ipv6-src-route disable +set firewall ip-src-route disable +set firewall log-martians enable +set firewall name WAN_IN default-action drop +set firewall name WAN_IN description 'WAN to internal' +set firewall name WAN_IN rule 10 action accept +set firewall name WAN_IN rule 10 description 'Allow established/related' +set firewall name WAN_IN rule 10 state established enable +set firewall name WAN_IN rule 10 state related enable +set firewall name WAN_IN rule 20 action drop +set firewall name WAN_IN rule 20 description 'Drop invalid state' +set firewall name WAN_IN rule 20 state invalid enable +set firewall name WAN_LOCAL default-action drop +set firewall name WAN_LOCAL description 'WAN to router' +set firewall name WAN_LOCAL rule 10 action accept +set firewall name WAN_LOCAL rule 10 description 'Allow established/related' +set firewall name WAN_LOCAL rule 10 state established enable +set firewall name WAN_LOCAL rule 10 state related enable +set firewall name WAN_LOCAL rule 20 action drop +set firewall name WAN_LOCAL rule 20 description 'Drop invalid state' +set firewall name WAN_LOCAL rule 20 state invalid enable +set firewall name WAN_LOCAL rule 30 action accept +set firewall name WAN_LOCAL rule 30 description 'Allow ICMP' +set firewall name WAN_LOCAL rule 30 log disable +set firewall name WAN_LOCAL rule 30 protocol icmp +set firewall receive-redirects disable +set firewall send-redirects enable +set firewall source-validation disable +set firewall syn-cookies enable +set interfaces ethernet eth0 address dhcp +set interfaces ethernet eth0 description Internet +set interfaces ethernet eth0 dhcpv6-pd pd 1 interface switch0 host-address '::1' +set interfaces ethernet eth0 dhcpv6-pd pd 1 interface switch0 prefix-id ':1' +set interfaces ethernet eth0 dhcpv6-pd pd 1 interface switch0 service slaac +set interfaces ethernet eth0 dhcpv6-pd pd 1 prefix-length /56 +set interfaces ethernet eth0 dhcpv6-pd rapid-commit enable +set interfaces ethernet eth0 duplex auto +set interfaces ethernet eth0 firewall in ipv6-name WANv6_IN +set interfaces ethernet eth0 firewall in name WAN_IN +set interfaces ethernet eth0 firewall local ipv6-name WANv6_LOCAL +set interfaces ethernet eth0 firewall local name WAN_LOCAL +set interfaces ethernet eth0 speed auto +set interfaces ethernet eth1 description Local +set interfaces ethernet eth1 duplex auto +set interfaces ethernet eth1 speed auto +set interfaces ethernet eth2 description Local +set interfaces ethernet eth2 duplex auto +set interfaces ethernet eth2 speed auto +set interfaces ethernet eth3 description Local +set interfaces ethernet eth3 duplex auto +set interfaces ethernet eth3 speed auto +set interfaces ethernet eth4 description Local +set interfaces ethernet eth4 duplex auto +set interfaces ethernet eth4 mtu 1500 +set interfaces ethernet eth4 poe output off +set interfaces ethernet eth4 speed auto +set interfaces loopback lo +set interfaces switch switch0 address 192.168.10.1/24 +set interfaces switch switch0 description Local +set interfaces switch switch0 firewall in +set interfaces switch switch0 ipv6 address +set interfaces switch switch0 ipv6 dup-addr-detect-transmits 1 +set interfaces switch switch0 mtu 1500 +set interfaces switch switch0 switch-port interface eth1 +set interfaces switch switch0 switch-port interface eth2 +set interfaces switch switch0 switch-port interface eth3 +set interfaces switch switch0 switch-port interface eth4 +set interfaces switch switch0 switch-port vlan-aware disable +set interfaces wireguard wg0 address 'fdf3:aad9:a885:0b3a::16/64' +set interfaces wireguard wg0 mtu 1420 +set interfaces wireguard wg0 peer cuUgTdFH1UEXpUH6V1nashdH7K/L+pl6dmJCpBWN+Xw= allowed-ips '::0/0' +set interfaces wireguard wg0 peer cuUgTdFH1UEXpUH6V1nashdH7K/L+pl6dmJCpBWN+Xw= endpoint 'trygvis.io:51821' +set interfaces wireguard wg0 peer cuUgTdFH1UEXpUH6V1nashdH7K/L+pl6dmJCpBWN+Xw= persistent-keepalive 60 +set interfaces wireguard wg0 private-key /config/auth/wg0.key +set interfaces wireguard wg0 route-allowed-ips false +set interfaces wireguard wg1 address 'fe80:fef1:078a:5b64:efd3:ae7b:d286:d7cf/64' +set interfaces wireguard wg1 description tnet-knot +set interfaces wireguard wg1 mtu 1420 +set interfaces wireguard wg1 peer eF8DIAyneOlhEzyriFB528IUsnYqy/b5398i0SW06g4= allowed-ips '::/0' +set interfaces wireguard wg1 peer eF8DIAyneOlhEzyriFB528IUsnYqy/b5398i0SW06g4= endpoint 'knot.inamo.no:51003' +set interfaces wireguard wg1 peer eF8DIAyneOlhEzyriFB528IUsnYqy/b5398i0SW06g4= persistent-keepalive 60 +set interfaces wireguard wg1 private-key /config/auth/knot.key +set interfaces wireguard wg1 route-allowed-ips false +set interfaces wireguard wg2 description route64.org +set interfaces wireguard wg2 mtu 1420 +set interfaces wireguard wg2 peer ztZNKsJH/CKQjYz9kUOtcIyKakqaNoNuVPZL8nlDxgM= endpoint '118.91.187.67:46010' +set interfaces wireguard wg2 peer ztZNKsJH/CKQjYz9kUOtcIyKakqaNoNuVPZL8nlDxgM= persistent-keepalive 30 +set interfaces wireguard wg2 private-key /config/auth/route64.key +set interfaces wireguard wg2 route-allowed-ips false +set policy prefix-list6 bitraf-dn42 rule 1 action permit +set policy prefix-list6 bitraf-dn42 rule 1 le 128 +set policy prefix-list6 bitraf-dn42 rule 1 prefix 'fdb1:4242:3538::/48' +set policy route-map knot rule 1 action permit +set policy route-map knot rule 1 match ipv6 address prefix-list bitraf-dn42 +set policy route-map knot rule 1 set ipv6-next-hop global 'fe80:fef1:78a:5b64:efd3:ae7b:d286:d7ce' +set policy route-map knot rule 1 set ipv6-next-hop local 'fe80:fef1:78a:5b64:efd3:ae7b:d286:d7ce' +set protocols bgp 4242423538 address-family ipv6-unicast network 'fdb1:4242:3538:2006::/64' route-map knot +set protocols bgp 4242423538 neighbor 'fe80:fef1:78a:5b64:efd3:ae7b:d286:d7ce' address-family ipv6-unicast capability graceful-restart +set protocols bgp 4242423538 neighbor 'fe80:fef1:78a:5b64:efd3:ae7b:d286:d7ce' address-family ipv6-unicast route-map export knot +set protocols bgp 4242423538 neighbor 'fe80:fef1:78a:5b64:efd3:ae7b:d286:d7ce' address-family ipv6-unicast soft-reconfiguration inbound +set protocols bgp 4242423538 neighbor 'fe80:fef1:78a:5b64:efd3:ae7b:d286:d7ce' nexthop-self +set protocols bgp 4242423538 neighbor 'fe80:fef1:78a:5b64:efd3:ae7b:d286:d7ce' password trygvis +set protocols bgp 4242423538 neighbor 'fe80:fef1:78a:5b64:efd3:ae7b:d286:d7ce' remote-as 4242423538 +set protocols bgp 4242423538 parameters +set service dhcp-server disabled false +set service dhcp-server hostfile-update disable +set service dhcp-server shared-network-name LAN authoritative enable +set service dhcp-server shared-network-name LAN subnet 192.168.10.0/24 default-router 192.168.10.1 +set service dhcp-server shared-network-name LAN subnet 192.168.10.0/24 dns-server 192.168.10.1 +set service dhcp-server shared-network-name LAN subnet 192.168.10.0/24 dns-server 8.8.8.8 +set service dhcp-server shared-network-name LAN subnet 192.168.10.0/24 lease 86400 +set service dhcp-server shared-network-name LAN subnet 192.168.10.0/24 start 192.168.10.100 stop 192.168.10.199 +set service dhcp-server shared-network-name LAN subnet 192.168.10.0/24 static-mapping garasje ip-address 192.168.10.23 +set service dhcp-server shared-network-name LAN subnet 192.168.10.0/24 static-mapping garasje mac-address 'b4:fb:e4:76:3c:58' +set service dhcp-server shared-network-name LAN subnet 192.168.10.0/24 static-mapping kjokken ip-address 192.168.10.21 +set service dhcp-server shared-network-name LAN subnet 192.168.10.0/24 static-mapping kjokken mac-address 'b4:fb:e4:76:3b:2b' +set service dhcp-server shared-network-name LAN subnet 192.168.10.0/24 static-mapping kontor ip-address 192.168.10.22 +set service dhcp-server shared-network-name LAN subnet 192.168.10.0/24 static-mapping kontor mac-address 'b4:fb:e4:76:3b:1c' +set service dhcp-server shared-network-name LAN subnet 192.168.10.0/24 static-mapping laboratorium ip-address 192.168.10.26 +set service dhcp-server shared-network-name LAN subnet 192.168.10.0/24 static-mapping laboratorium mac-address 'd8:b3:70:b3:35:19' +set service dhcp-server shared-network-name LAN subnet 192.168.10.0/24 static-mapping nede ip-address 192.168.10.25 +set service dhcp-server shared-network-name LAN subnet 192.168.10.0/24 static-mapping nede mac-address 'b4:fb:e4:76:3b:1b' +set service dhcp-server shared-network-name LAN subnet 192.168.10.0/24 static-mapping stue ip-address 192.168.10.20 +set service dhcp-server shared-network-name LAN subnet 192.168.10.0/24 static-mapping stue mac-address 'b4:fb:e4:76:3b:08' +set service dhcp-server shared-network-name LAN subnet 192.168.10.0/24 static-mapping swcloud ip-address 192.168.10.12 +set service dhcp-server shared-network-name LAN subnet 192.168.10.0/24 static-mapping swcloud mac-address '18:e8:29:43:73:02' +set service dhcp-server shared-network-name LAN subnet 192.168.10.0/24 static-mapping swnede ip-address 192.168.10.11 +set service dhcp-server shared-network-name LAN subnet 192.168.10.0/24 static-mapping swnede mac-address '18:e8:29:bf:9d:da' +set service dhcp-server shared-network-name LAN subnet 192.168.10.0/24 static-mapping swoppe ip-address 192.168.10.10 +set service dhcp-server shared-network-name LAN subnet 192.168.10.0/24 static-mapping swoppe mac-address 'b4:fb:e4:8a:24:a6' +set service dhcp-server static-arp disable +set service dhcp-server use-dnsmasq disable +set service dns forwarding cache-size 150 +set service dns forwarding listen-on switch0 +set service gui http-port 80 +set service gui https-port 443 +set service gui older-ciphers enable +set service lldp interface switch0 +set service nat rule 5010 description 'masquerade for WAN' +set service nat rule 5010 outbound-interface eth0 +set service nat rule 5010 type masquerade +set service snmp community public authorization ro +set service snmp location kv24ix +set service ssh port 22 +set service ssh protocol-version v2 +set service unms disable +set system analytics-handler send-analytics-report false +set system config-management commit-revisions 10 +set system crash-handler send-crash-report false +set system host-name kv24ix +set system login user ubnt authentication encrypted-password '$5$YmwMYrjdnUz2i//n$.dj42FJRGmiS6l/YLkrAG6GW3l3/hX6ARCWpsvG7WC4' +set system login user ubnt authentication plaintext-password '' +set system login user ubnt authentication public-keys trygvis@biwia key AAAAC3NzaC1lZDI1NTE5AAAAIK3NIIYprtLQFNut7GGf0va7YYFeSXKSgWDQi4qbf5Ph +set system login user ubnt authentication public-keys trygvis@biwia type ssh-ed25519 +set system login user ubnt level admin +set system ntp server 0.ubnt.pool.ntp.org +set system ntp server 1.ubnt.pool.ntp.org +set system ntp server 2.ubnt.pool.ntp.org +set system ntp server 3.ubnt.pool.ntp.org +set system syslog global facility all level notice +set system syslog global facility protocols level debug +set system time-zone Europe/Oslo diff --git a/danneri/README.md b/danneri/README.md new file mode 100644 index 0000000..26a9e85 --- /dev/null +++ b/danneri/README.md @@ -0,0 +1,60 @@ +# Installing k3s + +Create `/etc/rancher/k3s/config.yaml`. Must be done before installation. + +Run: `curl -sfL https://get.k3s.io | bash` + +Copy /etc/rancher/k3s/k3s.yaml to ~/.kube/config. Adjust `server:` url. + +Reinstalling: + + k3s-uninstall.sh + +Reboot + + cd /etc + git restore rancher/k3s/config.yaml + cd + curl -sfL https://get.k3s.io | bash + +# Get kubeconfig + + ssh danneri.dn42.trygvis.io sudo cat /etc/rancher/k3s/k3s.yaml |\ + sed s,https://.*,https://danneri.dn42.trygvis.io:6443, > ~/.kube/config + +# Installing Cilium: + + cilium install -f cilium.yaml + +old: + + cilium install \ + --set routingMode=native \ + --set ipv4.enabled=true \ + --set ipam.operator.clusterPoolIPv4PodCIDRList=10.0.0.0/8 \ + --set ipv4NativeRoutingCIDR=10.0.0.0/8 \ + --set ipv6.enabled=true \ + --set enableIPv6Masquerade=false \ + --set k8s.requireIPv6PodCIDR=true \ + --set ipam.operator.clusterPoolIPv6PodCIDRList=fdb1:4242:3538:2008:aaaa:aaaa:aaaa::/96 \ + --set ipam.operator.clusterPoolIPv6MaskSize=112 \ + --set ipv6NativeRoutingCIDR=fdb1:4242:3538:2008::/64 \ + --set kubeProxyReplacement=true \ + --set k8sServiceHost=fdb1:4242:3538:2008:9422:d355:95b7:f170 \ + --set k8sServicePort=6443 + +TODO: check `kubeProxyReplacement=true` / `kube-proxy-replacement`. + +# Uninstalling + +Run: `k3s-uninstall.sh`. Note that this will delete everything, including `/etc/rancher/k3s/config.yaml`. + + rm -rf \ + /var/lib/cni \ + /etc/cni \ + /var/lib/rancher \ + /run/cilium \ + /run/containerd \ + /etc/sysctl.d/99-zzz-override_cilium.conf + +and then do a reboot to really stop Cilium from running. diff --git a/danneri/cilium.yaml b/danneri/cilium.yaml new file mode 100644 index 0000000..144e819 --- /dev/null +++ b/danneri/cilium.yaml @@ -0,0 +1,44 @@ +# https://yolops.net/k3s-at-home.html +# https://yolops.net/k8s-dualstack-cilium.html +# https://www.jeffgeerling.com/blog/2022/quick-hello-world-http-deployment-testing-k3s-and-traefik +# https://www.redpill-linpro.com/techblog/2024/01/03/cilium-dual-stack-k3s-pi-setup.html +--- +k8sServiceHost: fdb1:4242:3538:2008:9422:d355:95b7:f170 +k8sServicePort: 6443 +ipv4: + enabled: false +ipv6: + enabled: true +ipam: + mode: cluster-pool + operator: + # clusterPoolIPv4PodCIDRList: "10.96.0.0/16" + # clusterPoolIPv4MaskSize: 24 + clusterPoolIPv6PodCIDRList: "fdb1:4242:3538:2008:cccc:cccc::/96" + clusterPoolIPv6MaskSize: 112 +bpf: + masquerade: false + +enableIPv6Masquerade: false +kubeProxyReplacement: true + +# new +ipv6NativeRoutingCIDR: fdb1:4242:3538:2008::/64 + +extraConfig: + enable-ipv6-ndp: "true" + ipv6-mcast-device: "enp1s0" + ipv6-service-range: "fdb1:4242:3538:2008:5555:5555:5555::/112" + routing-mode: "native" +operator: + replicas: 1 + +# enable-bpf-masquerade true +# enable-endpoint-health-checking true +# enable-health-check-loadbalancer-ip false +# enable-health-check-nodeport true +# enable-health-checking true +# enable-hubble true +# enable-ipv4 false +# enable-ipv4-big-tcp false +# enable-ipv4-masquerade diff --git a/danneri/config.yaml b/danneri/config.yaml new file mode 100644 index 0000000..198d09f --- /dev/null +++ b/danneri/config.yaml @@ -0,0 +1,18 @@ +tls-san: + - "danneri.dn42.trygvis.io" + - "fdb1:4242:3538:2008:9422:d355:95b7:f170" + - "2a06:2240:f00d:b500:9422:d355:95b7:f170" + +node-ip: "fdb1:4242:3538:2008:9422:d355:95b7:f170" +cluster-cidr: "fdb1:4242:3538:2008:aaaa:aaaa:aaaa::/96" +service-cidr: "fdb1:4242:3538:2008:bbbb:bbbb:bbbb::/112" +# This https://docs.cilium.io/en/stable/network/kubernetes/requirements/#enable-automatic-node-cidr-allocation-recommended recommends that --allocate-node-cidrs is added to kube-controller-manager +kube-controller-manager-arg: node-cidr-mask-size-ipv6=112 +flannel-backend: none +disable: +# - traefik + - servicelb +disable-network-policy: true +disable-kube-proxy: true + +# default-local-storage-path: /srv/k3s-local-storage diff --git a/danneri/futar-deployment.yml b/danneri/futar-deployment.yml new file mode 100644 index 0000000..00a07ca --- /dev/null +++ b/danneri/futar-deployment.yml @@ -0,0 +1,60 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: futar-deployment + labels: + app: futar +spec: + selector: + matchLabels: + app: futar + replicas: 2 + template: + metadata: + labels: + app: futar + spec: + containers: + - name: futar + image: ghcr.io/trygvis/futar:main + ports: + - containerPort: 8080 +--- +apiVersion: v1 +kind: Service +metadata: + name: futar-np +spec: + selector: + app: futar + ports: + - protocol: TCP + port: 80 + targetPort: 8080 + nodePort: 30000 + type: NodePort + +--- +apiVersion: v1 +kind: Service +metadata: + name: futar +spec: + selector: + app: futar + ports: + - protocol: TCP + port: 8080 + +--- +apiVersion: v1 +kind: Service +metadata: + name: futar-lb +spec: + selector: + app: futar + type: LoadBalancer + ports: + - protocol: TCP + port: 8080 diff --git a/docs/.$wg0.drawio.bkp b/docs/.$wg0.drawio.bkp new file mode 100644 index 0000000..02850e9 --- /dev/null +++ b/docs/.$wg0.drawio.bkp @@ -0,0 +1,105 @@ +<mxfile host="Electron" modified="2023-10-05T06:48:05.910Z" agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/22.0.2 Chrome/114.0.5735.289 Electron/25.8.4 Safari/537.36" etag="Pz4jShWJTjG_Br3Oixw4" version="22.0.2" type="device"> + <diagram name="Page-1" id="v7i8TAT-5xv207MUNhIB"> + <mxGraphModel dx="1383" dy="799" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1169" pageHeight="827" math="0" shadow="0"> + <root> + <mxCell id="0" /> + <mxCell id="1" parent="0" /> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-8" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=classic;endFill=1;" parent="1" source="UDWjvm1ZnLB2DU_sOnAa-1" target="UDWjvm1ZnLB2DU_sOnAa-5" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-11" style="edgeStyle=none;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=classic;endFill=1;exitX=0.855;exitY=0.8555;exitDx=0;exitDy=0;exitPerimeter=0;" parent="1" source="UDWjvm1ZnLB2DU_sOnAa-1" target="UDWjvm1ZnLB2DU_sOnAa-4" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-1" value="conflatorio<br>wg0::3" style="sketch=0;points=[[0.5,0,0],[1,0.5,0],[0.5,1,0],[0,0.5,0],[0.145,0.145,0],[0.8555,0.145,0],[0.855,0.8555,0],[0.145,0.855,0]];verticalLabelPosition=middle;html=1;verticalAlign=middle;aspect=fixed;align=right;pointerEvents=1;shape=mxgraph.cisco19.rect;prIcon=router;fillColor=#FAFAFA;strokeColor=#005073;labelPosition=left;" parent="1" vertex="1"> + <mxGeometry x="350" y="240" width="50" height="50" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-9" style="edgeStyle=none;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=classic;endFill=1;exitX=0.145;exitY=0.145;exitDx=0;exitDy=0;exitPerimeter=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;entryPerimeter=0;" parent="1" source="UDWjvm1ZnLB2DU_sOnAa-2" target="UDWjvm1ZnLB2DU_sOnAa-5" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-10" style="edgeStyle=none;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=classic;endFill=1;exitX=0.145;exitY=0.855;exitDx=0;exitDy=0;exitPerimeter=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;entryPerimeter=0;" parent="1" source="UDWjvm1ZnLB2DU_sOnAa-2" target="UDWjvm1ZnLB2DU_sOnAa-4" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-26" value="eno1" style="edgeStyle=none;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=classic;endFill=1;" parent="1" source="UDWjvm1ZnLB2DU_sOnAa-2" target="UDWjvm1ZnLB2DU_sOnAa-28" edge="1"> + <mxGeometry relative="1" as="geometry"> + <mxPoint x="980" y="300" as="targetPoint" /> + </mxGeometry> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-32" value="enp2s0" style="edgeStyle=none;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=classic;endFill=1;" parent="1" source="yd4OAxL_OL2nS1uvAmHJ-6" target="UDWjvm1ZnLB2DU_sOnAa-33" edge="1"> + <mxGeometry relative="1" as="geometry"> + <mxPoint x="960" y="360" as="targetPoint" /> + </mxGeometry> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-2" value="akili<br>wg0:&nbsp;fdf3:aad9:a885:b3a::7/64" style="sketch=0;points=[[0.5,0,0],[1,0.5,0],[0.5,1,0],[0,0.5,0],[0.145,0.145,0],[0.8555,0.145,0],[0.855,0.8555,0],[0.145,0.855,0]];verticalLabelPosition=middle;html=1;verticalAlign=middle;aspect=fixed;align=left;pointerEvents=1;shape=mxgraph.cisco19.rect;prIcon=router;fillColor=#FAFAFA;strokeColor=#005073;labelPosition=right;" parent="1" vertex="1"> + <mxGeometry x="840" y="340" width="50" height="50" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-14" style="edgeStyle=none;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=classic;endFill=1;" parent="1" source="UDWjvm1ZnLB2DU_sOnAa-3" target="UDWjvm1ZnLB2DU_sOnAa-4" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-15" style="edgeStyle=none;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=classic;endFill=1;exitX=0.8555;exitY=0.145;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.209;entryY=0.791;entryDx=0;entryDy=0;entryPerimeter=0;" parent="1" source="UDWjvm1ZnLB2DU_sOnAa-3" target="UDWjvm1ZnLB2DU_sOnAa-5" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-3" value="arius" style="sketch=0;points=[[0.5,0,0],[1,0.5,0],[0.5,1,0],[0,0.5,0],[0.145,0.145,0],[0.8555,0.145,0],[0.855,0.8555,0],[0.145,0.855,0]];verticalLabelPosition=bottom;html=1;verticalAlign=top;aspect=fixed;align=center;pointerEvents=1;shape=mxgraph.cisco19.rect;prIcon=router;fillColor=#FAFAFA;strokeColor=#005073;" parent="1" vertex="1"> + <mxGeometry x="350" y="550" width="50" height="50" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-13" style="edgeStyle=none;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.8555;exitY=0.145;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.855;entryY=0.8555;entryDx=0;entryDy=0;entryPerimeter=0;endArrow=none;endFill=0;" parent="1" source="UDWjvm1ZnLB2DU_sOnAa-4" target="UDWjvm1ZnLB2DU_sOnAa-5" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-4" value="knot<br>wg0:&nbsp;fdf3:aad9:a885:b3a::1/64" style="sketch=0;points=[[0.5,0,0],[1,0.5,0],[0.5,1,0],[0,0.5,0],[0.145,0.145,0],[0.8555,0.145,0],[0.855,0.8555,0],[0.145,0.855,0]];verticalLabelPosition=bottom;html=1;verticalAlign=top;aspect=fixed;align=center;pointerEvents=1;shape=mxgraph.cisco19.rect;prIcon=router;fillColor=#FAFAFA;strokeColor=#005073;" parent="1" vertex="1"> + <mxGeometry x="620" y="550" width="50" height="50" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-7" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=none;endFill=0;" parent="1" source="UDWjvm1ZnLB2DU_sOnAa-5" target="UDWjvm1ZnLB2DU_sOnAa-6" edge="1"> + <mxGeometry relative="1" as="geometry"> + <mxPoint x="810" y="210" as="targetPoint" /> + </mxGeometry> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-12" style="edgeStyle=none;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.145;entryY=0.145;entryDx=0;entryDy=0;entryPerimeter=0;endArrow=none;endFill=0;exitX=0.145;exitY=0.855;exitDx=0;exitDy=0;exitPerimeter=0;" parent="1" source="UDWjvm1ZnLB2DU_sOnAa-5" target="UDWjvm1ZnLB2DU_sOnAa-4" edge="1"> + <mxGeometry relative="1" as="geometry"> + <mxPoint x="710" y="300" as="sourcePoint" /> + </mxGeometry> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-5" value="hash" style="sketch=0;points=[[0.5,0,0],[1,0.5,0],[0.5,1,0],[0,0.5,0],[0.145,0.145,0],[0.8555,0.145,0],[0.855,0.8555,0],[0.145,0.855,0]];verticalLabelPosition=bottom;html=1;verticalAlign=top;aspect=fixed;align=center;pointerEvents=1;shape=mxgraph.cisco19.rect;prIcon=router;fillColor=#FAFAFA;strokeColor=#005073;" parent="1" vertex="1"> + <mxGeometry x="620" y="240" width="50" height="50" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-6" value="vimscore-4" style="sketch=0;points=[[0.015,0.015,0],[0.985,0.015,0],[0.985,0.985,0],[0.015,0.985,0],[0.25,0,0],[0.5,0,0],[0.75,0,0],[1,0.25,0],[1,0.5,0],[1,0.75,0],[0.75,1,0],[0.5,1,0],[0.25,1,0],[0,0.75,0],[0,0.5,0],[0,0.25,0]];verticalLabelPosition=top;html=1;verticalAlign=bottom;aspect=fixed;align=center;pointerEvents=1;shape=mxgraph.cisco19.server;fillColor=#005073;strokeColor=none;labelPosition=center;" parent="1" vertex="1"> + <mxGeometry x="631.25" y="130" width="27.500000000000004" height="50" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-16" value="unifi" style="sketch=0;points=[[0.015,0.015,0],[0.985,0.015,0],[0.985,0.985,0],[0.015,0.985,0],[0.25,0,0],[0.5,0,0],[0.75,0,0],[1,0.25,0],[1,0.5,0],[1,0.75,0],[0.75,1,0],[0.5,1,0],[0.25,1,0],[0,0.75,0],[0,0.5,0],[0,0.25,0]];verticalLabelPosition=top;html=1;verticalAlign=bottom;aspect=fixed;align=center;pointerEvents=1;shape=mxgraph.cisco19.server;fillColor=#005073;strokeColor=none;labelPosition=center;" parent="1" vertex="1"> + <mxGeometry x="361.25" y="130" width="27.500000000000004" height="50" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-17" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=none;endFill=0;" parent="1" source="UDWjvm1ZnLB2DU_sOnAa-1" target="UDWjvm1ZnLB2DU_sOnAa-16" edge="1"> + <mxGeometry relative="1" as="geometry"> + <mxPoint x="840" y="225" as="targetPoint" /> + <mxPoint x="680" y="275" as="sourcePoint" /> + </mxGeometry> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-19" value="trygvis net<br>Global ID: f3aad9a885<br>AS: 4230483679" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="518.75" y="10" width="140" height="60" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-20" value="Current:<br>Global ID: f3aad9a885<br style="border-color: var(--border-color);"><div style=""><span style="background-color: initial;">wg0 subnet ID: 0b3a</span></div><div style=""><span style="background-color: initial;">wg0 prefix: fdf3:aad9:a885:0b3a:/64</span></div>" style="text;html=1;align=left;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="40" y="70" width="210" height="70" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-22" value="lhn2<br>lhn2 subnet id: ::77dd/64" style="sketch=0;points=[[0.5,0,0],[1,0.5,0],[0.5,1,0],[0,0.5,0],[0.145,0.145,0],[0.8555,0.145,0],[0.855,0.8555,0],[0.145,0.855,0]];verticalLabelPosition=bottom;html=1;verticalAlign=top;aspect=fixed;align=center;pointerEvents=1;shape=mxgraph.cisco19.rect;prIcon=router;fillColor=#FAFAFA;strokeColor=#005073;" parent="1" vertex="1"> + <mxGeometry x="100" y="660" width="50" height="50" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-23" value="kv24<br>subnet id: ba64<br>ipv6 net:&nbsp;fdf3:aad9:a885:ba64::/64<br>" style="sketch=0;points=[[0.5,0,0],[1,0.5,0],[0.5,1,0],[0,0.5,0],[0.145,0.145,0],[0.8555,0.145,0],[0.855,0.8555,0],[0.145,0.855,0]];verticalLabelPosition=bottom;html=1;verticalAlign=top;aspect=fixed;align=center;pointerEvents=1;shape=mxgraph.cisco19.rect;prIcon=router;fillColor=#FAFAFA;strokeColor=#005073;" parent="1" vertex="1"> + <mxGeometry x="100" y="520" width="50" height="50" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-24" value="wg0 is the peering network" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="40" y="180" width="170" height="30" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-28" value="Network: fdf3:aad9:a885:ba64::/64" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;rounded=0;" parent="1" vertex="1"> + <mxGeometry x="880" y="260" width="210" height="30" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-33" value="Network: fdf3:aad9:a885:ba65::/64" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;rounded=0;perimeterSpacing=0;spacing=2;" parent="1" vertex="1"> + <mxGeometry x="850" y="680" width="210" height="30" as="geometry" /> + </mxCell> + <mxCell id="yd4OAxL_OL2nS1uvAmHJ-6" value="astyanax<br>wg0:&nbsp;fdf3:aad9:a885:b3a::10/64" style="sketch=0;points=[[0.5,0,0],[1,0.5,0],[0.5,1,0],[0,0.5,0],[0.145,0.145,0],[0.8555,0.145,0],[0.855,0.8555,0],[0.145,0.855,0]];verticalLabelPosition=middle;html=1;verticalAlign=middle;aspect=fixed;align=left;pointerEvents=1;shape=mxgraph.cisco19.rect;prIcon=router;fillColor=#FAFAFA;strokeColor=#005073;labelPosition=right;" vertex="1" parent="1"> + <mxGeometry x="840" y="460" width="50" height="50" as="geometry" /> + </mxCell> + <mxCell id="yd4OAxL_OL2nS1uvAmHJ-7" style="orthogonalLoop=1;jettySize=auto;html=1;entryX=1;entryY=0.5;entryDx=0;entryDy=0;entryPerimeter=0;rounded=0;" edge="1" parent="1" source="yd4OAxL_OL2nS1uvAmHJ-6" target="UDWjvm1ZnLB2DU_sOnAa-4"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + </root> + </mxGraphModel> + </diagram> +</mxfile> diff --git a/docs/2023-10-23 - tnet.drawio b/docs/2023-10-23 - tnet.drawio new file mode 100644 index 0000000..7414262 --- /dev/null +++ b/docs/2023-10-23 - tnet.drawio @@ -0,0 +1,571 @@ +<mxfile host="Electron" modified="2024-09-24T20:15:30.452Z" agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/22.0.2 Chrome/114.0.5735.289 Electron/25.8.4 Safari/537.36" etag="5nmccZ1ov7ZESQxNsFWk" version="22.0.2" type="device" pages="5"> + <diagram name="tnet" id="BvOL4zu76bRaQ85PTpcJ"> + <mxGraphModel dx="2074" dy="1230" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1169" pageHeight="827" math="0" shadow="0"> + <root> + <mxCell id="0" /> + <mxCell id="1" parent="0" /> + <mxCell id="_oqYuhv8jh0_rys1Lpot-2" value="Wireguard" style="orthogonalLoop=1;jettySize=auto;startArrow=classic;startFill=1;curved=1;labelPosition=center;verticalLabelPosition=top;align=center;verticalAlign=bottom;html=1;fontStyle=0;labelBackgroundColor=none;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" edge="1"> + <mxGeometry y="-10" relative="1" as="geometry"> + <mxPoint x="880" y="110" as="sourcePoint" /> + <mxPoint x="800" y="110" as="targetPoint" /> + <mxPoint as="offset" /> + </mxGeometry> + </mxCell> + <mxCell id="kq-59-67Notf0ipTlqrg-4" value="kv24" style="rounded=1;whiteSpace=wrap;html=1;fontStyle=0;labelPosition=center;verticalLabelPosition=bottom;align=center;verticalAlign=top;fillColor=none;connectable=0;" parent="1" vertex="1"> + <mxGeometry x="40" y="439" width="240" height="169.5" as="geometry" /> + </mxCell> + <mxCell id="kq-59-67Notf0ipTlqrg-3" value="lhn2" style="rounded=1;whiteSpace=wrap;html=1;fontStyle=1;labelPosition=center;verticalLabelPosition=top;align=center;verticalAlign=bottom;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="40" y="40.5" width="240" height="169.5" as="geometry" /> + </mxCell> + <mxCell id="CLQh8vJcVvMq8tJKvEXp-5" style="orthogonalLoop=1;jettySize=auto;html=1;curved=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.145;entryY=0.855;entryDx=0;entryDy=0;entryPerimeter=0;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" source="CLQh8vJcVvMq8tJKvEXp-1" target="CLQh8vJcVvMq8tJKvEXp-4" edge="1"> + <mxGeometry relative="1" as="geometry"> + <mxPoint x="602" y="200" as="targetPoint" /> + </mxGeometry> + </mxCell> + <mxCell id="_oqYuhv8jh0_rys1Lpot-14" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=none;endFill=0;" parent="1" source="CLQh8vJcVvMq8tJKvEXp-1" target="_oqYuhv8jh0_rys1Lpot-13" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="CLQh8vJcVvMq8tJKvEXp-1" value="kv24ix" style="sketch=0;points=[[0.5,0,0],[1,0.5,0],[0.5,1,0],[0,0.5,0],[0.145,0.145,0],[0.8555,0.145,0],[0.855,0.8555,0],[0.145,0.855,0]];verticalLabelPosition=bottom;html=1;verticalAlign=top;aspect=fixed;align=center;pointerEvents=1;shape=mxgraph.cisco19.rect;prIcon=router;fillColor=#FAFAFA;strokeColor=#005073;" parent="1" vertex="1"> + <mxGeometry x="220" y="530" width="41" height="41" as="geometry" /> + </mxCell> + <mxCell id="CLQh8vJcVvMq8tJKvEXp-7" style="orthogonalLoop=1;jettySize=auto;html=1;curved=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;entryPerimeter=0;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" source="CLQh8vJcVvMq8tJKvEXp-2" target="CLQh8vJcVvMq8tJKvEXp-4" edge="1"> + <mxGeometry relative="1" as="geometry"> + <mxPoint x="596" y="195" as="targetPoint" /> + </mxGeometry> + </mxCell> + <mxCell id="CLQh8vJcVvMq8tJKvEXp-2" value="lhn2ix" style="sketch=0;points=[[0.5,0,0],[1,0.5,0],[0.5,1,0],[0,0.5,0],[0.145,0.145,0],[0.8555,0.145,0],[0.855,0.8555,0],[0.145,0.855,0]];verticalLabelPosition=top;html=1;verticalAlign=bottom;aspect=fixed;align=center;pointerEvents=1;shape=mxgraph.cisco19.rect;prIcon=router;fillColor=#FAFAFA;strokeColor=#005073;labelPosition=center;" parent="1" vertex="1"> + <mxGeometry x="210" y="90" width="40" height="40" as="geometry" /> + </mxCell> + <mxCell id="CLQh8vJcVvMq8tJKvEXp-3" value="hash" style="sketch=0;points=[[0.5,0,0],[1,0.5,0],[0.5,1,0],[0,0.5,0],[0.145,0.145,0],[0.8555,0.145,0],[0.855,0.8555,0],[0.145,0.855,0]];verticalLabelPosition=bottom;html=1;verticalAlign=top;aspect=fixed;align=center;pointerEvents=1;shape=mxgraph.cisco19.rect;prIcon=router;fillColor=#FAFAFA;strokeColor=#005073;" parent="1" vertex="1"> + <mxGeometry x="600" y="439" width="41" height="41" as="geometry" /> + </mxCell> + <mxCell id="CLQh8vJcVvMq8tJKvEXp-9" style="orthogonalLoop=1;jettySize=auto;html=1;startArrow=classic;startFill=1;curved=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" source="CLQh8vJcVvMq8tJKvEXp-4" target="CLQh8vJcVvMq8tJKvEXp-3" edge="1"> + <mxGeometry relative="1" as="geometry"> + <mxPoint x="630" y="210" as="sourcePoint" /> + </mxGeometry> + </mxCell> + <mxCell id="_oqYuhv8jh0_rys1Lpot-16" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="CLQh8vJcVvMq8tJKvEXp-4" target="_oqYuhv8jh0_rys1Lpot-9" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="CLQh8vJcVvMq8tJKvEXp-4" value="knot" style="sketch=0;points=[[0.5,0,0],[1,0.5,0],[0.5,1,0],[0,0.5,0],[0.145,0.145,0],[0.8555,0.145,0],[0.855,0.8555,0],[0.145,0.855,0]];verticalLabelPosition=top;html=1;verticalAlign=bottom;aspect=fixed;align=center;pointerEvents=1;shape=mxgraph.cisco19.rect;prIcon=router;fillColor=#FAFAFA;strokeColor=#005073;labelPosition=center;" parent="1" vertex="1"> + <mxGeometry x="600" y="160" width="40" height="40" as="geometry" /> + </mxCell> + <mxCell id="CLQh8vJcVvMq8tJKvEXp-10" value="conflatorio" style="sketch=0;points=[[0.5,0,0],[1,0.5,0],[0.5,1,0],[0,0.5,0],[0.145,0.145,0],[0.8555,0.145,0],[0.855,0.8555,0],[0.145,0.855,0]];verticalLabelPosition=top;html=1;verticalAlign=bottom;aspect=fixed;align=center;pointerEvents=1;shape=mxgraph.cisco19.rect;prIcon=router;fillColor=#FAFAFA;strokeColor=#005073;labelPosition=center;" parent="1" vertex="1"> + <mxGeometry x="110" y="89" width="41" height="41" as="geometry" /> + </mxCell> + <mxCell id="kq-59-67Notf0ipTlqrg-2" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;entryPerimeter=0;endArrow=none;endFill=0;" parent="1" source="CLQh8vJcVvMq8tJKvEXp-10" target="CLQh8vJcVvMq8tJKvEXp-2" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="_oqYuhv8jh0_rys1Lpot-6" value="Wireguard connections can be initiated from both&nbsp;endpoints, arrow indicates direction" style="whiteSpace=wrap;html=1;strokeColor=none;fillColor=none;autosize=0;resizeWidth=0;resizable=1;resizeHeight=1;align=left;verticalAlign=top;fixedWidth=1;" parent="1" vertex="1"> + <mxGeometry x="920" y="79.5" width="240" height="50.5" as="geometry" /> + </mxCell> + <mxCell id="_oqYuhv8jh0_rys1Lpot-9" value="" style="ellipse;shape=cloud;whiteSpace=wrap;html=1;" parent="1" vertex="1"> + <mxGeometry x="360" y="240" width="120" height="80" as="geometry" /> + </mxCell> + <mxCell id="_oqYuhv8jh0_rys1Lpot-12" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.855;exitY=0.8555;exitDx=0;exitDy=0;exitPerimeter=0;" parent="1" source="_oqYuhv8jh0_rys1Lpot-10" target="_oqYuhv8jh0_rys1Lpot-9" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="_oqYuhv8jh0_rys1Lpot-10" value="ISP" style="sketch=0;points=[[0.5,0,0],[1,0.5,0],[0.5,1,0],[0,0.5,0],[0.145,0.145,0],[0.8555,0.145,0],[0.855,0.8555,0],[0.145,0.855,0]];verticalLabelPosition=middle;html=1;verticalAlign=middle;aspect=fixed;align=right;pointerEvents=1;shape=mxgraph.cisco19.rect;prIcon=router;fillColor=#FAFAFA;strokeColor=#005073;labelPosition=left;" parent="1" vertex="1"> + <mxGeometry x="210" y="160" width="40" height="40" as="geometry" /> + </mxCell> + <mxCell id="_oqYuhv8jh0_rys1Lpot-11" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;entryPerimeter=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;exitPerimeter=0;endArrow=none;endFill=0;" parent="1" source="CLQh8vJcVvMq8tJKvEXp-2" target="_oqYuhv8jh0_rys1Lpot-10" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="_oqYuhv8jh0_rys1Lpot-15" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.8555;exitY=0.145;exitDx=0;exitDy=0;exitPerimeter=0;" parent="1" source="_oqYuhv8jh0_rys1Lpot-13" target="_oqYuhv8jh0_rys1Lpot-9" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="_oqYuhv8jh0_rys1Lpot-13" value="ISP" style="sketch=0;points=[[0.5,0,0],[1,0.5,0],[0.5,1,0],[0,0.5,0],[0.145,0.145,0],[0.8555,0.145,0],[0.855,0.8555,0],[0.145,0.855,0]];verticalLabelPosition=middle;html=1;verticalAlign=middle;aspect=fixed;align=right;pointerEvents=1;shape=mxgraph.cisco19.rect;prIcon=router;fillColor=#FAFAFA;strokeColor=#005073;labelPosition=left;" parent="1" vertex="1"> + <mxGeometry x="221" y="450" width="40" height="40" as="geometry" /> + </mxCell> + <mxCell id="_oqYuhv8jh0_rys1Lpot-17" value="ISP routers are un-controlled hardware that delivers IPv4 NAT and public IPv6 addresses" style="text;html=1;align=left;verticalAlign=middle;resizable=1;points=[];autosize=1;strokeColor=none;fillColor=none;overflow=width;whiteSpace=wrap" parent="1" vertex="1"> + <mxGeometry x="920" y="142.5" width="240" height="35" as="geometry" /> + </mxCell> + <mxCell id="_oqYuhv8jh0_rys1Lpot-18" value="ISP" style="sketch=0;points=[[0.5,0,0],[1,0.5,0],[0.5,1,0],[0,0.5,0],[0.145,0.145,0],[0.8555,0.145,0],[0.855,0.8555,0],[0.145,0.855,0]];verticalLabelPosition=middle;html=1;verticalAlign=middle;aspect=fixed;align=right;pointerEvents=1;shape=mxgraph.cisco19.rect;prIcon=router;fillColor=#FAFAFA;strokeColor=#005073;labelPosition=left;" parent="1" vertex="1"> + <mxGeometry x="820" y="140" width="40" height="40" as="geometry" /> + </mxCell> + <mxCell id="_oqYuhv8jh0_rys1Lpot-19" value="ix" style="sketch=0;points=[[0.5,0,0],[1,0.5,0],[0.5,1,0],[0,0.5,0],[0.145,0.145,0],[0.8555,0.145,0],[0.855,0.8555,0],[0.145,0.855,0]];verticalLabelPosition=middle;html=1;verticalAlign=middle;aspect=fixed;align=right;pointerEvents=1;shape=mxgraph.cisco19.rect;prIcon=router;fillColor=#FAFAFA;strokeColor=#005073;labelPosition=left;" parent="1" vertex="1"> + <mxGeometry x="820" y="200" width="40" height="40" as="geometry" /> + </mxCell> + <mxCell id="_oqYuhv8jh0_rys1Lpot-20" value="IX (internet exchange) routers are EdgeOS routers" style="text;html=1;align=left;verticalAlign=middle;resizable=1;points=[];autosize=1;strokeColor=none;fillColor=none;overflow=width;whiteSpace=wrap" parent="1" vertex="1"> + <mxGeometry x="920" y="205.5" width="240" height="30" as="geometry" /> + </mxCell> + <mxCell id="_oqYuhv8jh0_rys1Lpot-21" value="" style="sketch=0;points=[[0.5,0,0],[1,0.5,0],[0.5,1,0],[0,0.5,0],[0.145,0.145,0],[0.8555,0.145,0],[0.855,0.8555,0],[0.145,0.855,0]];verticalLabelPosition=middle;html=1;verticalAlign=middle;aspect=fixed;align=right;pointerEvents=1;shape=mxgraph.cisco19.rect;prIcon=router;fillColor=#FAFAFA;strokeColor=#005073;labelPosition=left;" parent="1" vertex="1"> + <mxGeometry x="820" y="260" width="40" height="40" as="geometry" /> + </mxCell> + <mxCell id="_oqYuhv8jh0_rys1Lpot-22" value="All other routers are Linux hosts" style="text;html=1;align=left;verticalAlign=middle;resizable=1;points=[];autosize=1;strokeColor=none;fillColor=none;overflow=width;whiteSpace=wrap" parent="1" vertex="1"> + <mxGeometry x="920" y="265" width="190" height="30" as="geometry" /> + </mxCell> + <mxCell id="QNxnjQuwQrLiuIVgEP8Q-1" style="orthogonalLoop=1;jettySize=auto;html=1;curved=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;exitPerimeter=0;fillColor=#dae8fc;strokeColor=#6c8ebf;entryX=0.8555;entryY=0.145;entryDx=0;entryDy=0;entryPerimeter=0;" parent="1" source="CLQh8vJcVvMq8tJKvEXp-2" target="CLQh8vJcVvMq8tJKvEXp-1" edge="1"> + <mxGeometry relative="1" as="geometry"> + <mxPoint x="210" y="410" as="targetPoint" /> + <mxPoint x="265" y="546" as="sourcePoint" /> + <Array as="points"> + <mxPoint x="590" y="230" /> + </Array> + </mxGeometry> + </mxCell> + </root> + </mxGraphModel> + </diagram> + <diagram id="OTq_sM1T3sTYLIRuV6jG" name="conflatorio"> + <mxGraphModel dx="905" dy="1198" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1169" pageHeight="827" math="0" shadow="0"> + <root> + <mxCell id="0" /> + <mxCell id="1" parent="0" /> + <mxCell id="Vz1C8OB2fIIe8CMhx9Ex-1" value="traefik" style="ellipse;shape=cloud;whiteSpace=wrap;html=1;" parent="1" vertex="1"> + <mxGeometry x="1520" y="400" width="80" height="40" as="geometry" /> + </mxCell> + <mxCell id="Vz1C8OB2fIIe8CMhx9Ex-2" value="pdb" style="ellipse;shape=cloud;whiteSpace=wrap;html=1;fillColor=#f5f5f5;fontColor=#333333;strokeColor=#666666;" parent="1" vertex="1"> + <mxGeometry x="1731" y="400" width="80" height="40" as="geometry" /> + </mxCell> + <mxCell id="Vz1C8OB2fIIe8CMhx9Ex-3" style="orthogonalLoop=1;jettySize=auto;html=1;rounded=0;fillColor=#f5f5f5;strokeColor=#666666;" parent="1" source="Vz1C8OB2fIIe8CMhx9Ex-4" target="Vz1C8OB2fIIe8CMhx9Ex-2" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="Vz1C8OB2fIIe8CMhx9Ex-4" value="pdb" style="sketch=0;points=[[0.015,0.015,0],[0.985,0.015,0],[0.985,0.985,0],[0.015,0.985,0],[0.25,0,0],[0.5,0,0],[0.75,0,0],[1,0.25,0],[1,0.5,0],[1,0.75,0],[0.75,1,0],[0.5,1,0],[0.25,1,0],[0,0.75,0],[0,0.5,0],[0,0.25,0]];verticalLabelPosition=middle;html=1;verticalAlign=middle;aspect=fixed;align=right;pointerEvents=1;shape=mxgraph.cisco19.rect;prIcon=database_relational;fillColor=#f5f5f5;strokeColor=#666666;labelPosition=left;fontColor=#333333;" parent="1" vertex="1"> + <mxGeometry x="1800" y="480" width="40" height="40" as="geometry" /> + </mxCell> + <mxCell id="Vz1C8OB2fIIe8CMhx9Ex-5" style="orthogonalLoop=1;jettySize=auto;html=1;rounded=0;fillColor=#f5f5f5;strokeColor=#666666;" parent="1" source="Vz1C8OB2fIIe8CMhx9Ex-8" target="Vz1C8OB2fIIe8CMhx9Ex-2" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="Vz1C8OB2fIIe8CMhx9Ex-6" style="orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="Vz1C8OB2fIIe8CMhx9Ex-8" target="Vz1C8OB2fIIe8CMhx9Ex-1" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="Vz1C8OB2fIIe8CMhx9Ex-7" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;shadow=0;" parent="1" source="Vz1C8OB2fIIe8CMhx9Ex-8" target="Vz1C8OB2fIIe8CMhx9Ex-19" edge="1"> + <mxGeometry relative="1" as="geometry"> + <mxPoint x="1670" y="320" as="sourcePoint" /> + </mxGeometry> + </mxCell> + <mxCell id="Vz1C8OB2fIIe8CMhx9Ex-8" value="grafana" style="sketch=0;points=[[0.015,0.015,0],[0.985,0.015,0],[0.985,0.985,0],[0.015,0.985,0],[0.25,0,0],[0.5,0,0],[0.75,0,0],[1,0.25,0],[1,0.5,0],[1,0.75,0],[0.75,1,0],[0.5,1,0],[0.25,1,0],[0,0.75,0],[0,0.5,0],[0,0.25,0]];verticalLabelPosition=middle;html=1;verticalAlign=middle;aspect=fixed;align=right;pointerEvents=1;shape=mxgraph.cisco19.server;fillColor=#005073;strokeColor=none;labelPosition=left;" parent="1" vertex="1"> + <mxGeometry x="1630" y="320" width="22" height="40" as="geometry" /> + </mxCell> + <mxCell id="Vz1C8OB2fIIe8CMhx9Ex-9" style="orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="Vz1C8OB2fIIe8CMhx9Ex-10" target="Vz1C8OB2fIIe8CMhx9Ex-1" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="Vz1C8OB2fIIe8CMhx9Ex-10" value="traefik" style="sketch=0;points=[[0.015,0.015,0],[0.985,0.015,0],[0.985,0.985,0],[0.015,0.985,0],[0.25,0,0],[0.5,0,0],[0.75,0,0],[1,0.25,0],[1,0.5,0],[1,0.75,0],[0.75,1,0],[0.5,1,0],[0.25,1,0],[0,0.75,0],[0,0.5,0],[0,0.25,0]];verticalLabelPosition=middle;html=1;verticalAlign=middle;aspect=fixed;align=right;pointerEvents=1;shape=mxgraph.cisco19.server;fillColor=#005073;strokeColor=none;labelPosition=left;" parent="1" vertex="1"> + <mxGeometry x="1520" y="320" width="22" height="40" as="geometry" /> + </mxCell> + <mxCell id="Vz1C8OB2fIIe8CMhx9Ex-11" value="docker-proxy" style="sketch=0;points=[[0.015,0.015,0],[0.985,0.015,0],[0.985,0.985,0],[0.015,0.985,0],[0.25,0,0],[0.5,0,0],[0.75,0,0],[1,0.25,0],[1,0.5,0],[1,0.75,0],[0.75,1,0],[0.5,1,0],[0.25,1,0],[0,0.75,0],[0,0.5,0],[0,0.25,0]];verticalLabelPosition=top;html=1;verticalAlign=bottom;aspect=fixed;align=center;pointerEvents=1;shape=mxgraph.cisco19.server;fillColor=#005073;strokeColor=none;labelPosition=center;" parent="1" vertex="1"> + <mxGeometry x="1520" y="201" width="22" height="40" as="geometry" /> + </mxCell> + <mxCell id="Vz1C8OB2fIIe8CMhx9Ex-12" value="conflatorio" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;fontSize=24;" parent="1" vertex="1"> + <mxGeometry x="1465" y="25" width="130" height="40" as="geometry" /> + </mxCell> + <mxCell id="Vz1C8OB2fIIe8CMhx9Ex-13" value="conflatorio-net::2" style="edgeStyle=orthogonalEdgeStyle;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;entryPerimeter=0;curved=1;" parent="1" source="Vz1C8OB2fIIe8CMhx9Ex-11" target="Vz1C8OB2fIIe8CMhx9Ex-10" edge="1"> + <mxGeometry x="0.5097" relative="1" as="geometry"> + <mxPoint as="offset" /> + </mxGeometry> + </mxCell> + <mxCell id="Vz1C8OB2fIIe8CMhx9Ex-14" value="lhn2ix-net = fdf3:aad9:a885:77dd::/64<br>conflatorio-net = fdf3:aad9:a885:77dd:aaaa::/120" style="text;html=1;align=left;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="1770" y="60" width="280" height="40" as="geometry" /> + </mxCell> + <mxCell id="Vz1C8OB2fIIe8CMhx9Ex-15" style="orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;exitPerimeter=0;rounded=0;" parent="1" source="Vz1C8OB2fIIe8CMhx9Ex-16" target="Vz1C8OB2fIIe8CMhx9Ex-1" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="Vz1C8OB2fIIe8CMhx9Ex-16" value="unifi-controller" style="sketch=0;points=[[0.015,0.015,0],[0.985,0.015,0],[0.985,0.985,0],[0.015,0.985,0],[0.25,0,0],[0.5,0,0],[0.75,0,0],[1,0.25,0],[1,0.5,0],[1,0.75,0],[0.75,1,0],[0.5,1,0],[0.25,1,0],[0,0.75,0],[0,0.5,0],[0,0.25,0]];verticalLabelPosition=middle;html=1;verticalAlign=middle;aspect=fixed;align=right;pointerEvents=1;shape=mxgraph.cisco19.server;fillColor=#005073;strokeColor=none;labelPosition=left;" parent="1" vertex="1"> + <mxGeometry x="1410" y="320" width="22" height="40" as="geometry" /> + </mxCell> + <mxCell id="Vz1C8OB2fIIe8CMhx9Ex-17" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="Vz1C8OB2fIIe8CMhx9Ex-11" target="Vz1C8OB2fIIe8CMhx9Ex-16" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="Vz1C8OB2fIIe8CMhx9Ex-18" style="orthogonalLoop=1;jettySize=auto;html=1;entryX=1;entryY=0.5;entryDx=0;entryDy=0;entryPerimeter=0;exitX=0.4;exitY=0.1;exitDx=0;exitDy=0;exitPerimeter=0;" parent="1" source="Vz1C8OB2fIIe8CMhx9Ex-19" target="Vz1C8OB2fIIe8CMhx9Ex-20" edge="1"> + <mxGeometry relative="1" as="geometry"> + <mxPoint x="1630" y="140" as="targetPoint" /> + </mxGeometry> + </mxCell> + <mxCell id="Vz1C8OB2fIIe8CMhx9Ex-19" value="public" style="ellipse;shape=cloud;whiteSpace=wrap;html=1;" parent="1" vertex="1"> + <mxGeometry x="1662" y="161" width="80" height="40" as="geometry" /> + </mxCell> + <mxCell id="Vz1C8OB2fIIe8CMhx9Ex-20" value="conflatorio" style="sketch=0;points=[[0.5,0,0],[1,0.5,0],[0.5,1,0],[0,0.5,0],[0.145,0.145,0],[0.8555,0.145,0],[0.855,0.8555,0],[0.145,0.855,0]];verticalLabelPosition=bottom;html=1;verticalAlign=top;aspect=fixed;align=center;pointerEvents=1;shape=mxgraph.cisco19.rect;prIcon=router;fillColor=#FAFAFA;strokeColor=#005073;" parent="1" vertex="1"> + <mxGeometry x="1510.5" y="80" width="41" height="41" as="geometry" /> + </mxCell> + <mxCell id="Vz1C8OB2fIIe8CMhx9Ex-21" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="Vz1C8OB2fIIe8CMhx9Ex-22" target="Vz1C8OB2fIIe8CMhx9Ex-1" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="Vz1C8OB2fIIe8CMhx9Ex-22" value="influxdb" style="sketch=0;points=[[0.015,0.015,0],[0.985,0.015,0],[0.985,0.985,0],[0.015,0.985,0],[0.25,0,0],[0.5,0,0],[0.75,0,0],[1,0.25,0],[1,0.5,0],[1,0.75,0],[0.75,1,0],[0.5,1,0],[0.25,1,0],[0,0.75,0],[0,0.5,0],[0,0.25,0]];verticalLabelPosition=middle;html=1;verticalAlign=middle;aspect=fixed;align=right;pointerEvents=1;shape=mxgraph.cisco19.rect;prIcon=database_relational;labelPosition=left;" parent="1" vertex="1"> + <mxGeometry x="1401" y="440" width="40" height="40" as="geometry" /> + </mxCell> + <mxCell id="MlYskDayVSW2n0ct6hMW-2" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="MlYskDayVSW2n0ct6hMW-1" target="Vz1C8OB2fIIe8CMhx9Ex-19" edge="1"> + <mxGeometry relative="1" as="geometry"> + <mxPoint x="1870" y="350" as="targetPoint" /> + </mxGeometry> + </mxCell> + <mxCell id="MlYskDayVSW2n0ct6hMW-4" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;shadow=0;jumpStyle=none;fontStyle=1;fillColor=#f5f5f5;strokeColor=#666666;" parent="1" source="MlYskDayVSW2n0ct6hMW-3" target="Vz1C8OB2fIIe8CMhx9Ex-2" edge="1"> + <mxGeometry relative="1" as="geometry"> + <mxPoint x="1740" y="340" as="targetPoint" /> + </mxGeometry> + </mxCell> + <mxCell id="MlYskDayVSW2n0ct6hMW-1" value="telegraf" style="sketch=0;points=[[0.015,0.015,0],[0.985,0.015,0],[0.985,0.985,0],[0.015,0.985,0],[0.25,0,0],[0.5,0,0],[0.75,0,0],[1,0.25,0],[1,0.5,0],[1,0.75,0],[0.75,1,0],[0.5,1,0],[0.25,1,0],[0,0.75,0],[0,0.5,0],[0,0.25,0]];verticalLabelPosition=middle;html=1;verticalAlign=middle;aspect=fixed;align=left;pointerEvents=1;shape=mxgraph.cisco19.server;fillColor=#005073;strokeColor=none;labelPosition=right;" parent="1" vertex="1"> + <mxGeometry x="1742" y="320" width="22" height="40" as="geometry" /> + </mxCell> + <mxCell id="MlYskDayVSW2n0ct6hMW-6" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="MlYskDayVSW2n0ct6hMW-3" target="Vz1C8OB2fIIe8CMhx9Ex-1" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="MlYskDayVSW2n0ct6hMW-7" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="MlYskDayVSW2n0ct6hMW-3" target="Vz1C8OB2fIIe8CMhx9Ex-19" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="MlYskDayVSW2n0ct6hMW-3" value="pgadmin" style="points=[[0.015,0.015,0],[0.985,0.015,0],[0.985,0.985,0],[0.015,0.985,0],[0.25,0,0],[0.5,0,0],[0.75,0,0],[1,0.25,0],[1,0.5,0],[1,0.75,0],[0.75,1,0],[0.5,1,0],[0.25,1,0],[0,0.75,0],[0,0.5,0],[0,0.25,0]];verticalLabelPosition=bottom;html=1;verticalAlign=top;aspect=fixed;align=center;pointerEvents=1;shape=mxgraph.cisco19.server;fillColor=#005073;strokeColor=none;labelPosition=center;shadow=0;labelBackgroundColor=none;" parent="1" vertex="1"> + <mxGeometry x="1670" y="440" width="22" height="40" as="geometry" /> + </mxCell> + <mxCell id="MlYskDayVSW2n0ct6hMW-9" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=none;endFill=0;dashed=1;entryX=1.002;entryY=0.247;entryDx=0;entryDy=0;entryPerimeter=0;" parent="1" source="MlYskDayVSW2n0ct6hMW-8" target="MlYskDayVSW2n0ct6hMW-1" edge="1"> + <mxGeometry relative="1" as="geometry"> + <Array as="points"> + <mxPoint x="1780" y="330" /> + </Array> + </mxGeometry> + </mxCell> + <mxCell id="MlYskDayVSW2n0ct6hMW-8" value="Has network=host, monitors conflatorio itself" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1"> + <mxGeometry x="1830" y="260" width="110" height="50" as="geometry" /> + </mxCell> + </root> + </mxGraphModel> + </diagram> + <diagram id="pCcwJyTKyqWcmV8DOXKF" name="tnet"> + <mxGraphModel dx="2074" dy="1198" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1169" pageHeight="827" math="0" shadow="0"> + <root> + <mxCell id="0" /> + <mxCell id="1" parent="0" /> + <mxCell id="qgdV0KhxuuxavuWXjZ00-3" value="lhn2ix" style="sketch=0;points=[[0.5,0,0],[1,0.5,0],[0.5,1,0],[0,0.5,0],[0.145,0.145,0],[0.8555,0.145,0],[0.855,0.8555,0],[0.145,0.855,0]];verticalLabelPosition=bottom;html=1;verticalAlign=top;aspect=fixed;align=center;pointerEvents=1;shape=mxgraph.cisco19.rect;prIcon=router;fillColor=#FAFAFA;strokeColor=#005073;fontStyle=1" parent="1" vertex="1"> + <mxGeometry x="400" y="240" width="40" height="40" as="geometry" /> + </mxCell> + <mxCell id="qgdV0KhxuuxavuWXjZ00-1" value="hash" style="sketch=0;points=[[0.5,0,0],[1,0.5,0],[0.5,1,0],[0,0.5,0],[0.145,0.145,0],[0.8555,0.145,0],[0.855,0.8555,0],[0.145,0.855,0]];verticalLabelPosition=top;html=1;verticalAlign=bottom;aspect=fixed;align=center;pointerEvents=1;shape=mxgraph.cisco19.rect;prIcon=router;fillColor=#FAFAFA;strokeColor=#005073;labelPosition=center;fontStyle=1" parent="1" vertex="1"> + <mxGeometry x="360" y="120" width="40" height="40" as="geometry" /> + </mxCell> + <mxCell id="qgdV0KhxuuxavuWXjZ00-2" value="knot" style="sketch=0;points=[[0.5,0,0],[1,0.5,0],[0.5,1,0],[0,0.5,0],[0.145,0.145,0],[0.8555,0.145,0],[0.855,0.8555,0],[0.145,0.855,0]];verticalLabelPosition=top;html=1;verticalAlign=bottom;aspect=fixed;align=center;pointerEvents=1;shape=mxgraph.cisco19.rect;prIcon=router;fillColor=#FAFAFA;strokeColor=#005073;labelPosition=center;fontStyle=1" parent="1" vertex="1"> + <mxGeometry x="200" y="120" width="40" height="40" as="geometry" /> + </mxCell> + <mxCell id="qgdV0KhxuuxavuWXjZ00-8" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=none;endFill=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;entryPerimeter=0;exitX=0.145;exitY=0.145;exitDx=0;exitDy=0;exitPerimeter=0;" parent="1" source="qgdV0KhxuuxavuWXjZ00-3" target="qgdV0KhxuuxavuWXjZ00-1" edge="1"> + <mxGeometry relative="1" as="geometry"> + <mxPoint x="420" y="230" as="sourcePoint" /> + </mxGeometry> + </mxCell> + <mxCell id="qgdV0KhxuuxavuWXjZ00-14" value="::3" style="edgeLabel;html=1;align=right;verticalAlign=top;resizable=0;points=[];labelPosition=left;verticalLabelPosition=bottom;" parent="qgdV0KhxuuxavuWXjZ00-8" vertex="1" connectable="0"> + <mxGeometry x="1" relative="1" as="geometry"> + <mxPoint as="offset" /> + </mxGeometry> + </mxCell> + <mxCell id="qgdV0KhxuuxavuWXjZ00-20" value="::9" style="edgeLabel;html=1;align=left;verticalAlign=bottom;resizable=0;points=[];labelPosition=right;verticalLabelPosition=top;" parent="qgdV0KhxuuxavuWXjZ00-8" vertex="1" connectable="0"> + <mxGeometry x="-0.9" relative="1" as="geometry"> + <mxPoint as="offset" /> + </mxGeometry> + </mxCell> + <mxCell id="qgdV0KhxuuxavuWXjZ00-6" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=none;endFill=0;entryX=0.145;entryY=0.855;entryDx=0;entryDy=0;entryPerimeter=0;exitX=0.8555;exitY=0.145;exitDx=0;exitDy=0;exitPerimeter=0;" parent="1" source="qgdV0KhxuuxavuWXjZ00-4" target="qgdV0KhxuuxavuWXjZ00-1" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="qgdV0KhxuuxavuWXjZ00-16" value="::5" style="edgeLabel;html=1;align=left;verticalAlign=middle;resizable=0;points=[];labelPosition=right;verticalLabelPosition=middle;" parent="qgdV0KhxuuxavuWXjZ00-6" vertex="1" connectable="0"> + <mxGeometry x="-0.9" relative="1" as="geometry"> + <mxPoint y="6" as="offset" /> + </mxGeometry> + </mxCell> + <mxCell id="qgdV0KhxuuxavuWXjZ00-21" value="::10" style="edgeLabel;html=1;align=right;verticalAlign=bottom;resizable=0;points=[];labelPosition=left;verticalLabelPosition=top;" parent="qgdV0KhxuuxavuWXjZ00-6" vertex="1" connectable="0"> + <mxGeometry x="0.95" relative="1" as="geometry"> + <mxPoint as="offset" /> + </mxGeometry> + </mxCell> + <mxCell id="qgdV0KhxuuxavuWXjZ00-4" value="kv24ix" style="sketch=0;points=[[0.5,0,0],[1,0.5,0],[0.5,1,0],[0,0.5,0],[0.145,0.145,0],[0.8555,0.145,0],[0.855,0.8555,0],[0.145,0.855,0]];verticalLabelPosition=bottom;html=1;verticalAlign=top;aspect=fixed;align=center;pointerEvents=1;shape=mxgraph.cisco19.rect;prIcon=router;fillColor=#FAFAFA;strokeColor=#005073;fontStyle=1" parent="1" vertex="1"> + <mxGeometry x="160" y="240" width="40" height="40" as="geometry" /> + </mxCell> + <mxCell id="qgdV0KhxuuxavuWXjZ00-5" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=1;entryDx=0;entryDy=0;entryPerimeter=0;endArrow=none;endFill=0;exitX=0.8555;exitY=0.145;exitDx=0;exitDy=0;exitPerimeter=0;" parent="1" source="qgdV0KhxuuxavuWXjZ00-4" target="qgdV0KhxuuxavuWXjZ00-2" edge="1"> + <mxGeometry relative="1" as="geometry"> + <mxPoint x="110" y="360" as="sourcePoint" /> + </mxGeometry> + </mxCell> + <mxCell id="qgdV0KhxuuxavuWXjZ00-18" value="::7" style="edgeLabel;html=1;align=left;verticalAlign=top;resizable=0;points=[];labelPosition=right;verticalLabelPosition=bottom;" parent="qgdV0KhxuuxavuWXjZ00-5" vertex="1" connectable="0"> + <mxGeometry x="0.9" relative="1" as="geometry"> + <mxPoint as="offset" /> + </mxGeometry> + </mxCell> + <mxCell id="qgdV0KhxuuxavuWXjZ00-40" value="::6" style="edgeLabel;html=1;align=right;verticalAlign=bottom;resizable=0;points=[];labelPosition=left;verticalLabelPosition=top;" parent="qgdV0KhxuuxavuWXjZ00-5" vertex="1" connectable="0"> + <mxGeometry x="-0.9" relative="1" as="geometry"> + <mxPoint as="offset" /> + </mxGeometry> + </mxCell> + <mxCell id="qgdV0KhxuuxavuWXjZ00-7" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=none;endFill=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;entryPerimeter=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;exitPerimeter=0;" parent="1" source="qgdV0KhxuuxavuWXjZ00-2" target="qgdV0KhxuuxavuWXjZ00-1" edge="1"> + <mxGeometry relative="1" as="geometry"> + <mxPoint x="250" y="110" as="sourcePoint" /> + <mxPoint x="340" y="120" as="targetPoint" /> + </mxGeometry> + </mxCell> + <mxCell id="qgdV0KhxuuxavuWXjZ00-12" value="::1" style="edgeLabel;html=1;align=left;verticalAlign=bottom;resizable=0;points=[];labelPosition=right;verticalLabelPosition=top;" parent="qgdV0KhxuuxavuWXjZ00-7" vertex="1" connectable="0"> + <mxGeometry x="-1" relative="1" as="geometry"> + <mxPoint as="offset" /> + </mxGeometry> + </mxCell> + <mxCell id="qgdV0KhxuuxavuWXjZ00-13" value="::2" style="edgeLabel;html=1;align=right;verticalAlign=bottom;resizable=0;points=[];labelPosition=left;verticalLabelPosition=top;" parent="qgdV0KhxuuxavuWXjZ00-7" vertex="1" connectable="0"> + <mxGeometry x="1" relative="1" as="geometry"> + <mxPoint as="offset" /> + </mxGeometry> + </mxCell> + <mxCell id="qgdV0KhxuuxavuWXjZ00-10" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.855;entryY=0.8555;entryDx=0;entryDy=0;entryPerimeter=0;endArrow=none;endFill=0;exitX=0.145;exitY=0.145;exitDx=0;exitDy=0;exitPerimeter=0;" parent="1" source="qgdV0KhxuuxavuWXjZ00-3" target="qgdV0KhxuuxavuWXjZ00-2" edge="1"> + <mxGeometry relative="1" as="geometry"> + <mxPoint x="380" y="220" as="targetPoint" /> + </mxGeometry> + </mxCell> + <mxCell id="qgdV0KhxuuxavuWXjZ00-15" value="::4" style="edgeLabel;html=1;align=right;verticalAlign=top;resizable=0;points=[];labelPosition=left;verticalLabelPosition=bottom;" parent="qgdV0KhxuuxavuWXjZ00-10" vertex="1" connectable="0"> + <mxGeometry x="-0.9" relative="1" as="geometry"> + <mxPoint as="offset" /> + </mxGeometry> + </mxCell> + <mxCell id="qgdV0KhxuuxavuWXjZ00-19" value="::8" style="edgeLabel;html=1;align=left;verticalAlign=bottom;resizable=0;points=[];labelPosition=right;verticalLabelPosition=top;" parent="qgdV0KhxuuxavuWXjZ00-10" vertex="1" connectable="0"> + <mxGeometry x="0.94" relative="1" as="geometry"> + <mxPoint as="offset" /> + </mxGeometry> + </mxCell> + <mxCell id="qgdV0KhxuuxavuWXjZ00-22" value="conflatorio" style="sketch=0;points=[[0.5,0,0],[1,0.5,0],[0.5,1,0],[0,0.5,0],[0.145,0.145,0],[0.8555,0.145,0],[0.855,0.8555,0],[0.145,0.855,0]];verticalLabelPosition=bottom;html=1;verticalAlign=top;aspect=fixed;align=center;pointerEvents=1;shape=mxgraph.cisco19.rect;prIcon=router;fillColor=#FAFAFA;strokeColor=#005073;fontStyle=1" parent="1" vertex="1"> + <mxGeometry x="520" y="240" width="40" height="40" as="geometry" /> + </mxCell> + <mxCell id="qgdV0KhxuuxavuWXjZ00-24" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=none;endFill=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;entryPerimeter=0;exitX=0;exitY=0.5;exitDx=0;exitDy=0;exitPerimeter=0;" parent="1" source="qgdV0KhxuuxavuWXjZ00-22" target="qgdV0KhxuuxavuWXjZ00-3" edge="1"> + <mxGeometry relative="1" as="geometry"> + <mxPoint x="430" y="250" as="sourcePoint" /> + <mxPoint x="390" y="170" as="targetPoint" /> + </mxGeometry> + </mxCell> + <mxCell id="qgdV0KhxuuxavuWXjZ00-25" value="::11" style="edgeLabel;html=1;align=left;verticalAlign=bottom;resizable=0;points=[];labelPosition=right;verticalLabelPosition=top;" parent="qgdV0KhxuuxavuWXjZ00-24" vertex="1" connectable="0"> + <mxGeometry x="0.9" relative="1" as="geometry"> + <mxPoint as="offset" /> + </mxGeometry> + </mxCell> + <mxCell id="qgdV0KhxuuxavuWXjZ00-26" value="::12" style="edgeLabel;html=1;align=right;verticalAlign=bottom;resizable=0;points=[];labelPosition=left;verticalLabelPosition=top;" parent="qgdV0KhxuuxavuWXjZ00-24" vertex="1" connectable="0"> + <mxGeometry x="-0.9" relative="1" as="geometry"> + <mxPoint as="offset" /> + </mxGeometry> + </mxCell> + <mxCell id="qgdV0KhxuuxavuWXjZ00-28" value="f11b" style="ellipse;shape=cloud;whiteSpace=wrap;html=1;" parent="1" vertex="1"> + <mxGeometry x="70" y="70" width="80" height="40" as="geometry" /> + </mxCell> + <mxCell id="qgdV0KhxuuxavuWXjZ00-29" value="cd02" style="ellipse;shape=cloud;whiteSpace=wrap;html=1;" parent="1" vertex="1"> + <mxGeometry x="60" y="210" width="80" height="40" as="geometry" /> + </mxCell> + <mxCell id="qgdV0KhxuuxavuWXjZ00-30" value="dbe1" style="ellipse;shape=cloud;whiteSpace=wrap;html=1;" parent="1" vertex="1"> + <mxGeometry x="280" y="320" width="80" height="40" as="geometry" /> + </mxCell> + <mxCell id="qgdV0KhxuuxavuWXjZ00-31" value="ab69" style="ellipse;shape=cloud;whiteSpace=wrap;html=1;" parent="1" vertex="1"> + <mxGeometry x="450" y="330" width="80" height="40" as="geometry" /> + </mxCell> + <mxCell id="qgdV0KhxuuxavuWXjZ00-32" value="e5b0" style="ellipse;shape=cloud;whiteSpace=wrap;html=1;" parent="1" vertex="1"> + <mxGeometry x="440" y="50" width="80" height="40" as="geometry" /> + </mxCell> + <mxCell id="qgdV0KhxuuxavuWXjZ00-33" value="78e1" style="ellipse;shape=cloud;whiteSpace=wrap;html=1;" parent="1" vertex="1"> + <mxGeometry x="580" y="180" width="80" height="40" as="geometry" /> + </mxCell> + <mxCell id="qgdV0KhxuuxavuWXjZ00-34" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=none;endFill=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;entryPerimeter=0;exitX=0.8;exitY=0.8;exitDx=0;exitDy=0;exitPerimeter=0;" parent="1" source="qgdV0KhxuuxavuWXjZ00-28" target="qgdV0KhxuuxavuWXjZ00-2" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="qgdV0KhxuuxavuWXjZ00-35" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=none;endFill=0;exitX=0.8;exitY=0.8;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;entryPerimeter=0;" parent="1" source="qgdV0KhxuuxavuWXjZ00-29" target="qgdV0KhxuuxavuWXjZ00-4" edge="1"> + <mxGeometry relative="1" as="geometry"> + <mxPoint x="158" y="124" as="sourcePoint" /> + <mxPoint x="210" y="150" as="targetPoint" /> + </mxGeometry> + </mxCell> + <mxCell id="qgdV0KhxuuxavuWXjZ00-36" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.855;entryY=0.8555;entryDx=0;entryDy=0;entryPerimeter=0;endArrow=none;endFill=0;exitX=0.4;exitY=0.1;exitDx=0;exitDy=0;exitPerimeter=0;" parent="1" source="qgdV0KhxuuxavuWXjZ00-31" target="qgdV0KhxuuxavuWXjZ00-3" edge="1"> + <mxGeometry relative="1" as="geometry"> + <mxPoint x="138" y="286" as="sourcePoint" /> + <mxPoint x="170" y="270" as="targetPoint" /> + </mxGeometry> + </mxCell> + <mxCell id="qgdV0KhxuuxavuWXjZ00-37" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.145;entryY=0.855;entryDx=0;entryDy=0;entryPerimeter=0;endArrow=none;endFill=0;exitX=0.88;exitY=0.25;exitDx=0;exitDy=0;exitPerimeter=0;" parent="1" source="qgdV0KhxuuxavuWXjZ00-30" target="qgdV0KhxuuxavuWXjZ00-3" edge="1"> + <mxGeometry relative="1" as="geometry"> + <mxPoint x="148" y="296" as="sourcePoint" /> + <mxPoint x="180" y="280" as="targetPoint" /> + </mxGeometry> + </mxCell> + <mxCell id="qgdV0KhxuuxavuWXjZ00-38" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=none;endFill=0;exitX=0.13;exitY=0.77;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.8555;entryY=0.145;entryDx=0;entryDy=0;entryPerimeter=0;" parent="1" source="qgdV0KhxuuxavuWXjZ00-33" target="qgdV0KhxuuxavuWXjZ00-22" edge="1"> + <mxGeometry relative="1" as="geometry"> + <mxPoint x="472" y="350" as="sourcePoint" /> + <mxPoint x="444" y="284" as="targetPoint" /> + </mxGeometry> + </mxCell> + <mxCell id="qgdV0KhxuuxavuWXjZ00-39" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=none;endFill=0;entryX=0.8555;entryY=0.145;entryDx=0;entryDy=0;entryPerimeter=0;exitX=0.13;exitY=0.77;exitDx=0;exitDy=0;exitPerimeter=0;" parent="1" source="qgdV0KhxuuxavuWXjZ00-32" target="qgdV0KhxuuxavuWXjZ00-1" edge="1"> + <mxGeometry relative="1" as="geometry"> + <mxPoint x="602" y="244" as="sourcePoint" /> + <mxPoint x="570" y="260" as="targetPoint" /> + </mxGeometry> + </mxCell> + </root> + </mxGraphModel> + </diagram> + <diagram id="nSABVEWmQI0BlYm3Q41k" name="Processing"> + <mxGraphModel dx="2074" dy="1198" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1169" pageHeight="827" math="0" shadow="0"> + <root> + <mxCell id="0" /> + <mxCell id="1" parent="0" /> + <mxCell id="rF8hUq1je10sbddVmS0I-5" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="rF8hUq1je10sbddVmS0I-1" target="rF8hUq1je10sbddVmS0I-3" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="rF8hUq1je10sbddVmS0I-6" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontStyle=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="rF8hUq1je10sbddVmS0I-1" target="rF8hUq1je10sbddVmS0I-4" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="rF8hUq1je10sbddVmS0I-13" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="rF8hUq1je10sbddVmS0I-1" target="rF8hUq1je10sbddVmS0I-12" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="-XoDwskljkkj49KLHc14-8" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.25;entryDx=0;entryDy=0;" parent="1" source="rF8hUq1je10sbddVmS0I-1" target="rF8hUq1je10sbddVmS0I-16" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="rF8hUq1je10sbddVmS0I-1" value="BGP routers" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" vertex="1"> + <mxGeometry x="360" y="160" width="120" height="40" as="geometry" /> + </mxCell> + <mxCell id="rF8hUq1je10sbddVmS0I-3" value="bird.conf" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1"> + <mxGeometry x="520" y="160" width="120" height="40" as="geometry" /> + </mxCell> + <mxCell id="-XoDwskljkkj49KLHc14-2" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="rF8hUq1je10sbddVmS0I-4" target="-XoDwskljkkj49KLHc14-1" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="rF8hUq1je10sbddVmS0I-4" value="wireguard interfaces" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1"> + <mxGeometry x="520" y="240" width="120" height="40" as="geometry" /> + </mxCell> + <mxCell id="rF8hUq1je10sbddVmS0I-9" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="rF8hUq1je10sbddVmS0I-8" target="rF8hUq1je10sbddVmS0I-1" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="rF8hUq1je10sbddVmS0I-15" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="rF8hUq1je10sbddVmS0I-8" target="rF8hUq1je10sbddVmS0I-14" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="rF8hUq1je10sbddVmS0I-8" value="Hosts<br>Local networks" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1"> + <mxGeometry x="200" y="160" width="120" height="40" as="geometry" /> + </mxCell> + <mxCell id="rF8hUq1je10sbddVmS0I-11" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="rF8hUq1je10sbddVmS0I-10" target="rF8hUq1je10sbddVmS0I-1" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="rF8hUq1je10sbddVmS0I-10" value="Remote ASes" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1"> + <mxGeometry x="360" y="80" width="120" height="40" as="geometry" /> + </mxCell> + <mxCell id="rF8hUq1je10sbddVmS0I-12" value="Networks" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1"> + <mxGeometry x="520" y="320" width="120" height="40" as="geometry" /> + </mxCell> + <mxCell id="rF8hUq1je10sbddVmS0I-18" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="rF8hUq1je10sbddVmS0I-14" target="rF8hUq1je10sbddVmS0I-16" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="rF8hUq1je10sbddVmS0I-14" value="Applications" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1"> + <mxGeometry x="360" y="400" width="120" height="40" as="geometry" /> + </mxCell> + <mxCell id="rF8hUq1je10sbddVmS0I-16" value="Firewall rules" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1"> + <mxGeometry x="520" y="400" width="120" height="40" as="geometry" /> + </mxCell> + <mxCell id="rF8hUq1je10sbddVmS0I-19" value="Wireguard Telegraf configuration" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1"> + <mxGeometry x="840" y="240" width="120" height="40" as="geometry" /> + </mxCell> + <mxCell id="-XoDwskljkkj49KLHc14-3" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="-XoDwskljkkj49KLHc14-1" target="rF8hUq1je10sbddVmS0I-19" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="-XoDwskljkkj49KLHc14-1" value="Wireguard Telegraf configuration" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" vertex="1"> + <mxGeometry x="680" y="240" width="120" height="40" as="geometry" /> + </mxCell> + <mxCell id="-XoDwskljkkj49KLHc14-5" value="data" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1"> + <mxGeometry x="880" y="40" width="120" height="40" as="geometry" /> + </mxCell> + <mxCell id="-XoDwskljkkj49KLHc14-7" value="rules" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" vertex="1"> + <mxGeometry x="880" y="120" width="120" height="40" as="geometry" /> + </mxCell> + </root> + </mxGraphModel> + </diagram> + <diagram id="KZKIfHUl2okZInCISHyk" name="tnet - new"> + <mxGraphModel dx="1257" dy="745" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1169" pageHeight="827" math="0" shadow="0"> + <root> + <mxCell id="0" /> + <mxCell id="1" parent="0" /> + <mxCell id="rOxvz-1gei3paqyAHtll-16" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=none;endFill=0;spacing=4;" parent="1" source="rOxvz-1gei3paqyAHtll-11" target="rOxvz-1gei3paqyAHtll-13" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="rOxvz-1gei3paqyAHtll-11" value="knot<br>2004::ffff" style="sketch=0;points=[[0.5,0,0],[1,0.5,0],[0.5,1,0],[0,0.5,0],[0.145,0.145,0],[0.8555,0.145,0],[0.855,0.8555,0],[0.145,0.855,0]];verticalLabelPosition=top;html=1;verticalAlign=bottom;aspect=fixed;align=right;pointerEvents=1;shape=mxgraph.cisco19.rect;prIcon=router;fillColor=#FAFAFA;strokeColor=#005073;labelPosition=left;spacing=4;" parent="1" vertex="1"> + <mxGeometry x="680" y="160" width="40" height="40" as="geometry" /> + </mxCell> + <mxCell id="rOxvz-1gei3paqyAHtll-12" value="dn42" style="ellipse;shape=cloud;whiteSpace=wrap;html=1;" parent="1" vertex="1"> + <mxGeometry x="520" y="20" width="120" height="80" as="geometry" /> + </mxCell> + <mxCell id="rOxvz-1gei3paqyAHtll-13" value="hash<br>2009:ffff" style="sketch=0;points=[[0.5,0,0],[1,0.5,0],[0.5,1,0],[0,0.5,0],[0.145,0.145,0],[0.8555,0.145,0],[0.855,0.8555,0],[0.145,0.855,0]];verticalLabelPosition=top;html=1;verticalAlign=bottom;aspect=fixed;align=right;pointerEvents=1;shape=mxgraph.cisco19.rect;prIcon=router;fillColor=#FAFAFA;strokeColor=#005073;labelPosition=left;spacing=4;" parent="1" vertex="1"> + <mxGeometry x="400" y="160" width="40" height="40" as="geometry" /> + </mxCell> + <mxCell id="rOxvz-1gei3paqyAHtll-14" value="lhn2ix" style="sketch=0;points=[[0.5,0,0],[1,0.5,0],[0.5,1,0],[0,0.5,0],[0.145,0.145,0],[0.8555,0.145,0],[0.855,0.8555,0],[0.145,0.855,0]];verticalLabelPosition=middle;html=1;verticalAlign=middle;aspect=fixed;align=left;pointerEvents=1;shape=mxgraph.cisco19.rect;prIcon=router;labelPosition=right;spacing=4;fillColor=#eeeeee;strokeColor=#36393d;fillStyle=auto;" parent="1" vertex="1"> + <mxGeometry x="480" y="480" width="40" height="40" as="geometry" /> + </mxCell> + <mxCell id="rOxvz-1gei3paqyAHtll-19" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=none;endFill=0;" parent="1" source="rOxvz-1gei3paqyAHtll-15" target="rOxvz-1gei3paqyAHtll-12" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="rOxvz-1gei3paqyAHtll-15" value="routedbits-lon1" style="sketch=0;points=[[0.5,0,0],[1,0.5,0],[0.5,1,0],[0,0.5,0],[0.145,0.145,0],[0.8555,0.145,0],[0.855,0.8555,0],[0.145,0.855,0]];verticalLabelPosition=middle;html=1;verticalAlign=middle;aspect=fixed;align=left;pointerEvents=1;shape=mxgraph.cisco19.rect;prIcon=router;fillColor=#FAFAFA;strokeColor=#005073;labelPosition=right;spacing=4;" parent="1" vertex="1"> + <mxGeometry x="680" y="40" width="40" height="40" as="geometry" /> + </mxCell> + <mxCell id="rOxvz-1gei3paqyAHtll-17" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=none;endFill=0;" parent="1" source="rOxvz-1gei3paqyAHtll-11" target="rOxvz-1gei3paqyAHtll-15" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="rOxvz-1gei3paqyAHtll-47" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=none;endFill=0;entryX=0.498;entryY=0.112;entryDx=0;entryDy=0;entryPerimeter=0;" parent="1" source="rOxvz-1gei3paqyAHtll-18" target="rOxvz-1gei3paqyAHtll-46" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="rOxvz-1gei3paqyAHtll-18" value="lhn2pi" style="sketch=0;points=[[0.5,0,0],[1,0.5,0],[0.5,1,0],[0,0.5,0],[0.145,0.145,0],[0.8555,0.145,0],[0.855,0.8555,0],[0.145,0.855,0]];verticalLabelPosition=middle;html=1;verticalAlign=middle;aspect=fixed;align=left;pointerEvents=1;shape=mxgraph.cisco19.rect;prIcon=router;fillColor=#FAFAFA;strokeColor=#005073;labelPosition=right;spacing=4;" parent="1" vertex="1"> + <mxGeometry x="600" y="480" width="40" height="40" as="geometry" /> + </mxCell> + <mxCell id="rOxvz-1gei3paqyAHtll-23" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=none;endFill=0;spacing=4;entryX=0.086;entryY=0.76;entryDx=0;entryDy=0;entryPerimeter=0;" parent="1" source="rOxvz-1gei3paqyAHtll-20" target="rOxvz-1gei3paqyAHtll-11" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="rOxvz-1gei3paqyAHtll-24" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=none;endFill=0;spacing=4;" parent="1" source="rOxvz-1gei3paqyAHtll-20" target="rOxvz-1gei3paqyAHtll-13" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="rOxvz-1gei3paqyAHtll-20" value="node1" style="sketch=0;points=[[0.5,0,0],[1,0.5,0],[0.5,1,0],[0,0.5,0],[0.145,0.145,0],[0.8555,0.145,0],[0.855,0.8555,0],[0.145,0.855,0]];verticalLabelPosition=middle;html=1;verticalAlign=middle;aspect=fixed;align=left;pointerEvents=1;shape=mxgraph.cisco19.rect;prIcon=router;fillColor=#FAFAFA;strokeColor=#005073;labelPosition=right;spacing=4;" parent="1" vertex="1"> + <mxGeometry x="160" y="480" width="40" height="40" as="geometry" /> + </mxCell> + <mxCell id="rOxvz-1gei3paqyAHtll-22" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=none;endFill=0;spacing=4;entryX=0.122;entryY=0.827;entryDx=0;entryDy=0;entryPerimeter=0;" parent="1" source="rOxvz-1gei3paqyAHtll-21" target="rOxvz-1gei3paqyAHtll-11" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="rOxvz-1gei3paqyAHtll-25" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=none;endFill=0;spacing=4;" parent="1" source="rOxvz-1gei3paqyAHtll-21" target="rOxvz-1gei3paqyAHtll-13" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="rOxvz-1gei3paqyAHtll-21" value="node2" style="sketch=0;points=[[0.5,0,0],[1,0.5,0],[0.5,1,0],[0,0.5,0],[0.145,0.145,0],[0.8555,0.145,0],[0.855,0.8555,0],[0.145,0.855,0]];verticalLabelPosition=middle;html=1;verticalAlign=middle;aspect=fixed;align=left;pointerEvents=1;shape=mxgraph.cisco19.rect;prIcon=router;fillColor=#FAFAFA;strokeColor=#005073;labelPosition=right;spacing=4;" parent="1" vertex="1"> + <mxGeometry x="320" y="480" width="40" height="40" as="geometry" /> + </mxCell> + <mxCell id="rOxvz-1gei3paqyAHtll-26" value="node1<br>2002" style="ellipse;shape=cloud;whiteSpace=wrap;html=1;" parent="1" vertex="1"> + <mxGeometry x="120" y="560" width="120" height="80" as="geometry" /> + </mxCell> + <mxCell id="rOxvz-1gei3paqyAHtll-27" value="node2<br>2003" style="ellipse;shape=cloud;whiteSpace=wrap;html=1;" parent="1" vertex="1"> + <mxGeometry x="280" y="560" width="120" height="80" as="geometry" /> + </mxCell> + <mxCell id="rOxvz-1gei3paqyAHtll-30" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=none;endFill=0;entryX=0.5;entryY=0.108;entryDx=0;entryDy=0;entryPerimeter=0;" parent="1" source="rOxvz-1gei3paqyAHtll-21" target="rOxvz-1gei3paqyAHtll-27" edge="1"> + <mxGeometry relative="1" as="geometry"> + <mxPoint x="90" y="503" as="sourcePoint" /> + <mxPoint x="620" y="257" as="targetPoint" /> + </mxGeometry> + </mxCell> + <mxCell id="rOxvz-1gei3paqyAHtll-31" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=none;endFill=0;entryX=0.5;entryY=0.107;entryDx=0;entryDy=0;entryPerimeter=0;" parent="1" source="rOxvz-1gei3paqyAHtll-20" target="rOxvz-1gei3paqyAHtll-26" edge="1"> + <mxGeometry relative="1" as="geometry"> + <mxPoint x="200" y="519" as="sourcePoint" /> + <mxPoint x="119" y="531" as="targetPoint" /> + </mxGeometry> + </mxCell> + <mxCell id="rOxvz-1gei3paqyAHtll-43" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=none;endFill=0;entryX=0.5;entryY=0.105;entryDx=0;entryDy=0;entryPerimeter=0;" parent="1" source="rOxvz-1gei3paqyAHtll-32" target="rOxvz-1gei3paqyAHtll-40" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="rOxvz-1gei3paqyAHtll-44" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=none;endFill=0;spacing=4;entryX=0.805;entryY=0.904;entryDx=0;entryDy=0;entryPerimeter=0;exitX=0.211;exitY=0.092;exitDx=0;exitDy=0;exitPerimeter=0;" parent="1" source="rOxvz-1gei3paqyAHtll-32" target="rOxvz-1gei3paqyAHtll-11" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="rOxvz-1gei3paqyAHtll-32" value="coregonus" style="sketch=0;points=[[0.5,0,0],[1,0.5,0],[0.5,1,0],[0,0.5,0],[0.145,0.145,0],[0.8555,0.145,0],[0.855,0.8555,0],[0.145,0.855,0]];verticalLabelPosition=middle;html=1;verticalAlign=middle;aspect=fixed;align=left;pointerEvents=1;shape=mxgraph.cisco19.rect;prIcon=router;fillColor=#FAFAFA;strokeColor=#005073;labelPosition=right;spacing=4;snapToPoint=0;" parent="1" vertex="1"> + <mxGeometry x="920" y="480" width="40" height="40" as="geometry" /> + </mxCell> + <mxCell id="rOxvz-1gei3paqyAHtll-38" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=none;endFill=0;entryX=0.5;entryY=0.947;entryDx=0;entryDy=0;entryPerimeter=0;" parent="1" source="rOxvz-1gei3paqyAHtll-37" target="rOxvz-1gei3paqyAHtll-46" edge="1"> + <mxGeometry relative="1" as="geometry"> + <mxPoint x="780" y="640" as="targetPoint" /> + </mxGeometry> + </mxCell> + <mxCell id="rOxvz-1gei3paqyAHtll-37" value="danneri" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1"> + <mxGeometry x="580" y="680" width="80" height="40" as="geometry" /> + </mxCell> + <mxCell id="rOxvz-1gei3paqyAHtll-39" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=none;endFill=0;spacing=4;entryX=0.374;entryY=0.976;entryDx=0;entryDy=0;entryPerimeter=0;exitX=0.619;exitY=0.022;exitDx=0;exitDy=0;exitPerimeter=0;" parent="1" source="rOxvz-1gei3paqyAHtll-18" target="rOxvz-1gei3paqyAHtll-11" edge="1"> + <mxGeometry relative="1" as="geometry"> + <mxPoint x="490" y="200" as="targetPoint" /> + </mxGeometry> + </mxCell> + <mxCell id="rOxvz-1gei3paqyAHtll-40" value="2005" style="ellipse;shape=cloud;whiteSpace=wrap;html=1;" parent="1" vertex="1"> + <mxGeometry x="880" y="560" width="120" height="80" as="geometry" /> + </mxCell> + <mxCell id="rOxvz-1gei3paqyAHtll-45" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=none;endFill=0;entryX=0.5;entryY=0.947;entryDx=0;entryDy=0;entryPerimeter=0;" parent="1" source="rOxvz-1gei3paqyAHtll-41" target="rOxvz-1gei3paqyAHtll-40" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="rOxvz-1gei3paqyAHtll-41" value="akili" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1"> + <mxGeometry x="900" y="680" width="80" height="40" as="geometry" /> + </mxCell> + <mxCell id="rOxvz-1gei3paqyAHtll-46" value="2008" style="ellipse;shape=cloud;whiteSpace=wrap;html=1;" parent="1" vertex="1"> + <mxGeometry x="560" y="560" width="120" height="80" as="geometry" /> + </mxCell> + <mxCell id="eAi0Ebt_qy5pI5aUobQS-5" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=none;endFill=0;entryX=0.238;entryY=0.083;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1" source="rOxvz-1gei3paqyAHtll-13" target="rOxvz-1gei3paqyAHtll-18"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + </root> + </mxGraphModel> + </diagram> +</mxfile> diff --git a/docs/new-vm.md b/docs/new-vm.md new file mode 100644 index 0000000..76e4eea --- /dev/null +++ b/docs/new-vm.md @@ -0,0 +1,37 @@ +Download generic cloud image: + + cd /data3/libvirt/images/pool/ + export TS=20240717-1811 + wget https://cloud.debian.org/images/cloud/bookworm/$TS/debian-12-genericcloud-amd64-$TS.qcow2 + cp debian-*-$TS.qcow2 $VM.qcow2 + qemu-img resize $VM.qcow2 20G + # This requires guestfs-tools + virt-resize --expand /dev/sda1 debian-*$TS.qcow2 $VM.qcow2 + +Inject SSH key for root user: + + virt-customize \ + --add /data3/libvirt/images/pool/$VM.qcow2 \ + --root-password password:root \ + --hostname $VM \ + --firstboot-command 'ssh-keygen -A && systemctl restart sshd' \ + --ssh-inject "root:file:$(echo ~trygvis/.ssh/id_ed25519.pub)" + +Register a new VM with Virtual Machine Manager. + + * Import existing disk image + * Select $VM.qcow2, select correct OS + * Set name to $VM, use "Bridge device", enter `br0`. + +Connect to the machine, log in as root/root and run `dhclient enp1s0`. + +Add host to Ansible inventory `ansible/inventory`. + +SSH to the host first so the host's fingerprint is saved: + + ssh $VM + +Apply users playbook: + + ansible-playbook ansible/plays/users.yml -l $VM -u root -k + ansible-playbook plays/danneri.yml diff --git a/docs/wg0 - 2023-10-23.drawio b/docs/wg0 - 2023-10-23.drawio new file mode 100644 index 0000000..c4fb932 --- /dev/null +++ b/docs/wg0 - 2023-10-23.drawio @@ -0,0 +1,105 @@ +<mxfile host="Electron" modified="2023-10-23T11:52:11.884Z" agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/22.0.2 Chrome/114.0.5735.289 Electron/25.8.4 Safari/537.36" etag="pchNw836AFK198TFqVm4" version="22.0.2" type="device"> + <diagram name="Page-1" id="v7i8TAT-5xv207MUNhIB"> + <mxGraphModel dx="2074" dy="1198" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1169" pageHeight="827" math="0" shadow="0"> + <root> + <mxCell id="0" /> + <mxCell id="1" parent="0" /> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-8" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=classic;endFill=1;" parent="1" source="UDWjvm1ZnLB2DU_sOnAa-1" target="UDWjvm1ZnLB2DU_sOnAa-5" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-11" style="edgeStyle=none;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=classic;endFill=1;exitX=0.855;exitY=0.8555;exitDx=0;exitDy=0;exitPerimeter=0;" parent="1" source="UDWjvm1ZnLB2DU_sOnAa-1" target="UDWjvm1ZnLB2DU_sOnAa-4" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-1" value="conflatorio<br>wg0::3" style="sketch=0;points=[[0.5,0,0],[1,0.5,0],[0.5,1,0],[0,0.5,0],[0.145,0.145,0],[0.8555,0.145,0],[0.855,0.8555,0],[0.145,0.855,0]];verticalLabelPosition=middle;html=1;verticalAlign=middle;aspect=fixed;align=right;pointerEvents=1;shape=mxgraph.cisco19.rect;prIcon=router;fillColor=#FAFAFA;strokeColor=#005073;labelPosition=left;" parent="1" vertex="1"> + <mxGeometry x="350" y="240" width="50" height="50" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-9" style="edgeStyle=none;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=classic;endFill=1;exitX=0.145;exitY=0.145;exitDx=0;exitDy=0;exitPerimeter=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;entryPerimeter=0;" parent="1" source="UDWjvm1ZnLB2DU_sOnAa-2" target="UDWjvm1ZnLB2DU_sOnAa-5" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-10" style="edgeStyle=none;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=classic;endFill=1;exitX=0.145;exitY=0.855;exitDx=0;exitDy=0;exitPerimeter=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;entryPerimeter=0;" parent="1" source="UDWjvm1ZnLB2DU_sOnAa-2" target="UDWjvm1ZnLB2DU_sOnAa-4" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-26" value="eno1" style="edgeStyle=none;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=classic;endFill=1;" parent="1" source="UDWjvm1ZnLB2DU_sOnAa-2" target="UDWjvm1ZnLB2DU_sOnAa-28" edge="1"> + <mxGeometry relative="1" as="geometry"> + <mxPoint x="980" y="300" as="targetPoint" /> + </mxGeometry> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-32" value="enp2s0" style="edgeStyle=none;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=classic;endFill=1;" parent="1" source="yd4OAxL_OL2nS1uvAmHJ-6" target="UDWjvm1ZnLB2DU_sOnAa-33" edge="1"> + <mxGeometry relative="1" as="geometry"> + <mxPoint x="960" y="360" as="targetPoint" /> + </mxGeometry> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-2" value="akili<br>wg0:&nbsp;fdf3:aad9:a885:b3a::7/64" style="sketch=0;points=[[0.5,0,0],[1,0.5,0],[0.5,1,0],[0,0.5,0],[0.145,0.145,0],[0.8555,0.145,0],[0.855,0.8555,0],[0.145,0.855,0]];verticalLabelPosition=middle;html=1;verticalAlign=middle;aspect=fixed;align=left;pointerEvents=1;shape=mxgraph.cisco19.rect;prIcon=router;fillColor=#FAFAFA;strokeColor=#005073;labelPosition=right;" parent="1" vertex="1"> + <mxGeometry x="840" y="340" width="50" height="50" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-14" style="edgeStyle=none;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=classic;endFill=1;" parent="1" source="UDWjvm1ZnLB2DU_sOnAa-3" target="UDWjvm1ZnLB2DU_sOnAa-4" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-15" style="edgeStyle=none;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=classic;endFill=1;exitX=0.8555;exitY=0.145;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.209;entryY=0.791;entryDx=0;entryDy=0;entryPerimeter=0;" parent="1" source="UDWjvm1ZnLB2DU_sOnAa-3" target="UDWjvm1ZnLB2DU_sOnAa-5" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-3" value="arius" style="sketch=0;points=[[0.5,0,0],[1,0.5,0],[0.5,1,0],[0,0.5,0],[0.145,0.145,0],[0.8555,0.145,0],[0.855,0.8555,0],[0.145,0.855,0]];verticalLabelPosition=bottom;html=1;verticalAlign=top;aspect=fixed;align=center;pointerEvents=1;shape=mxgraph.cisco19.rect;prIcon=router;fillColor=#FAFAFA;strokeColor=#005073;" parent="1" vertex="1"> + <mxGeometry x="350" y="550" width="50" height="50" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-13" style="edgeStyle=none;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.8555;exitY=0.145;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.855;entryY=0.8555;entryDx=0;entryDy=0;entryPerimeter=0;endArrow=none;endFill=0;" parent="1" source="UDWjvm1ZnLB2DU_sOnAa-4" target="UDWjvm1ZnLB2DU_sOnAa-5" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-4" value="knot<br>wg0:&nbsp;fdf3:aad9:a885:b3a::1/64" style="sketch=0;points=[[0.5,0,0],[1,0.5,0],[0.5,1,0],[0,0.5,0],[0.145,0.145,0],[0.8555,0.145,0],[0.855,0.8555,0],[0.145,0.855,0]];verticalLabelPosition=bottom;html=1;verticalAlign=top;aspect=fixed;align=center;pointerEvents=1;shape=mxgraph.cisco19.rect;prIcon=router;fillColor=#FAFAFA;strokeColor=#005073;" parent="1" vertex="1"> + <mxGeometry x="620" y="550" width="50" height="50" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-7" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=none;endFill=0;" parent="1" source="UDWjvm1ZnLB2DU_sOnAa-5" target="UDWjvm1ZnLB2DU_sOnAa-6" edge="1"> + <mxGeometry relative="1" as="geometry"> + <mxPoint x="810" y="210" as="targetPoint" /> + </mxGeometry> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-12" style="edgeStyle=none;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.145;entryY=0.145;entryDx=0;entryDy=0;entryPerimeter=0;endArrow=none;endFill=0;exitX=0.145;exitY=0.855;exitDx=0;exitDy=0;exitPerimeter=0;" parent="1" source="UDWjvm1ZnLB2DU_sOnAa-5" target="UDWjvm1ZnLB2DU_sOnAa-4" edge="1"> + <mxGeometry relative="1" as="geometry"> + <mxPoint x="710" y="300" as="sourcePoint" /> + </mxGeometry> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-5" value="hash" style="sketch=0;points=[[0.5,0,0],[1,0.5,0],[0.5,1,0],[0,0.5,0],[0.145,0.145,0],[0.8555,0.145,0],[0.855,0.8555,0],[0.145,0.855,0]];verticalLabelPosition=bottom;html=1;verticalAlign=top;aspect=fixed;align=center;pointerEvents=1;shape=mxgraph.cisco19.rect;prIcon=router;fillColor=#FAFAFA;strokeColor=#005073;" parent="1" vertex="1"> + <mxGeometry x="620" y="240" width="50" height="50" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-6" value="vimscore-4" style="sketch=0;points=[[0.015,0.015,0],[0.985,0.015,0],[0.985,0.985,0],[0.015,0.985,0],[0.25,0,0],[0.5,0,0],[0.75,0,0],[1,0.25,0],[1,0.5,0],[1,0.75,0],[0.75,1,0],[0.5,1,0],[0.25,1,0],[0,0.75,0],[0,0.5,0],[0,0.25,0]];verticalLabelPosition=top;html=1;verticalAlign=bottom;aspect=fixed;align=center;pointerEvents=1;shape=mxgraph.cisco19.server;fillColor=#005073;strokeColor=none;labelPosition=center;" parent="1" vertex="1"> + <mxGeometry x="631.25" y="130" width="27.500000000000004" height="50" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-16" value="unifi" style="sketch=0;points=[[0.015,0.015,0],[0.985,0.015,0],[0.985,0.985,0],[0.015,0.985,0],[0.25,0,0],[0.5,0,0],[0.75,0,0],[1,0.25,0],[1,0.5,0],[1,0.75,0],[0.75,1,0],[0.5,1,0],[0.25,1,0],[0,0.75,0],[0,0.5,0],[0,0.25,0]];verticalLabelPosition=top;html=1;verticalAlign=bottom;aspect=fixed;align=center;pointerEvents=1;shape=mxgraph.cisco19.server;fillColor=#005073;strokeColor=none;labelPosition=center;" parent="1" vertex="1"> + <mxGeometry x="361.25" y="130" width="27.500000000000004" height="50" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-17" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=none;endFill=0;" parent="1" source="UDWjvm1ZnLB2DU_sOnAa-1" target="UDWjvm1ZnLB2DU_sOnAa-16" edge="1"> + <mxGeometry relative="1" as="geometry"> + <mxPoint x="840" y="225" as="targetPoint" /> + <mxPoint x="680" y="275" as="sourcePoint" /> + </mxGeometry> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-19" value="trygvis net<br>Global ID: f3aad9a885<br>AS: 4230483679" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="518.75" y="10" width="140" height="60" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-20" value="Current:<br>Global ID: f3aad9a885<br style="border-color: var(--border-color);"><div style=""><span style="background-color: initial;">wg0 subnet ID: 0b3a</span></div><div style=""><span style="background-color: initial;">wg0 prefix: fdf3:aad9:a885:0b3a:/64</span></div>" style="text;html=1;align=left;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="40" y="70" width="210" height="70" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-22" value="lhn2<br>lhn2 subnet id: ::77dd/64" style="sketch=0;points=[[0.5,0,0],[1,0.5,0],[0.5,1,0],[0,0.5,0],[0.145,0.145,0],[0.8555,0.145,0],[0.855,0.8555,0],[0.145,0.855,0]];verticalLabelPosition=bottom;html=1;verticalAlign=top;aspect=fixed;align=center;pointerEvents=1;shape=mxgraph.cisco19.rect;prIcon=router;fillColor=#FAFAFA;strokeColor=#005073;" parent="1" vertex="1"> + <mxGeometry x="100" y="660" width="50" height="50" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-23" value="kv24<br>subnet id: ba64<br>ipv6 net:&nbsp;fdf3:aad9:a885:ba64::/64<br>" style="sketch=0;points=[[0.5,0,0],[1,0.5,0],[0.5,1,0],[0,0.5,0],[0.145,0.145,0],[0.8555,0.145,0],[0.855,0.8555,0],[0.145,0.855,0]];verticalLabelPosition=bottom;html=1;verticalAlign=top;aspect=fixed;align=center;pointerEvents=1;shape=mxgraph.cisco19.rect;prIcon=router;fillColor=#FAFAFA;strokeColor=#005073;" parent="1" vertex="1"> + <mxGeometry x="100" y="520" width="50" height="50" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-24" value="wg0 is the peering network" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="40" y="180" width="170" height="30" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-28" value="Network: fdf3:aad9:a885:ba64::/64" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;rounded=0;" parent="1" vertex="1"> + <mxGeometry x="880" y="260" width="210" height="30" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-33" value="Network: fdf3:aad9:a885:ba65::/64" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;rounded=0;perimeterSpacing=0;spacing=2;" parent="1" vertex="1"> + <mxGeometry x="850" y="680" width="210" height="30" as="geometry" /> + </mxCell> + <mxCell id="yd4OAxL_OL2nS1uvAmHJ-6" value="astyanax<br>wg0:&nbsp;fdf3:aad9:a885:b3a::10/64" style="sketch=0;points=[[0.5,0,0],[1,0.5,0],[0.5,1,0],[0,0.5,0],[0.145,0.145,0],[0.8555,0.145,0],[0.855,0.8555,0],[0.145,0.855,0]];verticalLabelPosition=middle;html=1;verticalAlign=middle;aspect=fixed;align=left;pointerEvents=1;shape=mxgraph.cisco19.rect;prIcon=router;fillColor=#FAFAFA;strokeColor=#005073;labelPosition=right;" parent="1" vertex="1"> + <mxGeometry x="840" y="460" width="50" height="50" as="geometry" /> + </mxCell> + <mxCell id="yd4OAxL_OL2nS1uvAmHJ-7" style="orthogonalLoop=1;jettySize=auto;html=1;entryX=1;entryY=0.5;entryDx=0;entryDy=0;entryPerimeter=0;rounded=0;" parent="1" source="yd4OAxL_OL2nS1uvAmHJ-6" target="UDWjvm1ZnLB2DU_sOnAa-4" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + </root> + </mxGraphModel> + </diagram> +</mxfile> diff --git a/docs/wg0.drawio b/docs/wg0.drawio new file mode 100644 index 0000000..e36c570 --- /dev/null +++ b/docs/wg0.drawio @@ -0,0 +1,105 @@ +<mxfile host="Electron" modified="2023-10-09T08:55:10.684Z" agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/22.0.2 Chrome/114.0.5735.289 Electron/25.8.4 Safari/537.36" etag="hlol1f-Fuq1V6yMgB_ic" version="22.0.2" type="device"> + <diagram name="Page-1" id="v7i8TAT-5xv207MUNhIB"> + <mxGraphModel dx="1383" dy="799" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1169" pageHeight="827" math="0" shadow="0"> + <root> + <mxCell id="0" /> + <mxCell id="1" parent="0" /> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-8" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=classic;endFill=1;" parent="1" source="UDWjvm1ZnLB2DU_sOnAa-1" target="UDWjvm1ZnLB2DU_sOnAa-5" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-11" style="edgeStyle=none;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=classic;endFill=1;exitX=0.855;exitY=0.8555;exitDx=0;exitDy=0;exitPerimeter=0;" parent="1" source="UDWjvm1ZnLB2DU_sOnAa-1" target="UDWjvm1ZnLB2DU_sOnAa-4" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-1" value="conflatorio<br>wg0::3" style="sketch=0;points=[[0.5,0,0],[1,0.5,0],[0.5,1,0],[0,0.5,0],[0.145,0.145,0],[0.8555,0.145,0],[0.855,0.8555,0],[0.145,0.855,0]];verticalLabelPosition=middle;html=1;verticalAlign=middle;aspect=fixed;align=right;pointerEvents=1;shape=mxgraph.cisco19.rect;prIcon=router;fillColor=#FAFAFA;strokeColor=#005073;labelPosition=left;" parent="1" vertex="1"> + <mxGeometry x="350" y="240" width="50" height="50" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-9" style="edgeStyle=none;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=classic;endFill=1;exitX=0.145;exitY=0.145;exitDx=0;exitDy=0;exitPerimeter=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;entryPerimeter=0;" parent="1" source="UDWjvm1ZnLB2DU_sOnAa-2" target="UDWjvm1ZnLB2DU_sOnAa-5" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-10" style="edgeStyle=none;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=classic;endFill=1;exitX=0.145;exitY=0.855;exitDx=0;exitDy=0;exitPerimeter=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;entryPerimeter=0;" parent="1" source="UDWjvm1ZnLB2DU_sOnAa-2" target="UDWjvm1ZnLB2DU_sOnAa-4" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-26" value="eno1" style="edgeStyle=none;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=classic;endFill=1;" parent="1" source="UDWjvm1ZnLB2DU_sOnAa-2" target="UDWjvm1ZnLB2DU_sOnAa-28" edge="1"> + <mxGeometry relative="1" as="geometry"> + <mxPoint x="980" y="300" as="targetPoint" /> + </mxGeometry> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-32" value="enp2s0" style="edgeStyle=none;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=classic;endFill=1;" parent="1" source="yd4OAxL_OL2nS1uvAmHJ-6" target="UDWjvm1ZnLB2DU_sOnAa-33" edge="1"> + <mxGeometry relative="1" as="geometry"> + <mxPoint x="960" y="360" as="targetPoint" /> + </mxGeometry> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-2" value="akili<br>wg0:&nbsp;fdf3:aad9:a885:b3a::7/64" style="sketch=0;points=[[0.5,0,0],[1,0.5,0],[0.5,1,0],[0,0.5,0],[0.145,0.145,0],[0.8555,0.145,0],[0.855,0.8555,0],[0.145,0.855,0]];verticalLabelPosition=middle;html=1;verticalAlign=middle;aspect=fixed;align=left;pointerEvents=1;shape=mxgraph.cisco19.rect;prIcon=router;fillColor=#FAFAFA;strokeColor=#005073;labelPosition=right;" parent="1" vertex="1"> + <mxGeometry x="840" y="340" width="50" height="50" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-14" style="edgeStyle=none;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=classic;endFill=1;" parent="1" source="UDWjvm1ZnLB2DU_sOnAa-3" target="UDWjvm1ZnLB2DU_sOnAa-4" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-15" style="edgeStyle=none;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=classic;endFill=1;exitX=0.8555;exitY=0.145;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.209;entryY=0.791;entryDx=0;entryDy=0;entryPerimeter=0;" parent="1" source="UDWjvm1ZnLB2DU_sOnAa-3" target="UDWjvm1ZnLB2DU_sOnAa-5" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-3" value="arius" style="sketch=0;points=[[0.5,0,0],[1,0.5,0],[0.5,1,0],[0,0.5,0],[0.145,0.145,0],[0.8555,0.145,0],[0.855,0.8555,0],[0.145,0.855,0]];verticalLabelPosition=bottom;html=1;verticalAlign=top;aspect=fixed;align=center;pointerEvents=1;shape=mxgraph.cisco19.rect;prIcon=router;fillColor=#FAFAFA;strokeColor=#005073;" parent="1" vertex="1"> + <mxGeometry x="350" y="550" width="50" height="50" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-13" style="edgeStyle=none;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.8555;exitY=0.145;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.855;entryY=0.8555;entryDx=0;entryDy=0;entryPerimeter=0;endArrow=none;endFill=0;" parent="1" source="UDWjvm1ZnLB2DU_sOnAa-4" target="UDWjvm1ZnLB2DU_sOnAa-5" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-4" value="knot<br>wg0:&nbsp;fdf3:aad9:a885:b3a::1/64" style="sketch=0;points=[[0.5,0,0],[1,0.5,0],[0.5,1,0],[0,0.5,0],[0.145,0.145,0],[0.8555,0.145,0],[0.855,0.8555,0],[0.145,0.855,0]];verticalLabelPosition=bottom;html=1;verticalAlign=top;aspect=fixed;align=center;pointerEvents=1;shape=mxgraph.cisco19.rect;prIcon=router;fillColor=#FAFAFA;strokeColor=#005073;" parent="1" vertex="1"> + <mxGeometry x="620" y="550" width="50" height="50" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-7" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=none;endFill=0;" parent="1" source="UDWjvm1ZnLB2DU_sOnAa-5" target="UDWjvm1ZnLB2DU_sOnAa-6" edge="1"> + <mxGeometry relative="1" as="geometry"> + <mxPoint x="810" y="210" as="targetPoint" /> + </mxGeometry> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-12" style="edgeStyle=none;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.145;entryY=0.145;entryDx=0;entryDy=0;entryPerimeter=0;endArrow=none;endFill=0;exitX=0.145;exitY=0.855;exitDx=0;exitDy=0;exitPerimeter=0;" parent="1" source="UDWjvm1ZnLB2DU_sOnAa-5" target="UDWjvm1ZnLB2DU_sOnAa-4" edge="1"> + <mxGeometry relative="1" as="geometry"> + <mxPoint x="710" y="300" as="sourcePoint" /> + </mxGeometry> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-5" value="hash" style="sketch=0;points=[[0.5,0,0],[1,0.5,0],[0.5,1,0],[0,0.5,0],[0.145,0.145,0],[0.8555,0.145,0],[0.855,0.8555,0],[0.145,0.855,0]];verticalLabelPosition=bottom;html=1;verticalAlign=top;aspect=fixed;align=center;pointerEvents=1;shape=mxgraph.cisco19.rect;prIcon=router;fillColor=#FAFAFA;strokeColor=#005073;" parent="1" vertex="1"> + <mxGeometry x="620" y="240" width="50" height="50" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-6" value="vimscore-4" style="sketch=0;points=[[0.015,0.015,0],[0.985,0.015,0],[0.985,0.985,0],[0.015,0.985,0],[0.25,0,0],[0.5,0,0],[0.75,0,0],[1,0.25,0],[1,0.5,0],[1,0.75,0],[0.75,1,0],[0.5,1,0],[0.25,1,0],[0,0.75,0],[0,0.5,0],[0,0.25,0]];verticalLabelPosition=top;html=1;verticalAlign=bottom;aspect=fixed;align=center;pointerEvents=1;shape=mxgraph.cisco19.server;fillColor=#005073;strokeColor=none;labelPosition=center;" parent="1" vertex="1"> + <mxGeometry x="631.25" y="130" width="27.500000000000004" height="50" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-16" value="unifi" style="sketch=0;points=[[0.015,0.015,0],[0.985,0.015,0],[0.985,0.985,0],[0.015,0.985,0],[0.25,0,0],[0.5,0,0],[0.75,0,0],[1,0.25,0],[1,0.5,0],[1,0.75,0],[0.75,1,0],[0.5,1,0],[0.25,1,0],[0,0.75,0],[0,0.5,0],[0,0.25,0]];verticalLabelPosition=top;html=1;verticalAlign=bottom;aspect=fixed;align=center;pointerEvents=1;shape=mxgraph.cisco19.server;fillColor=#005073;strokeColor=none;labelPosition=center;" parent="1" vertex="1"> + <mxGeometry x="361.25" y="130" width="27.500000000000004" height="50" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-17" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=none;endFill=0;" parent="1" source="UDWjvm1ZnLB2DU_sOnAa-1" target="UDWjvm1ZnLB2DU_sOnAa-16" edge="1"> + <mxGeometry relative="1" as="geometry"> + <mxPoint x="840" y="225" as="targetPoint" /> + <mxPoint x="680" y="275" as="sourcePoint" /> + </mxGeometry> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-19" value="trygvis net<br>Global ID: f3aad9a885<br>AS: 4230483679" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="518.75" y="10" width="140" height="60" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-20" value="Current:<br>Global ID: f3aad9a885<br style="border-color: var(--border-color);"><div style=""><span style="background-color: initial;">wg0 subnet ID: 0b3a</span></div><div style=""><span style="background-color: initial;">wg0 prefix: fdf3:aad9:a885:0b3a:/64</span></div>" style="text;html=1;align=left;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="40" y="70" width="210" height="70" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-22" value="lhn2<br>lhn2 subnet id: ::77dd/64" style="sketch=0;points=[[0.5,0,0],[1,0.5,0],[0.5,1,0],[0,0.5,0],[0.145,0.145,0],[0.8555,0.145,0],[0.855,0.8555,0],[0.145,0.855,0]];verticalLabelPosition=bottom;html=1;verticalAlign=top;aspect=fixed;align=center;pointerEvents=1;shape=mxgraph.cisco19.rect;prIcon=router;fillColor=#FAFAFA;strokeColor=#005073;" parent="1" vertex="1"> + <mxGeometry x="100" y="660" width="50" height="50" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-23" value="kv24<br>subnet id: ba64<br>ipv6 net:&nbsp;fdf3:aad9:a885:ba64::/64<br>" style="sketch=0;points=[[0.5,0,0],[1,0.5,0],[0.5,1,0],[0,0.5,0],[0.145,0.145,0],[0.8555,0.145,0],[0.855,0.8555,0],[0.145,0.855,0]];verticalLabelPosition=bottom;html=1;verticalAlign=top;aspect=fixed;align=center;pointerEvents=1;shape=mxgraph.cisco19.rect;prIcon=router;fillColor=#FAFAFA;strokeColor=#005073;" parent="1" vertex="1"> + <mxGeometry x="100" y="520" width="50" height="50" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-24" value="wg0 is the peering network" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="40" y="180" width="170" height="30" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-28" value="Network: fdf3:aad9:a885:ba64::/64" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;rounded=0;" parent="1" vertex="1"> + <mxGeometry x="880" y="260" width="210" height="30" as="geometry" /> + </mxCell> + <mxCell id="UDWjvm1ZnLB2DU_sOnAa-33" value="Network: fdf3:aad9:a885:ba65::/64" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;rounded=0;perimeterSpacing=0;spacing=2;" parent="1" vertex="1"> + <mxGeometry x="850" y="680" width="210" height="30" as="geometry" /> + </mxCell> + <mxCell id="yd4OAxL_OL2nS1uvAmHJ-6" value="astyanax<br>wg0:&nbsp;fdf3:aad9:a885:b3a::10/64" style="sketch=0;points=[[0.5,0,0],[1,0.5,0],[0.5,1,0],[0,0.5,0],[0.145,0.145,0],[0.8555,0.145,0],[0.855,0.8555,0],[0.145,0.855,0]];verticalLabelPosition=middle;html=1;verticalAlign=middle;aspect=fixed;align=left;pointerEvents=1;shape=mxgraph.cisco19.rect;prIcon=router;fillColor=#FAFAFA;strokeColor=#005073;labelPosition=right;" vertex="1" parent="1"> + <mxGeometry x="840" y="460" width="50" height="50" as="geometry" /> + </mxCell> + <mxCell id="yd4OAxL_OL2nS1uvAmHJ-7" style="orthogonalLoop=1;jettySize=auto;html=1;entryX=1;entryY=0.5;entryDx=0;entryDy=0;entryPerimeter=0;rounded=0;" edge="1" parent="1" source="yd4OAxL_OL2nS1uvAmHJ-6" target="UDWjvm1ZnLB2DU_sOnAa-4"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + </root> + </mxGraphModel> + </diagram> +</mxfile> @@ -1,5 +1,7 @@ #ENC[AES256_GCM,data:VXrX0NUIHcFjmxHLuYzz9ekkR7N2IW/CF6a9U0dk/cvgtwoNLA==,iv:NIpefl6uO7c7ESxgCHXe3Y2x4cf9nLPjwDJo28xt5SY=,tag:U59KOg8Ny+O33Lf63Zjo1w==,type:comment] -linode_token: ENC[AES256_GCM,data:PeLIxcZ5mQMnp1LZy4saSUWIpCxrGm+3/6PssmIE9yO81x2HcGrgxO0CNl1feOtPrI1PVcAfFnFlpSetELLZlg==,iv:ETBKZgmFdIHoUROHVUzhxRoLS2uIuGR0SXZ96C9FhDk=,tag:pzuS8RLQf1A5ctmrOanVgA==,type:str] +#ENC[AES256_GCM,data:tGaEE5lsc+NutVre1el9hBL2U7CZ8LNFQZ5Q/AOZp5I=,iv:aF3gXP20Q74Y8shSNP9l17AgtVX83rEL1BvPXpAg+54=,tag:h87MkG5nokS2HLId+QFRQQ==,type:comment] +#ENC[AES256_GCM,data:/jkbA/Kv2BydOycNYyW13yncVDIEJ62bWQZuY6cjrXFt0ywZOQ01BvyyoiHF75VjSZrZPr3IFTuG21Q+g8yMPRopTpvSvtw0v7Tb6O6P,iv:cFeKYcDoyAsimh19yFa6AL0yX4NqUpq4ehTOYnW65iI=,tag:DV0gZdImGG4cOWVR3WnZzA==,type:comment] +linode_token: ENC[AES256_GCM,data:a9Uzjh+DzY1TRLaJ9r7tNYPY2rw+FMj2ldSsL3Dl0SbUCO3HOXN2lvgDHfG/0gqRqrqBd8ZCq60B//3SVqhA8w==,iv:klS15g5pRHImsd1bM2Tc/DjiqaQQVQ/xF5msrqsABU4=,tag:l6Y3u+xhIcm2WEtalka2cQ==,type:str] knot_pdb_terraform_password: ENC[AES256_GCM,data:cu5aUZAVrmtzgBB2hGfBkd+TU4vB0cWnBNluTHptyV0YvZuq,iv:HT4Cmr9huuylVt2vwFcrWUlBmDE6V3n0bXq/telJNBM=,tag:2RSvWnAAM5seHv12HyDprA==,type:str] sops: kms: [] @@ -34,8 +36,8 @@ sops: a1E2c3VEaWR0K3U4dnpqdm5RU0VCZUkKiOtFMhim7qAe4kDU2gijcCChesM0qAGk Z2xNVfBy4HH58cgWrtCQ6PRvULwAQ6Bgq59iZ7H/C2IFVqVfliajmw== -----END AGE ENCRYPTED FILE----- - lastmodified: "2024-08-21T18:05:07Z" - mac: ENC[AES256_GCM,data:Kxa9SCKy0pLCgqGd7f+xFbQz3Cpf9EfDYP1fwPiIweHhw8iFEeaI7WZCb9zXjsky1tuQ0nbJMHfVQaPSqLC+ACyrBioXIBjgITAfEg3xtpRYiSQRFVBtGA7HpEAKWeFquzTvBR/EAoDuEvFTkrup3JSE8sM3bWKVb2dy1uRyBIc=,iv:O5LO1TFJLlFdCOGWWk5xJlQtVF1+sZTCH2DUKQdvQGo=,tag:0USQg2+EYUVG3+FsjilssQ==,type:str] + lastmodified: "2025-03-30T18:19:37Z" + mac: ENC[AES256_GCM,data:Oyv/4fPW3+u7xsAPCM/JIZEFggmJfUMvk0ofLBjvH0steVJZ53KVzhQrb9D9JIOk4YE9xhhGxH2bHVnx6bm7oX4DtiaGf919NawepoBi0mu8pnbYsvEeFUY4nN5ZA++cGEQYMQDObGeXz6fwncIU6ZPzpcBKGf3hSPdswXNRC8M=,iv:AFT0+ibBnejgbDzZ96Rjz/ngDkC0UTqbkRia+WD4JcU=,tag:VFoXXi7WRRLvULs3EFojIA==,type:str] pgp: [] unencrypted_suffix: _unencrypted - version: 3.7.3 + version: 3.9.1 diff --git a/terraform/conflatorio-docker/network.tf b/terraform/conflatorio-docker/network.tf deleted file mode 100644 index 8a839f5..0000000 --- a/terraform/conflatorio-docker/network.tf +++ /dev/null @@ -1,25 +0,0 @@ -resource "docker_network" "public" { - name = "public" - - ipv6 = true - - ipam_config { - subnet = "${local.network_addr}/${local.network_range}" - } - - ipam_config { - gateway = "172.22.0.1" - subnet = "172.22.0.0/16" - } -} - -# Internal shared network -resource "docker_network" "private" { - name = "private" - - ipv6 = true - - ipam_config { - subnet = "${local.private_network_addr}/${local.private_network_range}" - } -} diff --git a/terraform/grafana/backend.tf b/terraform/dns/backend.tf index e796c2e..4f05aaf 100644 --- a/terraform/grafana/backend.tf +++ b/terraform/dns/backend.tf @@ -1,12 +1,16 @@ # Generated by Terragrunt. Sig: nIlQXj57tbuaRZEa terraform { + required_version = "~> 1.9.5" + backend "s3" { bucket = "terraform-a6726272-73ff-11ed-8bdd-c79eb8376e05" - key = "grafana/terraform.tfstate" + key = "dns/terraform.tfstate" skip_region_validation = true skip_credentials_validation = true skip_metadata_api_check = true + skip_requesting_account_id = true + skip_s3_checksum = true region = "eu-central-1" - endpoint = "eu-central-1.linodeobjects.com" + endpoints = { s3 : "https://eu-central-1.linodeobjects.com" } } } diff --git a/terraform/dns/dn42.tf b/terraform/dns/dn42.tf new file mode 100644 index 0000000..c7aab96 --- /dev/null +++ b/terraform/dns/dn42.tf @@ -0,0 +1,113 @@ +# Generated from ansible data + +resource "linode_domain_record" "dn42-conflatorio" { + domain_id = linode_domain.root.id + name = "conflatorio.dn42" + record_type = "AAAA" + target = "fdb1:4242:3538:2008:8042:32ff:fe0c:7161" +} + +resource "linode_domain_record" "dn42-coregonus" { + domain_id = linode_domain.root.id + name = "coregonus.dn42" + record_type = "AAAA" + target = "fdb1:4242:3538:2006:2e0:4cff:fe98:1bb5" +} + +resource "linode_domain_record" "dn42-danneri" { + domain_id = linode_domain.root.id + name = "danneri.dn42" + record_type = "AAAA" + target = "fdb1:4242:3538:2008:9422:d355:95b7:f170" +} + +resource "linode_domain_record" "dn42-garasjepi" { + domain_id = linode_domain.root.id + name = "garasjepi.dn42" + record_type = "AAAA" + target = "fdb1:4242:3538:2006:e9f7:418f:49fd:8d2e" +} + +resource "linode_domain_record" "dn42-ha-kv24" { + domain_id = linode_domain.root.id + name = "ha-kv24.dn42" + record_type = "AAAA" + target = "fdb1:4242:3538:2006:18a:90f:4264:8ca0" +} + +resource "linode_domain_record" "dn42-ha-lhn2" { + domain_id = linode_domain.root.id + name = "ha-lhn2.dn42" + record_type = "AAAA" + target = "fdb1:4242:3538:2008:9c59:926f:1dc9:89db" +} + +resource "linode_domain_record" "dn42-hash" { + domain_id = linode_domain.root.id + name = "hash.dn42" + record_type = "AAAA" + target = "fdb1:4242:3538:2007::ffff" +} + +resource "linode_domain_record" "dn42-kjell" { + domain_id = linode_domain.root.id + name = "kjell.dn42" + record_type = "AAAA" + target = "fdb1:4242:3538:2006:2f0:cbff:fefe:d98c" +} + +resource "linode_domain_record" "dn42-knot" { + domain_id = linode_domain.root.id + name = "knot.dn42" + record_type = "AAAA" + target = "fdb1:4242:3538:2004::ffff" +} + +resource "linode_domain_record" "dn42-kv24ix" { + domain_id = linode_domain.root.id + name = "kv24ix.dn42" + record_type = "AAAA" + target = "fdb1:4242:3538:2006::ffff" +} + +resource "linode_domain_record" "dn42-lhn2-z2m" { + domain_id = linode_domain.root.id + name = "lhn2-z2m.dn42" + record_type = "AAAA" + target = "fdb1:4242:3538:2008:9aed:e460:1711:7dd" +} + +resource "linode_domain_record" "dn42-lhn2pi" { + domain_id = linode_domain.root.id + name = "lhn2pi.dn42" + record_type = "AAAA" + target = "fdb1:4242:3538:2008::ffff" +} + +resource "linode_domain_record" "dn42-netbox" { + domain_id = linode_domain.root.id + name = "netbox.dn42" + record_type = "AAAA" + target = "fdb1:4242:3538:2006:be24:11ff:febb:5c7f" +} + +resource "linode_domain_record" "dn42-node1" { + domain_id = linode_domain.root.id + name = "node1.dn42" + record_type = "AAAA" + target = "fdb1:4242:3538:2002::ffff" +} + +resource "linode_domain_record" "dn42-node2" { + domain_id = linode_domain.root.id + name = "node2.dn42" + record_type = "AAAA" + target = "fdb1:4242:3538:2003::ffff" +} + +resource "linode_domain_record" "dn42-unifi" { + domain_id = linode_domain.root.id + name = "unifi.dn42" + record_type = "AAAA" + target = "fdb1:4242:3538:2008:5054:ff:fe4d:96c" +} diff --git a/terraform/dns/main.tf b/terraform/dns/main.tf index 753ef75..812f3b2 100644 --- a/terraform/dns/main.tf +++ b/terraform/dns/main.tf @@ -1,16 +1,4 @@ terraform { - required_version = "~> 1.3.6" - - backend "s3" { - bucket = "terraform-a6726272-73ff-11ed-8bdd-c79eb8376e05" - key = "dns/terraform.tfstate" - region = "eu-central-1" - skip_region_validation = true - skip_credentials_validation = true - skip_metadata_api_check = true - endpoint = "eu-central-1.linodeobjects.com" - } - required_providers { linode = { version = "2.7.1" diff --git a/terraform/dns/terraform.tfstate b/terraform/dns/terraform.tfstate new file mode 100644 index 0000000..891db4d --- /dev/null +++ b/terraform/dns/terraform.tfstate @@ -0,0 +1,52 @@ +{ + "version": 3, + "serial": 1, + "lineage": "8244bd55-1992-3e9a-1072-28df4fb0d2f2", + "backend": { + "type": "s3", + "config": { + "access_key": null, + "acl": null, + "assume_role_duration_seconds": null, + "assume_role_policy": null, + "assume_role_policy_arns": null, + "assume_role_tags": null, + "assume_role_transitive_tag_keys": null, + "bucket": "terraform-a6726272-73ff-11ed-8bdd-c79eb8376e05", + "dynamodb_endpoint": null, + "dynamodb_table": null, + "encrypt": null, + "endpoint": "eu-central-1.linodeobjects.com", + "external_id": null, + "force_path_style": null, + "iam_endpoint": null, + "key": "dns/terraform.tfstate", + "kms_key_id": null, + "max_retries": null, + "profile": null, + "region": "eu-central-1", + "role_arn": null, + "secret_key": null, + "session_name": null, + "shared_credentials_file": null, + "skip_credentials_validation": true, + "skip_metadata_api_check": true, + "skip_region_validation": true, + "sse_customer_key": null, + "sts_endpoint": null, + "token": null, + "workspace_key_prefix": null + }, + "hash": 1226279900 + }, + "modules": [ + { + "path": [ + "root" + ], + "outputs": {}, + "resources": {}, + "depends_on": [] + } + ] +} diff --git a/terraform/conflatorio-docker/terragrunt.hcl b/terraform/dns/terragrunt.hcl index e147285..e147285 100644 --- a/terraform/conflatorio-docker/terragrunt.hcl +++ b/terraform/dns/terragrunt.hcl diff --git a/terraform/dns/trygvis.tf b/terraform/dns/trygvis.tf index 608dd3e..5dfc8cb 100644 --- a/terraform/dns/trygvis.tf +++ b/terraform/dns/trygvis.tf @@ -17,6 +17,13 @@ resource "linode_domain_record" "root-a" { target = "176.58.112.84" } +resource "linode_domain_record" "root-aaaa" { + domain_id = linode_domain.root.id + name = "" + record_type = "AAAA" + target = "2a01:7e00::f03c:91ff:feae:93a3" +} + resource "linode_domain_record" "root-mx" { domain_id = linode_domain.root.id name = "" @@ -158,6 +165,27 @@ resource "linode_domain_record" "unifi" { target = "trygvis.io" } +resource "linode_domain_record" "kv24" { + domain_id = linode_domain.root.id + name = "kv24" + record_type = "CNAME" + target = "trygvis.io" +} + +resource "linode_domain_record" "kv24ix" { + domain_id = linode_domain.root.id + name = "kv24ix" + record_type = "A" + target = "81.166.205.176" +} + +resource "linode_domain_record" "lhn2" { + domain_id = linode_domain.root.id + name = "lhn2" + record_type = "CNAME" + target = "trygvis.io" +} + # Aliases for vs.trygvis.io resource "linode_domain_record" "nextcloud" { domain_id = linode_domain.root.id @@ -170,7 +198,14 @@ resource "linode_domain_record" "grafana" { domain_id = linode_domain.root.id name = "grafana" record_type = "CNAME" - target = "vs.trygvis.io" + target = "hash.trygvis.io" +} + +resource "linode_domain_record" "loki" { + domain_id = linode_domain.root.id + name = "loki" + record_type = "CNAME" + target = "hash.trygvis.io" } resource "linode_domain_record" "owncloud" { diff --git a/terraform/dns/vpn-cname.tf b/terraform/dns/vpn-cname.tf index 7a9fba4..c03b2bb 100644 --- a/terraform/dns/vpn-cname.tf +++ b/terraform/dns/vpn-cname.tf @@ -19,13 +19,6 @@ resource "linode_domain_record" "vpn-unifi" { target = "${linode_domain_record.net-conflatorio.name}.trygvis.io" } -resource "linode_domain_record" "vpn-grafana" { - domain_id = linode_domain.root.id - name = "grafana.vpn" - record_type = "CNAME" - target = "${linode_domain_record.net-conflatorio.name}.trygvis.io" -} - resource "linode_domain_record" "vpn-influxdb" { domain_id = linode_domain.root.id name = "influxdb.vpn" diff --git a/terraform/garasjepi-zigbee2mqtt/.terraform.lock.hcl b/terraform/garasjepi-zigbee2mqtt/.terraform.lock.hcl new file mode 100644 index 0000000..57bc928 --- /dev/null +++ b/terraform/garasjepi-zigbee2mqtt/.terraform.lock.hcl @@ -0,0 +1,24 @@ +# This file is maintained automatically by "terraform init". +# Manual edits may be lost in future updates. + +provider "registry.terraform.io/kreuzwerker/docker" { + version = "3.0.2" + constraints = "3.0.2" + hashes = [ + "h1:cT2ccWOtlfKYBUE60/v2/4Q6Stk1KYTNnhxSck+VPlU=", + "zh:15b0a2b2b563d8d40f62f83057d91acb02cd0096f207488d8b4298a59203d64f", + "zh:23d919de139f7cd5ebfd2ff1b94e6d9913f0977fcfc2ca02e1573be53e269f95", + "zh:38081b3fe317c7e9555b2aaad325ad3fa516a886d2dfa8605ae6a809c1072138", + "zh:4a9c5065b178082f79ad8160243369c185214d874ff5048556d48d3edd03c4da", + "zh:5438ef6afe057945f28bce43d76c4401254073de01a774760169ac1058830ac2", + "zh:60b7fadc287166e5c9873dfe53a7976d98244979e0ab66428ea0dea1ebf33e06", + "zh:61c5ec1cb94e4c4a4fb1e4a24576d5f39a955f09afb17dab982de62b70a9bdd1", + "zh:a38fe9016ace5f911ab00c88e64b156ebbbbfb72a51a44da3c13d442cd214710", + "zh:c2c4d2b1fd9ebb291c57f524b3bf9d0994ff3e815c0cd9c9bcb87166dc687005", + "zh:d567bb8ce483ab2cf0602e07eae57027a1a53994aba470fa76095912a505533d", + "zh:e83bf05ab6a19dd8c43547ce9a8a511f8c331a124d11ac64687c764ab9d5a792", + "zh:e90c934b5cd65516fbcc454c89a150bfa726e7cf1fe749790c7480bbeb19d387", + "zh:f05f167d2eaf913045d8e7b88c13757e3cf595dd5cd333057fdafc7c4b7fed62", + "zh:fcc9c1cea5ce85e8bcb593862e699a881bd36dffd29e2e367f82d15368659c3d", + ] +} diff --git a/terraform/garasjepi-zigbee2mqtt/backend.tf b/terraform/garasjepi-zigbee2mqtt/backend.tf new file mode 100644 index 0000000..33340ba --- /dev/null +++ b/terraform/garasjepi-zigbee2mqtt/backend.tf @@ -0,0 +1,16 @@ +# Generated by Terragrunt. Sig: nIlQXj57tbuaRZEa +terraform { + required_version = "~> 1.9.5" + + backend "s3" { + bucket = "terraform-a6726272-73ff-11ed-8bdd-c79eb8376e05" + key = "garasjepi-zigbee2mqtt/terraform.tfstate" + skip_region_validation = true + skip_credentials_validation = true + skip_metadata_api_check = true + skip_requesting_account_id = true + skip_s3_checksum = true + region = "eu-central-1" + endpoints = { s3 : "https://eu-central-1.linodeobjects.com" } + } +} diff --git a/terraform/garasjepi-zigbee2mqtt/main.tf b/terraform/garasjepi-zigbee2mqtt/main.tf new file mode 100644 index 0000000..1321115 --- /dev/null +++ b/terraform/garasjepi-zigbee2mqtt/main.tf @@ -0,0 +1,30 @@ +terraform { + required_providers { + docker = { + source = "kreuzwerker/docker" + version = "3.0.2" + } + } +} + +provider "docker" { + host = "ssh://${local.host}" +} + +locals { + host = "garasjepi.dn42.trygvis.io" + version = "2.3.0" + public_ip = module.ipam.hosts.garasjepi.address +} + +module "ipam" { + source = "../ipam6" +} + +module "zigbee2mqtt" { + source = "../modules/zigbee2mqtt" + + docker_version = local.version + public_ip = local.public_ip + serial_port = "/dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2698168-if00" +} diff --git a/terraform/grafana/terragrunt.hcl b/terraform/garasjepi-zigbee2mqtt/terragrunt.hcl index e147285..e147285 100644 --- a/terraform/grafana/terragrunt.hcl +++ b/terraform/garasjepi-zigbee2mqtt/terragrunt.hcl diff --git a/terraform/conflatorio-docker/.terraform.lock.hcl b/terraform/hash-docker/.terraform.lock.hcl index aa0f1fb..e35130a 100644 --- a/terraform/conflatorio-docker/.terraform.lock.hcl +++ b/terraform/hash-docker/.terraform.lock.hcl @@ -2,21 +2,21 @@ # Manual edits may be lost in future updates. provider "registry.terraform.io/hashicorp/null" { - version = "3.2.1" + version = "3.2.3" hashes = [ - "h1:FbGfc+muBsC17Ohy5g806iuI1hQc4SIexpYCrQHQd8w=", - "zh:58ed64389620cc7b82f01332e27723856422820cfd302e304b5f6c3436fb9840", - "zh:62a5cc82c3b2ddef7ef3a6f2fedb7b9b3deff4ab7b414938b08e51d6e8be87cb", - "zh:63cff4de03af983175a7e37e52d4bd89d990be256b16b5c7f919aff5ad485aa5", - "zh:74cb22c6700e48486b7cabefa10b33b801dfcab56f1a6ac9b6624531f3d36ea3", + "h1:+AnORRgFbRO6qqcfaQyeX80W0eX3VmjadjnUFUJTiXo=", + "zh:22d062e5278d872fe7aed834f5577ba0a5afe34a3bdac2b81f828d8d3e6706d2", + "zh:23dead00493ad863729495dc212fd6c29b8293e707b055ce5ba21ee453ce552d", + "zh:28299accf21763ca1ca144d8f660688d7c2ad0b105b7202554ca60b02a3856d3", + "zh:55c9e8a9ac25a7652df8c51a8a9a422bd67d784061b1de2dc9fe6c3cb4e77f2f", + "zh:756586535d11698a216291c06b9ed8a5cc6a4ec43eee1ee09ecd5c6a9e297ac1", "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:79e553aff77f1cfa9012a2218b8238dd672ea5e1b2924775ac9ac24d2a75c238", - "zh:a1e06ddda0b5ac48f7e7c7d59e1ab5a4073bbcf876c73c0299e4610ed53859dc", - "zh:c37a97090f1a82222925d45d84483b2aa702ef7ab66532af6cbcfb567818b970", - "zh:e4453fbebf90c53ca3323a92e7ca0f9961427d2f0ce0d2b65523cc04d5d999c2", - "zh:e80a746921946d8b6761e77305b752ad188da60688cfd2059322875d363be5f5", - "zh:fbdb892d9822ed0e4cb60f2fedbdbb556e4da0d88d3b942ae963ed6ff091e48f", - "zh:fca01a623d90d0cad0843102f9b8b9fe0d3ff8244593bd817f126582b52dd694", + "zh:9d5eea62fdb587eeb96a8c4d782459f4e6b73baeece4d04b4a40e44faaee9301", + "zh:a6355f596a3fb8fc85c2fb054ab14e722991533f87f928e7169a486462c74670", + "zh:b5a65a789cff4ada58a5baffc76cb9767dc26ec6b45c00d2ec8b1b027f6db4ed", + "zh:db5ab669cf11d0e9f81dc380a6fdfcac437aea3d69109c7aef1a5426639d2d65", + "zh:de655d251c470197bcbb5ac45d289595295acb8f829f6c781d4a75c8c8b7c7dd", + "zh:f5c68199f2e6076bce92a12230434782bf768103a427e9bb9abee99b116af7b5", ] } diff --git a/terraform/hash-docker/backend.tf b/terraform/hash-docker/backend.tf new file mode 100644 index 0000000..d793773 --- /dev/null +++ b/terraform/hash-docker/backend.tf @@ -0,0 +1,16 @@ +# Generated by Terragrunt. Sig: nIlQXj57tbuaRZEa +terraform { + required_version = "~> 1.9.5" + + backend "s3" { + bucket = "terraform-a6726272-73ff-11ed-8bdd-c79eb8376e05" + key = "hash-docker/terraform.tfstate" + skip_region_validation = true + skip_credentials_validation = true + skip_metadata_api_check = true + skip_requesting_account_id = true + skip_s3_checksum = true + region = "eu-central-1" + endpoints = { s3 : "https://eu-central-1.linodeobjects.com" } + } +} diff --git a/terraform/conflatorio-docker/main.tf b/terraform/hash-docker/main.tf index e7b11ad..ba2c79f 100644 --- a/terraform/conflatorio-docker/main.tf +++ b/terraform/hash-docker/main.tf @@ -1,6 +1,4 @@ terraform { - required_version = "~> 1.3.5" - required_providers { docker = { source = "kreuzwerker/docker" @@ -13,8 +11,17 @@ terraform { } } +locals { + host = "hash.trygvis.io" + public_ip = "138.201.33.16" + + hs = module.ipam6.hosts + ns = module.ipam6.networks + dn42_range = local.ns.hash_docker_dn42.range +} + provider "docker" { - host = "ssh://conflatorio.vpn.trygvis.io" + host = "ssh://${local.host}" } data "sops_file_entry" "linode_token" { @@ -22,14 +29,6 @@ data "sops_file_entry" "linode_token" { data_key = "linode_token" } -locals { - public_ip = "fdb1:4242:3538:2001::ffff" - network_addr = "fdb1:4242:3538:2001:1001::" - network_range = 112 - private_network_addr = "fdb1:4242:3538:2001:1002::" - private_network_range = 112 -} - -output "foo" { - value = "foo!" +module "ipam6" { + source = "../ipam6" } diff --git a/terraform/hash-docker/network.tf b/terraform/hash-docker/network.tf new file mode 100644 index 0000000..94ddeef --- /dev/null +++ b/terraform/hash-docker/network.tf @@ -0,0 +1,14 @@ +resource "docker_network" "dn42" { + name = "dn42" + + ipv6 = true + + ipam_config { + gateway = "172.20.0.1" + subnet = "172.20.0.0/16" + } + + ipam_config { + subnet = local.dn42_range + } +} diff --git a/terraform/hash-docker/terragrunt.hcl b/terraform/hash-docker/terragrunt.hcl new file mode 100644 index 0000000..e147285 --- /dev/null +++ b/terraform/hash-docker/terragrunt.hcl @@ -0,0 +1,3 @@ +include "root" { + path = find_in_parent_folders() +} diff --git a/terraform/hash-docker/traefik.tf b/terraform/hash-docker/traefik.tf new file mode 100644 index 0000000..96f50ec --- /dev/null +++ b/terraform/hash-docker/traefik.tf @@ -0,0 +1,107 @@ +resource "docker_network" "traefik" { + name = "traefik" +} + +resource "docker_image" "traefik" { + name = "traefik:3.3.4" +} + +resource "docker_container" "traefik" { + image = docker_image.traefik.image_id + name = "traefik" + privileged = false + must_run = false + + network_mode = "bridge" + + networks_advanced { + name = docker_network.traefik.name + } + + ports { + internal = 80 + external = 80 + ip = local.public_ip + } + + ports { + internal = 443 + external = 443 + ip = local.public_ip + } + + command = [ + "--log.level=INFO", + "--log.format=common", + "--log.noColor=true", + "--api=true", + "--api.dashboard=true", + "--api.debug=true", + # "--api.insecure=true", + "--providers.docker=true", + "--providers.docker.exposedbydefault=false", + "--entrypoints.websecure.address=:443", + "--entrypoints.web.address=:80", + "--entrypoints.web.http.redirections.entrypoint.to=websecure", + "--entrypoints.web.http.redirections.entrypoint.scheme=https", + "--certificatesresolvers.linode.acme.dnschallenge.provider=linode", + "--certificatesresolvers.linode.acme.dnschallenge.resolvers=1.1.1.1:53,8.8.8.8:53", + "--certificatesresolvers.linode.acme.email=root@trygvis.io", + "--certificatesresolvers.linode.acme.storage=/letsencrypt/acme.json", + + # There doesn't seem to be a way to define a specific + # serversTransport through the CLI or lables, to here backend + # certificate checks are globally disabled. + "--serverstransport.insecureskipverify", + ] + + dynamic "labels" { + for_each = [ + { label = "traefik.enable", value = "true" }, + { label = "traefik.http.routers.traefik.service", value = "api@internal" }, + { label = "traefik.http.routers.traefik.rule", value = "Host(`${local.host}`)" }, + { label = "traefik.http.routers.traefik.entrypoints", value = "websecure" }, + { label = "traefik.http.routers.traefik.tls.certresolver", value = "linode" }, + ] + content { + label = labels.value["label"] + value = labels.value["value"] + } + } + + env = [ + "LINODE_TOKEN=${data.sops_file_entry.linode_token.data}" + ] + + mounts { + source = "/etc/docker-service/traefik/letsencrypt" + target = "/letsencrypt" + type = "bind" + read_only = false + } + + mounts { + source = "/var/run/docker.sock" + target = "/var/run/docker.sock" + type = "bind" + read_only = true + } + + depends_on = [ + resource.null_resource.letsencrypt, + ] +} + +locals { + path = "/etc/docker-service/traefik/letsencrypt" +} + +resource "null_resource" "letsencrypt" { + triggers = { + path = local.path + } + + provisioner "local-exec" { + command = "ssh ${local.host} sudo mkdir -p ${local.path}" + } +} diff --git a/terraform/grafana/.terraform.lock.hcl b/terraform/hash-grafana/.terraform.lock.hcl index 4362198..3242795 100644 --- a/terraform/grafana/.terraform.lock.hcl +++ b/terraform/hash-grafana/.terraform.lock.hcl @@ -43,24 +43,24 @@ provider "registry.terraform.io/hashicorp/random" { } provider "registry.terraform.io/kreuzwerker/docker" { - version = "2.24.0" - constraints = "2.24.0" + version = "3.0.2" + constraints = "3.0.2" hashes = [ - "h1:1z0/qA77T3PS/1m4vRO8UgWjHjk5/v+f3JfGbMyzX18=", - "zh:181fefd55c8eb75efe9815c43fdd76422b57951ef53b5d5f19273a00fdf0e2e2", - "zh:2ec84e029d169f188be2addf7f45c2555f226f67d4b6fb66c1749ed5b2c4a76a", - "zh:6f5cf945148485f57b919d31a30f1a5a93d45f4e8edfdb0b80b22258d51795d8", - "zh:8d00c2c459a48453f52a00a8d1ffdb7bcf72fe4b3b09ffcfd52218c4646fa7fa", - "zh:9bd6e06601e0a972b9ce01150e32e76b76b4caf1d9798daf4cf16d06e2a8d4a3", - "zh:af72591132dc8cd338f293e458403851e6b8a6ac4c4d25a3268940f9763df7aa", - "zh:c4a47c5c7ad2ff1fc5212e69c5ef837a127346264e46ce7b5d13362545e4aa70", - "zh:c6d68f33efcd3372331ed0d58ec49e8b01ddc132934b14d2d45977076950e4b3", - "zh:db228855ae7235095d367f3597719747e5be0dd9ce2206ea02062560b518c08a", - "zh:e8d6ce89642925f2e813d0b829bd5562582de37eaa39351e231ab474383e703a", - "zh:ec83d8c86a918d25eb824cc99f98924ef8949eb69aa40cb5ff2db24369e52d9c", - "zh:ee0032d3d86adeeca7fdd4922bb8db87dbb5cd0093c054ff8efe2260de0b624c", - "zh:f033b70f342f32eeb98c213e6fc7098d7afd22b3146a5cb6173c128b0e86d732", - "zh:f1bc3a2c4f152f8adc9a1f9c852496232ef31073b149945756c13bc9688cf08b", + "h1:cT2ccWOtlfKYBUE60/v2/4Q6Stk1KYTNnhxSck+VPlU=", + "zh:15b0a2b2b563d8d40f62f83057d91acb02cd0096f207488d8b4298a59203d64f", + "zh:23d919de139f7cd5ebfd2ff1b94e6d9913f0977fcfc2ca02e1573be53e269f95", + "zh:38081b3fe317c7e9555b2aaad325ad3fa516a886d2dfa8605ae6a809c1072138", + "zh:4a9c5065b178082f79ad8160243369c185214d874ff5048556d48d3edd03c4da", + "zh:5438ef6afe057945f28bce43d76c4401254073de01a774760169ac1058830ac2", + "zh:60b7fadc287166e5c9873dfe53a7976d98244979e0ab66428ea0dea1ebf33e06", + "zh:61c5ec1cb94e4c4a4fb1e4a24576d5f39a955f09afb17dab982de62b70a9bdd1", + "zh:a38fe9016ace5f911ab00c88e64b156ebbbbfb72a51a44da3c13d442cd214710", + "zh:c2c4d2b1fd9ebb291c57f524b3bf9d0994ff3e815c0cd9c9bcb87166dc687005", + "zh:d567bb8ce483ab2cf0602e07eae57027a1a53994aba470fa76095912a505533d", + "zh:e83bf05ab6a19dd8c43547ce9a8a511f8c331a124d11ac64687c764ab9d5a792", + "zh:e90c934b5cd65516fbcc454c89a150bfa726e7cf1fe749790c7480bbeb19d387", + "zh:f05f167d2eaf913045d8e7b88c13757e3cf595dd5cd333057fdafc7c4b7fed62", + "zh:fcc9c1cea5ce85e8bcb593862e699a881bd36dffd29e2e367f82d15368659c3d", ] } diff --git a/terraform/hash-grafana/backend.tf b/terraform/hash-grafana/backend.tf new file mode 100644 index 0000000..b06355d --- /dev/null +++ b/terraform/hash-grafana/backend.tf @@ -0,0 +1,16 @@ +# Generated by Terragrunt. Sig: nIlQXj57tbuaRZEa +terraform { + required_version = "~> 1.9.5" + + backend "s3" { + bucket = "terraform-a6726272-73ff-11ed-8bdd-c79eb8376e05" + key = "hash-grafana/terraform.tfstate" + skip_region_validation = true + skip_credentials_validation = true + skip_metadata_api_check = true + skip_requesting_account_id = true + skip_s3_checksum = true + region = "eu-central-1" + endpoints = { s3 : "https://eu-central-1.linodeobjects.com" } + } +} diff --git a/terraform/grafana/grafana.tf b/terraform/hash-grafana/grafana.tf index 7cda977..b425e72 100644 --- a/terraform/grafana/grafana.tf +++ b/terraform/hash-grafana/grafana.tf @@ -1,5 +1,5 @@ resource "docker_image" "grafana" { - name = "grafana/grafana-oss:10.1.5" + name = "grafana/grafana-oss:11.2.2" } resource "docker_volume" "grafana" { @@ -19,14 +19,14 @@ resource "docker_container" "grafana" { } networks_advanced { - name = data.docker_network.private.name + name = data.docker_network.dn42.name } dynamic "labels" { for_each = [ { label = "traefik.enable", value = "true" }, { label = "traefik.docker.network", value = data.docker_network.traefik.name }, - { label = "traefik.http.routers.grafana.rule", value = "Host(`grafana.vpn.trygvis.io`)" }, + { label = "traefik.http.routers.grafana.rule", value = "Host(`grafana.trygvis.io`)" }, { label = "traefik.http.routers.grafana.entrypoints", value = "websecure" }, { label = "traefik.http.routers.grafana.tls.certresolver", value = "linode" }, ] @@ -38,7 +38,7 @@ resource "docker_container" "grafana" { env = [ "GF_DATABASE_TYPE=postgres", - "GF_DATABASE_HOST=[fdf3:aad9:a885:b3a::1]", + "GF_DATABASE_HOST=knot.dn42.trygvis.io", "GF_DATABASE_DATABASE=${postgresql_database.grafana.name}", "GF_DATABASE_USER=${postgresql_role.grafana.name}", "GF_DATABASE_PASSWORD=${postgresql_role.grafana.password}", @@ -47,5 +47,6 @@ resource "docker_container" "grafana" { volumes { volume_name = docker_volume.grafana.name container_path = "/var/lib/grafana" + read_only = false } } diff --git a/terraform/grafana/main.tf b/terraform/hash-grafana/main.tf index cb9b920..043b778 100644 --- a/terraform/grafana/main.tf +++ b/terraform/hash-grafana/main.tf @@ -1,10 +1,8 @@ terraform { - required_version = "~> 1.3.5" - required_providers { docker = { source = "kreuzwerker/docker" - version = "2.24.0" + version = "3.0.2" } postgresql = { source = "cyrilgdn/postgresql" @@ -21,8 +19,12 @@ terraform { } } +locals { + host = "hash.trygvis.io" +} + provider "docker" { - host = "ssh://conflatorio.vpn.trygvis.io" + host = "ssh://${local.host}" } data "sops_file_entry" "knot_pdb_terraform_password" { @@ -42,10 +44,6 @@ data "docker_network" "traefik" { name = "traefik" } -data "docker_network" "public" { - name = "public" -} - -data "docker_network" "private" { - name = "private" +data "docker_network" "dn42" { + name = "dn42" } diff --git a/terraform/grafana/pdb.tf b/terraform/hash-grafana/pdb.tf index e2a59cd..e2a59cd 100644 --- a/terraform/grafana/pdb.tf +++ b/terraform/hash-grafana/pdb.tf diff --git a/terraform/hash-grafana/terragrunt.hcl b/terraform/hash-grafana/terragrunt.hcl new file mode 100644 index 0000000..e147285 --- /dev/null +++ b/terraform/hash-grafana/terragrunt.hcl @@ -0,0 +1,3 @@ +include "root" { + path = find_in_parent_folders() +} diff --git a/terraform/hash-loki/.terraform.lock.hcl b/terraform/hash-loki/.terraform.lock.hcl new file mode 100644 index 0000000..7020808 --- /dev/null +++ b/terraform/hash-loki/.terraform.lock.hcl @@ -0,0 +1,85 @@ +# This file is maintained automatically by "terraform init". +# Manual edits may be lost in future updates. + +provider "registry.terraform.io/cyrilgdn/postgresql" { + version = "1.21.0" + constraints = "1.21.0" + hashes = [ + "h1:v7X6z6j8Uo07+QJPuO3EVM8N1uy6t2k+1GiRGioOPGc=", + "zh:17e3d204dabc116276c763bb0cd159aa315789d3b0bcd3b8aede935509960ab6", + "zh:1a7e5ac1921afdb3b12a49714c5f446a7604bfa1eb7bd9c123d607f8cbda45e4", + "zh:24a880623e30928ee866c84016b1db4e0458764c7a547b808e2d398e90456d42", + "zh:255c6162d35ace6a313a50c4ceb5452bd5582d7bb097a44e75ac4901e635ca13", + "zh:281ab48b69d0852b5138fe5ea2301ff7fdff30748f1f7878ac837c71622d3f7b", + "zh:3d4e0ae2809e743272e5d2640b64354c48140e225c2ba6f1a211700ea70e0754", + "zh:4f4df290e3ff626d8b274c624852d21d194a397a7f580ebe0cbf0ff64dd8fa31", + "zh:5997ce8f7cbcd7ff5a443d037b83857b17b64be928e9d9338dd494466733df60", + "zh:a05f0b65b0abf4488cdaf7b239206940940be77fd51f458f2a0986c6a17436aa", + "zh:aeb6c6da639abb6126f38be90a7bc428f925461bf599388ff092e059e0bb1a94", + "zh:d30bb053b6000c32cc8d03da231c30eaecddd926200adf2e9ad9c0186c2ad1ad", + "zh:d978827683b324c75141fa80ebc28dcaf181acd0be0a47b1e5f9579a72a08151", + "zh:f51fae9206361cbe865e30b06d106270d6acf7ece0550953b0d6b55afe6be9ba", + "zh:fa49a2702c529865c20f57185d6dd41072fdd9a13ac1a49e30eb88605c31af7a", + ] +} + +provider "registry.terraform.io/hashicorp/random" { + version = "3.5.1" + constraints = "3.5.1" + hashes = [ + "h1:VSnd9ZIPyfKHOObuQCaKfnjIHRtR7qTw19Rz8tJxm+k=", + "zh:04e3fbd610cb52c1017d282531364b9c53ef72b6bc533acb2a90671957324a64", + "zh:119197103301ebaf7efb91df8f0b6e0dd31e6ff943d231af35ee1831c599188d", + "zh:4d2b219d09abf3b1bb4df93d399ed156cadd61f44ad3baf5cf2954df2fba0831", + "zh:6130bdde527587bbe2dcaa7150363e96dbc5250ea20154176d82bc69df5d4ce3", + "zh:6cc326cd4000f724d3086ee05587e7710f032f94fc9af35e96a386a1c6f2214f", + "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", + "zh:b6d88e1d28cf2dfa24e9fdcc3efc77adcdc1c3c3b5c7ce503a423efbdd6de57b", + "zh:ba74c592622ecbcef9dc2a4d81ed321c4e44cddf7da799faa324da9bf52a22b2", + "zh:c7c5cde98fe4ef1143bd1b3ec5dc04baf0d4cc3ca2c5c7d40d17c0e9b2076865", + "zh:dac4bad52c940cd0dfc27893507c1e92393846b024c5a9db159a93c534a3da03", + "zh:de8febe2a2acd9ac454b844a4106ed295ae9520ef54dc8ed2faf29f12716b602", + "zh:eab0d0495e7e711cca367f7d4df6e322e6c562fc52151ec931176115b83ed014", + ] +} + +provider "registry.terraform.io/kreuzwerker/docker" { + version = "3.0.2" + constraints = "3.0.2" + hashes = [ + "h1:cT2ccWOtlfKYBUE60/v2/4Q6Stk1KYTNnhxSck+VPlU=", + "zh:15b0a2b2b563d8d40f62f83057d91acb02cd0096f207488d8b4298a59203d64f", + "zh:23d919de139f7cd5ebfd2ff1b94e6d9913f0977fcfc2ca02e1573be53e269f95", + "zh:38081b3fe317c7e9555b2aaad325ad3fa516a886d2dfa8605ae6a809c1072138", + "zh:4a9c5065b178082f79ad8160243369c185214d874ff5048556d48d3edd03c4da", + "zh:5438ef6afe057945f28bce43d76c4401254073de01a774760169ac1058830ac2", + "zh:60b7fadc287166e5c9873dfe53a7976d98244979e0ab66428ea0dea1ebf33e06", + "zh:61c5ec1cb94e4c4a4fb1e4a24576d5f39a955f09afb17dab982de62b70a9bdd1", + "zh:a38fe9016ace5f911ab00c88e64b156ebbbbfb72a51a44da3c13d442cd214710", + "zh:c2c4d2b1fd9ebb291c57f524b3bf9d0994ff3e815c0cd9c9bcb87166dc687005", + "zh:d567bb8ce483ab2cf0602e07eae57027a1a53994aba470fa76095912a505533d", + "zh:e83bf05ab6a19dd8c43547ce9a8a511f8c331a124d11ac64687c764ab9d5a792", + "zh:e90c934b5cd65516fbcc454c89a150bfa726e7cf1fe749790c7480bbeb19d387", + "zh:f05f167d2eaf913045d8e7b88c13757e3cf595dd5cd333057fdafc7c4b7fed62", + "zh:fcc9c1cea5ce85e8bcb593862e699a881bd36dffd29e2e367f82d15368659c3d", + ] +} + +provider "registry.terraform.io/lokkersp/sops" { + version = "0.6.10" + constraints = "0.6.10" + hashes = [ + "h1:atU8NIBxpNTWY+qBubvEOfjOn4K1aCDoq1iUFocgIHQ=", + "zh:0f053a26392a581b1f1ce6316cb7ed8ec4cc75e7f5f1cf7cfd45050b6b3c87ea", + "zh:207bb96c4471fce9aeb1b3c217d772692c3d865d294cf4d2501dad41de36a15e", + "zh:28506e8f1f3b9eaa95d99043440328044ee6340143535e5751538328a529d001", + "zh:3cae3bcea9e35fdc5b3f2af1b4580cd625c996448ad0c676c772260e46b25289", + "zh:3e44daaf82986c2b0028aeb17b867f3c68ed5dd8ac8625ba0406cf2a5fd3d92e", + "zh:457fb8ca2e677af24f9a4bdd8b613b1d7b604ad7133541657e5757c19268da71", + "zh:473d727c228f021a3df8cc8dcc6231ad7f90ed63f9e47c36b597d591e76228da", + "zh:48c4c1df39fd76ec8bd5fe9ac70cdc0927ac8be95582dbe46458b3442ce0fcd9", + "zh:728b19cb5c07e5e9d8b78fd94cc57d4c13582ecd24b7eb7c4cc2bf73b12fe4d1", + "zh:c51ed9af591779bb0910b82addeebb10f53428b994f8db653dd1dedcec60916c", + "zh:f569b65999264a9416862bca5cd2a6177d94ccb0424f3a4ef424428912b9cb3c", + ] +} diff --git a/terraform/hash-loki/backend.tf b/terraform/hash-loki/backend.tf new file mode 100644 index 0000000..699df68 --- /dev/null +++ b/terraform/hash-loki/backend.tf @@ -0,0 +1,16 @@ +# Generated by Terragrunt. Sig: nIlQXj57tbuaRZEa +terraform { + required_version = "~> 1.9.5" + + backend "s3" { + bucket = "terraform-a6726272-73ff-11ed-8bdd-c79eb8376e05" + key = "hash-loki/terraform.tfstate" + skip_region_validation = true + skip_credentials_validation = true + skip_metadata_api_check = true + skip_requesting_account_id = true + skip_s3_checksum = true + region = "eu-central-1" + endpoints = { s3 : "https://eu-central-1.linodeobjects.com" } + } +} diff --git a/terraform/hash-loki/loki-config.yaml b/terraform/hash-loki/loki-config.yaml new file mode 100644 index 0000000..72e68b0 --- /dev/null +++ b/terraform/hash-loki/loki-config.yaml @@ -0,0 +1,73 @@ +# Downloaded with wget https://raw.githubusercontent.com/grafana/loki/v3.0.0/cmd/loki/loki-local-config.yaml -O loki-config.yaml + +auth_enabled: false + +server: + http_listen_port: 3100 + grpc_listen_port: 9096 + +common: + instance_addr: 127.0.0.1 + path_prefix: /loki + storage: + filesystem: + chunks_directory: /loki/chunks + rules_directory: /loki/rules + replication_factor: 1 + ring: + kvstore: + store: inmemory + +query_range: + results_cache: + cache: + embedded_cache: + enabled: true + max_size_mb: 100 + +schema_config: + configs: + - from: 2020-10-24 + store: tsdb + object_store: filesystem + schema: v13 + index: + prefix: index_ + period: 24h + +ruler: + alertmanager_url: http://localhost:9093 + +# By default, Loki will send anonymous, but uniquely-identifiable usage and configuration +# analytics to Grafana Labs. These statistics are sent to https://stats.grafana.org/ +# +# Statistics help us better understand how Loki is used, and they show us performance +# levels for most users. This helps us prioritize features and documentation. +# For more information on what's sent, look at +# https://github.com/grafana/loki/blob/main/pkg/analytics/stats.go +# Refer to the buildReport method to see what goes into a report. +# +# If you would like to disable reporting, uncomment the following lines: +analytics: + reporting_enabled: false + +distributor: + otlp_config: + default_resource_attributes_as_index_labels: + - cloud.availability_zone + - cloud.region + - container.name + - deployment.environment + - k8s.cluster.name + - k8s.container.name + - k8s.cronjob.name + - k8s.daemonset.name + - k8s.deployment.name + - k8s.job.name + - k8s.namespace.name + - k8s.pod.name + - k8s.replicaset.name + - k8s.statefulset.name + - service.instance.id + - service.name + - service.namespace diff --git a/terraform/hash-loki/loki.tf b/terraform/hash-loki/loki.tf new file mode 100644 index 0000000..1e09037 --- /dev/null +++ b/terraform/hash-loki/loki.tf @@ -0,0 +1,59 @@ +resource "docker_image" "loki" { + name = "grafana/loki:3.3.0" +} + +resource "docker_volume" "loki" { + name = "loki" +} + +resource "docker_container" "loki" { + image = docker_image.loki.image_id + name = "loki" + privileged = false + must_run = true + + command = [ + "-config.file=${local.container_config_dir}/loki-config.yaml" + ] + + network_mode = "bridge" + + networks_advanced { + name = data.docker_network.traefik.name + } + + networks_advanced { + name = data.docker_network.dn42.name + } + + dynamic "labels" { + for_each = [ + { label = "traefik.enable", value = "true" }, + { label = "traefik.docker.network", value = data.docker_network.traefik.name }, + { label = "traefik.http.routers.loki.rule", value = "Host(`loki.trygvis.io`)" }, + { label = "traefik.http.routers.loki.entrypoints", value = "websecure" }, + { label = "traefik.http.routers.loki.tls.certresolver", value = "linode" }, + ] + content { + label = labels.value["label"] + value = labels.value["value"] + } + } + + env = [ + ] + + mounts { + source = local.host_config_dir + target = local.container_config_dir + type = "bind" + read_only = false + } + + volumes { + volume_name = docker_volume.loki.name + container_path = "/loki" + read_only = false + } +} + diff --git a/terraform/hash-loki/main.tf b/terraform/hash-loki/main.tf new file mode 100644 index 0000000..7f00e45 --- /dev/null +++ b/terraform/hash-loki/main.tf @@ -0,0 +1,39 @@ +terraform { + required_providers { + docker = { + source = "kreuzwerker/docker" + version = "3.0.2" + } + postgresql = { + source = "cyrilgdn/postgresql" + version = "1.21.0" + } + random = { + source = "hashicorp/random" + version = "3.5.1" + } + sops = { + source = "lokkersp/sops" + version = "0.6.10" + } + } +} + +locals { + host = "hash.trygvis.io" + host_config_dir = "/etc/docker-service/loki" + container_config_dir = "/config" +} + +provider "docker" { + host = "ssh://${local.host}" +} + +data "docker_network" "traefik" { + name = "traefik" +} + +data "docker_network" "dn42" { + name = "dn42" +} + diff --git a/terraform/hash-loki/play-config.yml b/terraform/hash-loki/play-config.yml new file mode 100644 index 0000000..955524f --- /dev/null +++ b/terraform/hash-loki/play-config.yml @@ -0,0 +1,17 @@ +- hosts: hash + tasks: + - become: yes + name: mkdir /etc/docker-service/loki + file: + path: /etc/docker-service/loki + state: directory + + - become: yes + name: cp /etc/docker-service/loki/loki-config.yaml + register: config + copy: + src: loki-config.yaml + dest: /etc/docker-service/loki/loki-config.yaml + +# - shell: docker kill --signal HUP loki +# when: config.changed diff --git a/terraform/hash-loki/terragrunt.hcl b/terraform/hash-loki/terragrunt.hcl new file mode 100644 index 0000000..e147285 --- /dev/null +++ b/terraform/hash-loki/terragrunt.hcl @@ -0,0 +1,3 @@ +include "root" { + path = find_in_parent_folders() +} diff --git a/terraform/hash-prometheus/.terraform.lock.hcl b/terraform/hash-prometheus/.terraform.lock.hcl new file mode 100644 index 0000000..52de25e --- /dev/null +++ b/terraform/hash-prometheus/.terraform.lock.hcl @@ -0,0 +1,123 @@ +# This file is maintained automatically by "terraform init". +# Manual edits may be lost in future updates. + +provider "registry.terraform.io/cyrilgdn/postgresql" { + version = "1.21.0" + constraints = "1.21.0" + hashes = [ + "h1:v7X6z6j8Uo07+QJPuO3EVM8N1uy6t2k+1GiRGioOPGc=", + "zh:17e3d204dabc116276c763bb0cd159aa315789d3b0bcd3b8aede935509960ab6", + "zh:1a7e5ac1921afdb3b12a49714c5f446a7604bfa1eb7bd9c123d607f8cbda45e4", + "zh:24a880623e30928ee866c84016b1db4e0458764c7a547b808e2d398e90456d42", + "zh:255c6162d35ace6a313a50c4ceb5452bd5582d7bb097a44e75ac4901e635ca13", + "zh:281ab48b69d0852b5138fe5ea2301ff7fdff30748f1f7878ac837c71622d3f7b", + "zh:3d4e0ae2809e743272e5d2640b64354c48140e225c2ba6f1a211700ea70e0754", + "zh:4f4df290e3ff626d8b274c624852d21d194a397a7f580ebe0cbf0ff64dd8fa31", + "zh:5997ce8f7cbcd7ff5a443d037b83857b17b64be928e9d9338dd494466733df60", + "zh:a05f0b65b0abf4488cdaf7b239206940940be77fd51f458f2a0986c6a17436aa", + "zh:aeb6c6da639abb6126f38be90a7bc428f925461bf599388ff092e059e0bb1a94", + "zh:d30bb053b6000c32cc8d03da231c30eaecddd926200adf2e9ad9c0186c2ad1ad", + "zh:d978827683b324c75141fa80ebc28dcaf181acd0be0a47b1e5f9579a72a08151", + "zh:f51fae9206361cbe865e30b06d106270d6acf7ece0550953b0d6b55afe6be9ba", + "zh:fa49a2702c529865c20f57185d6dd41072fdd9a13ac1a49e30eb88605c31af7a", + ] +} + +provider "registry.terraform.io/hashicorp/local" { + version = "2.5.2" + hashes = [ + "h1:JlMZD6nYqJ8sSrFfEAH0Vk/SL8WLZRmFaMUF9PJK5wM=", + "zh:136299545178ce281c56f36965bf91c35407c11897f7082b3b983d86cb79b511", + "zh:3b4486858aa9cb8163378722b642c57c529b6c64bfbfc9461d940a84cd66ebea", + "zh:4855ee628ead847741aa4f4fc9bed50cfdbf197f2912775dd9fe7bc43fa077c0", + "zh:4b8cd2583d1edcac4011caafe8afb7a95e8110a607a1d5fb87d921178074a69b", + "zh:52084ddaff8c8cd3f9e7bcb7ce4dc1eab00602912c96da43c29b4762dc376038", + "zh:71562d330d3f92d79b2952ffdda0dad167e952e46200c767dd30c6af8d7c0ed3", + "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", + "zh:805f81ade06ff68fa8b908d31892eaed5c180ae031c77ad35f82cb7a74b97cf4", + "zh:8b6b3ebeaaa8e38dd04e56996abe80db9be6f4c1df75ac3cccc77642899bd464", + "zh:ad07750576b99248037b897de71113cc19b1a8d0bc235eb99173cc83d0de3b1b", + "zh:b9f1c3bfadb74068f5c205292badb0661e17ac05eb23bfe8bd809691e4583d0e", + "zh:cc4cbcd67414fefb111c1bf7ab0bc4beb8c0b553d01719ad17de9a047adff4d1", + ] +} + +provider "registry.terraform.io/hashicorp/null" { + version = "3.2.3" + hashes = [ + "h1:+AnORRgFbRO6qqcfaQyeX80W0eX3VmjadjnUFUJTiXo=", + "zh:22d062e5278d872fe7aed834f5577ba0a5afe34a3bdac2b81f828d8d3e6706d2", + "zh:23dead00493ad863729495dc212fd6c29b8293e707b055ce5ba21ee453ce552d", + "zh:28299accf21763ca1ca144d8f660688d7c2ad0b105b7202554ca60b02a3856d3", + "zh:55c9e8a9ac25a7652df8c51a8a9a422bd67d784061b1de2dc9fe6c3cb4e77f2f", + "zh:756586535d11698a216291c06b9ed8a5cc6a4ec43eee1ee09ecd5c6a9e297ac1", + "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", + "zh:9d5eea62fdb587eeb96a8c4d782459f4e6b73baeece4d04b4a40e44faaee9301", + "zh:a6355f596a3fb8fc85c2fb054ab14e722991533f87f928e7169a486462c74670", + "zh:b5a65a789cff4ada58a5baffc76cb9767dc26ec6b45c00d2ec8b1b027f6db4ed", + "zh:db5ab669cf11d0e9f81dc380a6fdfcac437aea3d69109c7aef1a5426639d2d65", + "zh:de655d251c470197bcbb5ac45d289595295acb8f829f6c781d4a75c8c8b7c7dd", + "zh:f5c68199f2e6076bce92a12230434782bf768103a427e9bb9abee99b116af7b5", + ] +} + +provider "registry.terraform.io/hashicorp/random" { + version = "3.5.1" + constraints = "3.5.1" + hashes = [ + "h1:VSnd9ZIPyfKHOObuQCaKfnjIHRtR7qTw19Rz8tJxm+k=", + "zh:04e3fbd610cb52c1017d282531364b9c53ef72b6bc533acb2a90671957324a64", + "zh:119197103301ebaf7efb91df8f0b6e0dd31e6ff943d231af35ee1831c599188d", + "zh:4d2b219d09abf3b1bb4df93d399ed156cadd61f44ad3baf5cf2954df2fba0831", + "zh:6130bdde527587bbe2dcaa7150363e96dbc5250ea20154176d82bc69df5d4ce3", + "zh:6cc326cd4000f724d3086ee05587e7710f032f94fc9af35e96a386a1c6f2214f", + "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", + "zh:b6d88e1d28cf2dfa24e9fdcc3efc77adcdc1c3c3b5c7ce503a423efbdd6de57b", + "zh:ba74c592622ecbcef9dc2a4d81ed321c4e44cddf7da799faa324da9bf52a22b2", + "zh:c7c5cde98fe4ef1143bd1b3ec5dc04baf0d4cc3ca2c5c7d40d17c0e9b2076865", + "zh:dac4bad52c940cd0dfc27893507c1e92393846b024c5a9db159a93c534a3da03", + "zh:de8febe2a2acd9ac454b844a4106ed295ae9520ef54dc8ed2faf29f12716b602", + "zh:eab0d0495e7e711cca367f7d4df6e322e6c562fc52151ec931176115b83ed014", + ] +} + +provider "registry.terraform.io/kreuzwerker/docker" { + version = "3.0.2" + constraints = "3.0.2" + hashes = [ + "h1:cT2ccWOtlfKYBUE60/v2/4Q6Stk1KYTNnhxSck+VPlU=", + "zh:15b0a2b2b563d8d40f62f83057d91acb02cd0096f207488d8b4298a59203d64f", + "zh:23d919de139f7cd5ebfd2ff1b94e6d9913f0977fcfc2ca02e1573be53e269f95", + "zh:38081b3fe317c7e9555b2aaad325ad3fa516a886d2dfa8605ae6a809c1072138", + "zh:4a9c5065b178082f79ad8160243369c185214d874ff5048556d48d3edd03c4da", + "zh:5438ef6afe057945f28bce43d76c4401254073de01a774760169ac1058830ac2", + "zh:60b7fadc287166e5c9873dfe53a7976d98244979e0ab66428ea0dea1ebf33e06", + "zh:61c5ec1cb94e4c4a4fb1e4a24576d5f39a955f09afb17dab982de62b70a9bdd1", + "zh:a38fe9016ace5f911ab00c88e64b156ebbbbfb72a51a44da3c13d442cd214710", + "zh:c2c4d2b1fd9ebb291c57f524b3bf9d0994ff3e815c0cd9c9bcb87166dc687005", + "zh:d567bb8ce483ab2cf0602e07eae57027a1a53994aba470fa76095912a505533d", + "zh:e83bf05ab6a19dd8c43547ce9a8a511f8c331a124d11ac64687c764ab9d5a792", + "zh:e90c934b5cd65516fbcc454c89a150bfa726e7cf1fe749790c7480bbeb19d387", + "zh:f05f167d2eaf913045d8e7b88c13757e3cf595dd5cd333057fdafc7c4b7fed62", + "zh:fcc9c1cea5ce85e8bcb593862e699a881bd36dffd29e2e367f82d15368659c3d", + ] +} + +provider "registry.terraform.io/lokkersp/sops" { + version = "0.6.10" + constraints = "0.6.10" + hashes = [ + "h1:atU8NIBxpNTWY+qBubvEOfjOn4K1aCDoq1iUFocgIHQ=", + "zh:0f053a26392a581b1f1ce6316cb7ed8ec4cc75e7f5f1cf7cfd45050b6b3c87ea", + "zh:207bb96c4471fce9aeb1b3c217d772692c3d865d294cf4d2501dad41de36a15e", + "zh:28506e8f1f3b9eaa95d99043440328044ee6340143535e5751538328a529d001", + "zh:3cae3bcea9e35fdc5b3f2af1b4580cd625c996448ad0c676c772260e46b25289", + "zh:3e44daaf82986c2b0028aeb17b867f3c68ed5dd8ac8625ba0406cf2a5fd3d92e", + "zh:457fb8ca2e677af24f9a4bdd8b613b1d7b604ad7133541657e5757c19268da71", + "zh:473d727c228f021a3df8cc8dcc6231ad7f90ed63f9e47c36b597d591e76228da", + "zh:48c4c1df39fd76ec8bd5fe9ac70cdc0927ac8be95582dbe46458b3442ce0fcd9", + "zh:728b19cb5c07e5e9d8b78fd94cc57d4c13582ecd24b7eb7c4cc2bf73b12fe4d1", + "zh:c51ed9af591779bb0910b82addeebb10f53428b994f8db653dd1dedcec60916c", + "zh:f569b65999264a9416862bca5cd2a6177d94ccb0424f3a4ef424428912b9cb3c", + ] +} diff --git a/terraform/hash-prometheus/backend.tf b/terraform/hash-prometheus/backend.tf new file mode 100644 index 0000000..d531b8d --- /dev/null +++ b/terraform/hash-prometheus/backend.tf @@ -0,0 +1,16 @@ +# Generated by Terragrunt. Sig: nIlQXj57tbuaRZEa +terraform { + required_version = "~> 1.9.5" + + backend "s3" { + bucket = "terraform-a6726272-73ff-11ed-8bdd-c79eb8376e05" + key = "hash-prometheus/terraform.tfstate" + skip_region_validation = true + skip_credentials_validation = true + skip_metadata_api_check = true + skip_requesting_account_id = true + skip_s3_checksum = true + region = "eu-central-1" + endpoints = { s3 : "https://eu-central-1.linodeobjects.com" } + } +} diff --git a/terraform/hash-prometheus/main.tf b/terraform/hash-prometheus/main.tf new file mode 100644 index 0000000..cbf843e --- /dev/null +++ b/terraform/hash-prometheus/main.tf @@ -0,0 +1,36 @@ +terraform { + required_providers { + docker = { + source = "kreuzwerker/docker" + version = "3.0.2" + } + postgresql = { + source = "cyrilgdn/postgresql" + version = "1.21.0" + } + random = { + source = "hashicorp/random" + version = "3.5.1" + } + sops = { + source = "lokkersp/sops" + version = "0.6.10" + } + } +} + +locals { + host = "hash.trygvis.io" +} + +provider "docker" { + host = "ssh://${local.host}" +} + +data "docker_network" "traefik" { + name = "traefik" +} + +data "docker_network" "dn42" { + name = "dn42" +} diff --git a/terraform/hash-prometheus/play-config.yml b/terraform/hash-prometheus/play-config.yml new file mode 100644 index 0000000..92ec3e6 --- /dev/null +++ b/terraform/hash-prometheus/play-config.yml @@ -0,0 +1,17 @@ +- hosts: hash + tasks: + - become: yes + name: mkdir /etc/docker-service/prometheus + file: + path: /etc/docker-service/prometheus + state: directory + + - become: yes + name: cp /etc/docker-service/prometheus/prometheus.yml + register: config + copy: + src: prometheus.yml + dest: /etc/docker-service/prometheus/prometheus.yml + + - shell: docker kill --signal HUP prometheus + when: config.changed diff --git a/terraform/hash-prometheus/prometheus.tf b/terraform/hash-prometheus/prometheus.tf new file mode 100644 index 0000000..09df3ee --- /dev/null +++ b/terraform/hash-prometheus/prometheus.tf @@ -0,0 +1,70 @@ +data "docker_registry_image" "prometheus" { + name = "prom/prometheus:v2.53.2" +} + +resource "docker_image" "prometheus" { + name = data.docker_registry_image.prometheus.name + pull_triggers = [data.docker_registry_image.prometheus.sha256_digest] +} + +resource "docker_volume" "prometheus" { + name = "prometheus" +} + +resource "docker_container" "prometheus" { + image = docker_image.prometheus.image_id + name = "prometheus" + must_run = true + + env = [ + ] + + command = [ +#"/bin/prometheus", + "--config.file=/etc/prometheus/prometheus.yml", + "--storage.tsdb.path=/prometheus", + "--web.console.libraries=/usr/share/prometheus/console_libraries", + "--web.console.templates=/usr/share/prometheus/consoles", + "--storage.tsdb.retention.time=100y", + ] + + networks_advanced { + name = data.docker_network.dn42.name + } + + # networks_advanced { + # name = data.docker_network.traefik.name + # } + + # dynamic "labels" { + # for_each = [ + # { label = "traefik.enable", value = "true" }, + # { label = "traefik.docker.network", value = data.docker_network.traefik.name }, + # { label = "traefik.http.routers.prometheus.rule", value = "Host(`prometheus.trygvis.io`)" }, + # { label = "traefik.http.routers.prometheus.entrypoints", value = "websecure" }, + # { label = "traefik.http.routers.prometheus.tls.certresolver", value = "linode" }, + # ] + # content { + # label = labels.value["label"] + # value = labels.value["value"] + # } + # } + + mounts { + source = local.path + target = "/etc/prometheus" + type = "bind" + read_only = false + } + + volumes { + volume_name = docker_volume.prometheus.name + read_only = false + container_path = "/prometheus" + } + +} + +locals { + path = "/etc/docker-service/prometheus" +} diff --git a/terraform/hash-prometheus/prometheus.yml b/terraform/hash-prometheus/prometheus.yml new file mode 100644 index 0000000..9c0ede7 --- /dev/null +++ b/terraform/hash-prometheus/prometheus.yml @@ -0,0 +1,91 @@ +global: + scrape_interval: 60s + +scrape_configs: + - job_name: node + scrape_interval: 30s + static_configs: + - targets: + - "conflatorio.dn42.trygvis.io:9100" + - "coregonus.dn42.trygvis.io:9100" + - "hash.dn42.trygvis.io:9100" + - "knot.dn42.trygvis.io:9100" + - "lhn2pi.dn42.trygvis.io:9100" + + - job_name: bird + scrape_interval: 30s + static_configs: + - targets: + - "coregonus.dn42.trygvis.io:9324" + - "hash.dn42.trygvis.io:9324" + - "knot.dn42.trygvis.io:9324" + - "lhn2pi.dn42.trygvis.io:9324" + + - job_name: libvirt + scrape_interval: 30s + static_configs: + - targets: + - "conflatorio.dn42.trygvis.io:9177" + - "hash.dn42.trygvis.io:9177" + + - job_name: snmp_kv24_ap + scrape_interval: 60s + static_configs: + - targets: + - "192.168.10.20" + - "192.168.10.21" + - "192.168.10.22" + - "192.168.10.23" + - "192.168.10.25" + - "192.168.10.26" + metrics_path: /snmp + params: + auth: [public_v2] + module: + - if_mib + - ubiquiti_unifi + relabel_configs: + - source_labels: [__address__] + target_label: __param_target + - source_labels: [__param_target] + target_label: instance + - target_label: __address__ + replacement: "coregonus.dn42.trygvis.io:9116" + + - job_name: snmp_kv24_sw + scrape_interval: 60s + static_configs: + - targets: + - "192.168.10.10" + - "192.168.10.11" + - "192.168.10.12" + metrics_path: /snmp + params: + auth: [public_v2] + module: + - if_mib + relabel_configs: + - source_labels: [__address__] + target_label: __param_target + - source_labels: [__param_target] + target_label: instance + - target_label: __address__ + replacement: "coregonus.dn42.trygvis.io:9116" + + - job_name: snmp_kv24_router + scrape_interval: 60s + static_configs: + - targets: + - "192.168.10.1" + metrics_path: /snmp + params: + auth: [public_v2] + module: + - if_mib + relabel_configs: + - source_labels: [__address__] + target_label: __param_target + - source_labels: [__param_target] + target_label: instance + - target_label: __address__ + replacement: "coregonus.dn42.trygvis.io:9116" diff --git a/terraform/hash-prometheus/terragrunt.hcl b/terraform/hash-prometheus/terragrunt.hcl new file mode 100644 index 0000000..e147285 --- /dev/null +++ b/terraform/hash-prometheus/terragrunt.hcl @@ -0,0 +1,3 @@ +include "root" { + path = find_in_parent_folders() +} diff --git a/terraform/ipam6/ipam6.tf b/terraform/ipam6/ipam6.tf new file mode 100644 index 0000000..08ad9a0 --- /dev/null +++ b/terraform/ipam6/ipam6.tf @@ -0,0 +1,249 @@ +output "networks" { + value = { + bitraf_dn42 = { + range = "fdb1:4242:3538::/48" + address = "fdb1:4242:3538::" + prefix = "48" + hosts = { + } + } + tnet_dn42 = { + range = "fdb1:4242:3538:2000::/52" + address = "fdb1:4242:3538:2000::" + prefix = "52" + hosts = { + } + } + unused_2001 = { + range = "fdb1:4242:3538:2001::/64" + address = "fdb1:4242:3538:2001::" + prefix = "64" + hosts = { + } + } + node1_dn42 = { + range = "fdb1:4242:3538:2002::/64" + address = "fdb1:4242:3538:2002::" + prefix = "64" + hosts = { + node1 = { + address : "fdb1:4242:3538:2002::ffff" + prefix : "128" + } + } + } + node2_dn42 = { + range = "fdb1:4242:3538:2003::/64" + address = "fdb1:4242:3538:2003::" + prefix = "64" + hosts = { + node2 = { + address : "fdb1:4242:3538:2003::ffff" + prefix : "128" + } + } + } + knot_dn42 = { + range = "fdb1:4242:3538:2004::/64" + address = "fdb1:4242:3538:2004::" + prefix = "64" + hosts = { + knot = { + address : "fdb1:4242:3538:2004::ffff" + prefix : "128" + } + } + } + coregonus_dn42 = { + range = "fdb1:4242:3538:2005::/64" + address = "fdb1:4242:3538:2005::" + prefix = "64" + hosts = { + kjell = { + address : "fdb1:4242:3538:2006:2f0:cbff:fefe:d98c" + prefix : "64" + } + } + } + coregonus_docker = { + range = "fdb1:4242:3538:2005:df01:676a:ec28:0a00/120" + address = "fdb1:4242:3538:2005:df01:676a:ec28:a00" + prefix = "120" + hosts = { + } + } + kv24_pub = { + range = "2a01:799:111d:1801::/64" + address = "2a01:799:111d:1801::" + prefix = "64" + hosts = { + } + } + kv24_dn42 = { + range = "fdb1:4242:3538:2006::/64" + address = "fdb1:4242:3538:2006::" + prefix = "64" + hosts = { + kv24ix = { + address : "fdb1:4242:3538:2006::ffff" + prefix : "128" + } + garasjepi = { + address : "fdb1:4242:3538:2006:e9f7:418f:49fd:8d2e" + prefix : "128" + } + ha-kv24 = { + address : "fdb1:4242:3538:2006:18a:90f:4264:8ca0" + prefix : "64" + } + netbox = { + address : "fdb1:4242:3538:2006:be24:11ff:febb:5c7f" + prefix : "64" + } + coregonus = { + address : "fdb1:4242:3538:2006:2e0:4cff:fe98:1bb5" + prefix : "64" + } + } + } + hash_dn42 = { + range = "fdb1:4242:3538:2007::/64" + address = "fdb1:4242:3538:2007::" + prefix = "64" + hosts = { + hash = { + address : "fdb1:4242:3538:2007::ffff" + prefix : "128" + } + } + } + hash_docker_dn42 = { + range = "fdb1:4242:3538:2007:1001::/112" + address = "fdb1:4242:3538:2007:1001::" + prefix = "112" + hosts = { + } + } + lhn2_dn42 = { + range = "fdb1:4242:3538:2008::/64" + address = "fdb1:4242:3538:2008::" + prefix = "64" + hosts = { + lhn2pi = { + address : "fdb1:4242:3538:2008::ffff" + prefix : "128" + } + lhn2-z2m = { + address : "fdb1:4242:3538:2008:9aed:e460:1711:7dd" + prefix : "128" + } + ha-lhn2 = { + address : "fdb1:4242:3538:2008:9c59:926f:1dc9:89db" + prefix : "128" + } + conflatorio = { + address : "fdb1:4242:3538:2008:8042:32ff:fe0c:7161" + prefix : "128" + } + danneri = { + address : "fdb1:4242:3538:2008:9422:d355:95b7:f170" + prefix : "128" + } + unifi = { + address : "fdb1:4242:3538:2008:5054:ff:fe4d:96c" + prefix : "128" + } + } + } + danneri_cluster = { + range = "fdb1:4242:3538:2008:aaaa:aaaa:aaaa::/112" + address = "fdb1:4242:3538:2008:aaaa:aaaa:aaaa:0" + prefix = "112" + hosts = { + } + } + danneri_service = { + range = "fdb1:4242:3538:2008:bbbb:bbbb:bbbb::/112" + address = "fdb1:4242:3538:2008:bbbb:bbbb:bbbb:0" + prefix = "112" + hosts = { + } + } + dn42 = { + range = "fd00::/8" + address = "fd00::" + prefix = "8" + hosts = { + } + } + } +} + +output "hosts" { + value = { + node1 = { + address : "fdb1:4242:3538:2002::ffff" + prefix : "128" + } + node2 = { + address : "fdb1:4242:3538:2003::ffff" + prefix : "128" + } + knot = { + address : "fdb1:4242:3538:2004::ffff" + prefix : "128" + } + kjell = { + address : "fdb1:4242:3538:2006:2f0:cbff:fefe:d98c" + prefix : "64" + } + kv24ix = { + address : "fdb1:4242:3538:2006::ffff" + prefix : "128" + } + garasjepi = { + address : "fdb1:4242:3538:2006:e9f7:418f:49fd:8d2e" + prefix : "128" + } + ha-kv24 = { + address : "fdb1:4242:3538:2006:18a:90f:4264:8ca0" + prefix : "64" + } + netbox = { + address : "fdb1:4242:3538:2006:be24:11ff:febb:5c7f" + prefix : "64" + } + coregonus = { + address : "fdb1:4242:3538:2006:2e0:4cff:fe98:1bb5" + prefix : "64" + } + hash = { + address : "fdb1:4242:3538:2007::ffff" + prefix : "128" + } + lhn2pi = { + address : "fdb1:4242:3538:2008::ffff" + prefix : "128" + } + lhn2-z2m = { + address : "fdb1:4242:3538:2008:9aed:e460:1711:7dd" + prefix : "128" + } + ha-lhn2 = { + address : "fdb1:4242:3538:2008:9c59:926f:1dc9:89db" + prefix : "128" + } + conflatorio = { + address : "fdb1:4242:3538:2008:8042:32ff:fe0c:7161" + prefix : "128" + } + danneri = { + address : "fdb1:4242:3538:2008:9422:d355:95b7:f170" + prefix : "128" + } + unifi = { + address : "fdb1:4242:3538:2008:5054:ff:fe4d:96c" + prefix : "128" + } + } +} diff --git a/terraform/lhn2pi-zigbee2mqtt/.terraform.lock.hcl b/terraform/lhn2pi-zigbee2mqtt/.terraform.lock.hcl new file mode 100644 index 0000000..e61b376 --- /dev/null +++ b/terraform/lhn2pi-zigbee2mqtt/.terraform.lock.hcl @@ -0,0 +1,87 @@ +# This file is maintained automatically by "terraform init". +# Manual edits may be lost in future updates. + +provider "registry.terraform.io/cyrilgdn/postgresql" { + version = "1.18.0" + constraints = "1.18.0" + hashes = [ + "h1:Nf26liFILUZXPh1P2B8T3qtq2Tc7objtm0sBSt0lhh0=", + "zh:251b609167ce25e974607c0c7dd3f90cfc45980c9068364f896e26c31416d96c", + "zh:317980d14a6a171f118bb522ffd02046e508d98100073f97671aeb2adae30d79", + "zh:3622c6414e91f8ccceed94ddf12062a22c14de4fac73c6142b009ae791ca7cd4", + "zh:36be2b338c230b0ab0c7b4c55049dba9bd8d705973c2cceaf3e293d41f520db5", + "zh:4332e83b91f60c43679ff9660c8ef4ebe251e05926a4d20dc64db1bfbabc8670", + "zh:444835840c917aff17f49f9f7b4ae542d5bd9f2ec306b581d1931b00380213bd", + "zh:5174bd85ea94ed4a6cef6c02bc27498f47ac21841fcab7487ab19d8513c97e54", + "zh:61c6eb6b2bf18cdc0734c101854e25990ba24a16580c6bbc599a0b00f72be397", + "zh:b40bbc61a4e522b22ebd57f01a518370a97cd6945e4bdd2955e5f887c88ee3f6", + "zh:d7aeb158c884f6590d6033cd44d5e9438f648bcb5ca3bd54573847c287845b00", + "zh:da3bee1282f6b48572d15f7a693113931afb306b98e29c09c9a054bdc3d6df44", + "zh:ec864a068eeab48899d99405f5606379478df8e48c005844d63a5360c23d5e15", + "zh:fda709d1cabde236b79c98c9abb80f2c1591fdea751afadc546073056be6e6ba", + "zh:ff08607ab25d1c5b55c3794b67a4ee2c9ac5023962c196ce587df34f0e201ca6", + ] +} + +provider "registry.terraform.io/kreuzwerker/docker" { + version = "3.0.2" + constraints = "3.0.2" + hashes = [ + "h1:cT2ccWOtlfKYBUE60/v2/4Q6Stk1KYTNnhxSck+VPlU=", + "zh:15b0a2b2b563d8d40f62f83057d91acb02cd0096f207488d8b4298a59203d64f", + "zh:23d919de139f7cd5ebfd2ff1b94e6d9913f0977fcfc2ca02e1573be53e269f95", + "zh:38081b3fe317c7e9555b2aaad325ad3fa516a886d2dfa8605ae6a809c1072138", + "zh:4a9c5065b178082f79ad8160243369c185214d874ff5048556d48d3edd03c4da", + "zh:5438ef6afe057945f28bce43d76c4401254073de01a774760169ac1058830ac2", + "zh:60b7fadc287166e5c9873dfe53a7976d98244979e0ab66428ea0dea1ebf33e06", + "zh:61c5ec1cb94e4c4a4fb1e4a24576d5f39a955f09afb17dab982de62b70a9bdd1", + "zh:a38fe9016ace5f911ab00c88e64b156ebbbbfb72a51a44da3c13d442cd214710", + "zh:c2c4d2b1fd9ebb291c57f524b3bf9d0994ff3e815c0cd9c9bcb87166dc687005", + "zh:d567bb8ce483ab2cf0602e07eae57027a1a53994aba470fa76095912a505533d", + "zh:e83bf05ab6a19dd8c43547ce9a8a511f8c331a124d11ac64687c764ab9d5a792", + "zh:e90c934b5cd65516fbcc454c89a150bfa726e7cf1fe749790c7480bbeb19d387", + "zh:f05f167d2eaf913045d8e7b88c13757e3cf595dd5cd333057fdafc7c4b7fed62", + "zh:fcc9c1cea5ce85e8bcb593862e699a881bd36dffd29e2e367f82d15368659c3d", + ] +} + +provider "registry.terraform.io/linode/linode" { + version = "1.30.0" + constraints = "1.30.0" + hashes = [ + "h1:rd4yQ7u3awn2kTqdKf5D67TTeo6rybYpDry/WwvolRA=", + "zh:197c61c5eb2252f65c18d2aa65cdc0511617b13e2388118f3fe063d7969dd7ad", + "zh:1a66470682acb13dc57308d5b1eaa19ff60c2404a3b15714e3072d02d569b1a5", + "zh:368cdcf17073a39687da830c02cf3ce50e0d8f03b7ec808b49561628be798abc", + "zh:42f2510a70afbb7fc8928df119d1e14ce1b61d2aded13b88072858ee5861feb2", + "zh:57734dd1e8255abd52a33ff79c20ef4efc3831850b22dd1a628e6301c3cf95c6", + "zh:61d614a7a4607bfc4ab6bfd0501007501957b973dbd028e0e513a3d4df07f12e", + "zh:79243f22fc0a9adfc1123abdd17c515f0ce4d8147302889033b6c44f6a48337e", + "zh:9f7cd46185bbe2c001dab1d0bd6c17a9740e7279d3fffe93755f2c964e267213", + "zh:9fdc9f8f47bde4140bc14cf082bbc2ceb63a3bebf0683df2fefd83c9e248274c", + "zh:aa1fd80a7ea245f8b852e40c68ccde2d8b6446e2138ebdec7425c67e82099881", + "zh:bb31f1ba5b0e001cf343d3a4cfafa70e6f3e30fd8a200d2cd7e077663efe0456", + "zh:da87881fa030287df2009028c49581e1fd0ff89baef0d8543b27ca506eff2971", + "zh:ed6afd7b1bc7237a9dff5c721ca3a5c7c505803cd5ea0b4ad0dfdf07ed6f9b0d", + "zh:ee653d5d08cb331ce2d8dc1010e68d363470ae87be62c0515e5d2418727cd02b", + ] +} + +provider "registry.terraform.io/lokkersp/sops" { + version = "0.6.10" + constraints = "0.6.10" + hashes = [ + "h1:atU8NIBxpNTWY+qBubvEOfjOn4K1aCDoq1iUFocgIHQ=", + "zh:0f053a26392a581b1f1ce6316cb7ed8ec4cc75e7f5f1cf7cfd45050b6b3c87ea", + "zh:207bb96c4471fce9aeb1b3c217d772692c3d865d294cf4d2501dad41de36a15e", + "zh:28506e8f1f3b9eaa95d99043440328044ee6340143535e5751538328a529d001", + "zh:3cae3bcea9e35fdc5b3f2af1b4580cd625c996448ad0c676c772260e46b25289", + "zh:3e44daaf82986c2b0028aeb17b867f3c68ed5dd8ac8625ba0406cf2a5fd3d92e", + "zh:457fb8ca2e677af24f9a4bdd8b613b1d7b604ad7133541657e5757c19268da71", + "zh:473d727c228f021a3df8cc8dcc6231ad7f90ed63f9e47c36b597d591e76228da", + "zh:48c4c1df39fd76ec8bd5fe9ac70cdc0927ac8be95582dbe46458b3442ce0fcd9", + "zh:728b19cb5c07e5e9d8b78fd94cc57d4c13582ecd24b7eb7c4cc2bf73b12fe4d1", + "zh:c51ed9af591779bb0910b82addeebb10f53428b994f8db653dd1dedcec60916c", + "zh:f569b65999264a9416862bca5cd2a6177d94ccb0424f3a4ef424428912b9cb3c", + ] +} diff --git a/terraform/conflatorio-docker/backend.tf b/terraform/lhn2pi-zigbee2mqtt/backend.tf index d2de289..7251725 100644 --- a/terraform/conflatorio-docker/backend.tf +++ b/terraform/lhn2pi-zigbee2mqtt/backend.tf @@ -1,12 +1,16 @@ # Generated by Terragrunt. Sig: nIlQXj57tbuaRZEa terraform { + required_version = "~> 1.9.5" + backend "s3" { bucket = "terraform-a6726272-73ff-11ed-8bdd-c79eb8376e05" - key = "conflatorio-docker/terraform.tfstate" + key = "lhn2pi-zigbee2mqtt/terraform.tfstate" skip_region_validation = true skip_credentials_validation = true skip_metadata_api_check = true + skip_requesting_account_id = true + skip_s3_checksum = true region = "eu-central-1" - endpoint = "eu-central-1.linodeobjects.com" + endpoints = { s3 : "https://eu-central-1.linodeobjects.com" } } } diff --git a/terraform/lhn2pi-zigbee2mqtt/main.tf b/terraform/lhn2pi-zigbee2mqtt/main.tf new file mode 100644 index 0000000..2857b99 --- /dev/null +++ b/terraform/lhn2pi-zigbee2mqtt/main.tf @@ -0,0 +1,29 @@ +terraform { + required_providers { + docker = { + source = "kreuzwerker/docker" + version = "3.0.2" + } + } +} + +provider "docker" { + host = "ssh://${local.host}" +} + +locals { + host = "lhn2pi.dn42.trygvis.io" + docker_image = "koenkk/zigbee2mqtt:1.42.0" + public_ip = module.ipam.hosts.lhn2pi.address +} + +module "ipam" { + source = "../ipam6" +} + +module "zigbee2mqtt" { + source = "../modules/zigbee2mqtt" + + public_ip = local.public_ip + serial_port = "/dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2688076-if00" +} diff --git a/terraform/lhn2pi-zigbee2mqtt/terragrunt.hcl b/terraform/lhn2pi-zigbee2mqtt/terragrunt.hcl new file mode 100644 index 0000000..e147285 --- /dev/null +++ b/terraform/lhn2pi-zigbee2mqtt/terragrunt.hcl @@ -0,0 +1,3 @@ +include "root" { + path = find_in_parent_folders() +} diff --git a/terraform/modules/zigbee2mqtt/.terraform.lock.hcl b/terraform/modules/zigbee2mqtt/.terraform.lock.hcl new file mode 100644 index 0000000..e61b376 --- /dev/null +++ b/terraform/modules/zigbee2mqtt/.terraform.lock.hcl @@ -0,0 +1,87 @@ +# This file is maintained automatically by "terraform init". +# Manual edits may be lost in future updates. + +provider "registry.terraform.io/cyrilgdn/postgresql" { + version = "1.18.0" + constraints = "1.18.0" + hashes = [ + "h1:Nf26liFILUZXPh1P2B8T3qtq2Tc7objtm0sBSt0lhh0=", + "zh:251b609167ce25e974607c0c7dd3f90cfc45980c9068364f896e26c31416d96c", + "zh:317980d14a6a171f118bb522ffd02046e508d98100073f97671aeb2adae30d79", + "zh:3622c6414e91f8ccceed94ddf12062a22c14de4fac73c6142b009ae791ca7cd4", + "zh:36be2b338c230b0ab0c7b4c55049dba9bd8d705973c2cceaf3e293d41f520db5", + "zh:4332e83b91f60c43679ff9660c8ef4ebe251e05926a4d20dc64db1bfbabc8670", + "zh:444835840c917aff17f49f9f7b4ae542d5bd9f2ec306b581d1931b00380213bd", + "zh:5174bd85ea94ed4a6cef6c02bc27498f47ac21841fcab7487ab19d8513c97e54", + "zh:61c6eb6b2bf18cdc0734c101854e25990ba24a16580c6bbc599a0b00f72be397", + "zh:b40bbc61a4e522b22ebd57f01a518370a97cd6945e4bdd2955e5f887c88ee3f6", + "zh:d7aeb158c884f6590d6033cd44d5e9438f648bcb5ca3bd54573847c287845b00", + "zh:da3bee1282f6b48572d15f7a693113931afb306b98e29c09c9a054bdc3d6df44", + "zh:ec864a068eeab48899d99405f5606379478df8e48c005844d63a5360c23d5e15", + "zh:fda709d1cabde236b79c98c9abb80f2c1591fdea751afadc546073056be6e6ba", + "zh:ff08607ab25d1c5b55c3794b67a4ee2c9ac5023962c196ce587df34f0e201ca6", + ] +} + +provider "registry.terraform.io/kreuzwerker/docker" { + version = "3.0.2" + constraints = "3.0.2" + hashes = [ + "h1:cT2ccWOtlfKYBUE60/v2/4Q6Stk1KYTNnhxSck+VPlU=", + "zh:15b0a2b2b563d8d40f62f83057d91acb02cd0096f207488d8b4298a59203d64f", + "zh:23d919de139f7cd5ebfd2ff1b94e6d9913f0977fcfc2ca02e1573be53e269f95", + "zh:38081b3fe317c7e9555b2aaad325ad3fa516a886d2dfa8605ae6a809c1072138", + "zh:4a9c5065b178082f79ad8160243369c185214d874ff5048556d48d3edd03c4da", + "zh:5438ef6afe057945f28bce43d76c4401254073de01a774760169ac1058830ac2", + "zh:60b7fadc287166e5c9873dfe53a7976d98244979e0ab66428ea0dea1ebf33e06", + "zh:61c5ec1cb94e4c4a4fb1e4a24576d5f39a955f09afb17dab982de62b70a9bdd1", + "zh:a38fe9016ace5f911ab00c88e64b156ebbbbfb72a51a44da3c13d442cd214710", + "zh:c2c4d2b1fd9ebb291c57f524b3bf9d0994ff3e815c0cd9c9bcb87166dc687005", + "zh:d567bb8ce483ab2cf0602e07eae57027a1a53994aba470fa76095912a505533d", + "zh:e83bf05ab6a19dd8c43547ce9a8a511f8c331a124d11ac64687c764ab9d5a792", + "zh:e90c934b5cd65516fbcc454c89a150bfa726e7cf1fe749790c7480bbeb19d387", + "zh:f05f167d2eaf913045d8e7b88c13757e3cf595dd5cd333057fdafc7c4b7fed62", + "zh:fcc9c1cea5ce85e8bcb593862e699a881bd36dffd29e2e367f82d15368659c3d", + ] +} + +provider "registry.terraform.io/linode/linode" { + version = "1.30.0" + constraints = "1.30.0" + hashes = [ + "h1:rd4yQ7u3awn2kTqdKf5D67TTeo6rybYpDry/WwvolRA=", + "zh:197c61c5eb2252f65c18d2aa65cdc0511617b13e2388118f3fe063d7969dd7ad", + "zh:1a66470682acb13dc57308d5b1eaa19ff60c2404a3b15714e3072d02d569b1a5", + "zh:368cdcf17073a39687da830c02cf3ce50e0d8f03b7ec808b49561628be798abc", + "zh:42f2510a70afbb7fc8928df119d1e14ce1b61d2aded13b88072858ee5861feb2", + "zh:57734dd1e8255abd52a33ff79c20ef4efc3831850b22dd1a628e6301c3cf95c6", + "zh:61d614a7a4607bfc4ab6bfd0501007501957b973dbd028e0e513a3d4df07f12e", + "zh:79243f22fc0a9adfc1123abdd17c515f0ce4d8147302889033b6c44f6a48337e", + "zh:9f7cd46185bbe2c001dab1d0bd6c17a9740e7279d3fffe93755f2c964e267213", + "zh:9fdc9f8f47bde4140bc14cf082bbc2ceb63a3bebf0683df2fefd83c9e248274c", + "zh:aa1fd80a7ea245f8b852e40c68ccde2d8b6446e2138ebdec7425c67e82099881", + "zh:bb31f1ba5b0e001cf343d3a4cfafa70e6f3e30fd8a200d2cd7e077663efe0456", + "zh:da87881fa030287df2009028c49581e1fd0ff89baef0d8543b27ca506eff2971", + "zh:ed6afd7b1bc7237a9dff5c721ca3a5c7c505803cd5ea0b4ad0dfdf07ed6f9b0d", + "zh:ee653d5d08cb331ce2d8dc1010e68d363470ae87be62c0515e5d2418727cd02b", + ] +} + +provider "registry.terraform.io/lokkersp/sops" { + version = "0.6.10" + constraints = "0.6.10" + hashes = [ + "h1:atU8NIBxpNTWY+qBubvEOfjOn4K1aCDoq1iUFocgIHQ=", + "zh:0f053a26392a581b1f1ce6316cb7ed8ec4cc75e7f5f1cf7cfd45050b6b3c87ea", + "zh:207bb96c4471fce9aeb1b3c217d772692c3d865d294cf4d2501dad41de36a15e", + "zh:28506e8f1f3b9eaa95d99043440328044ee6340143535e5751538328a529d001", + "zh:3cae3bcea9e35fdc5b3f2af1b4580cd625c996448ad0c676c772260e46b25289", + "zh:3e44daaf82986c2b0028aeb17b867f3c68ed5dd8ac8625ba0406cf2a5fd3d92e", + "zh:457fb8ca2e677af24f9a4bdd8b613b1d7b604ad7133541657e5757c19268da71", + "zh:473d727c228f021a3df8cc8dcc6231ad7f90ed63f9e47c36b597d591e76228da", + "zh:48c4c1df39fd76ec8bd5fe9ac70cdc0927ac8be95582dbe46458b3442ce0fcd9", + "zh:728b19cb5c07e5e9d8b78fd94cc57d4c13582ecd24b7eb7c4cc2bf73b12fe4d1", + "zh:c51ed9af591779bb0910b82addeebb10f53428b994f8db653dd1dedcec60916c", + "zh:f569b65999264a9416862bca5cd2a6177d94ccb0424f3a4ef424428912b9cb3c", + ] +} diff --git a/terraform/modules/zigbee2mqtt/main.tf b/terraform/modules/zigbee2mqtt/main.tf new file mode 100644 index 0000000..a238e2d --- /dev/null +++ b/terraform/modules/zigbee2mqtt/main.tf @@ -0,0 +1,8 @@ +terraform { + required_providers { + docker = { + source = "kreuzwerker/docker" + version = "3.0.2" + } + } +} diff --git a/terraform/modules/zigbee2mqtt/vars.tf b/terraform/modules/zigbee2mqtt/vars.tf new file mode 100644 index 0000000..2dcf69c --- /dev/null +++ b/terraform/modules/zigbee2mqtt/vars.tf @@ -0,0 +1,17 @@ +variable "docker_image" { + type = string + default = "koenkk/zigbee2mqtt" +} + +variable "docker_version" { + type = string + default = "1.42.0" +} + +variable "public_ip" { + type = string +} + +variable "serial_port" { + type = string +} diff --git a/terraform/modules/zigbee2mqtt/zigbee2mqtt.tf b/terraform/modules/zigbee2mqtt/zigbee2mqtt.tf new file mode 100644 index 0000000..8723a38 --- /dev/null +++ b/terraform/modules/zigbee2mqtt/zigbee2mqtt.tf @@ -0,0 +1,45 @@ +data "docker_registry_image" "zigbee2mqtt" { + name = "${var.docker_image}:${var.docker_version}" +} + +resource "docker_image" "zigbee2mqtt" { + name = data.docker_registry_image.zigbee2mqtt.name + pull_triggers = [data.docker_registry_image.zigbee2mqtt.sha256_digest] +} + +resource "docker_volume" "zigbee2mqtt" { + name = "zigbee2mqtt" +} + +resource "docker_container" "zigbee2mqtt" { + image = docker_image.zigbee2mqtt.image_id + name = "zigbee2mqtt" + hostname = "zigbee2mqtt" + # privileged = true + restart = "unless-stopped" + + network_mode = "host" + + ports { + internal = 8080 + external = 8080 + protocol = "tcp" + ip = var.public_ip + } + + volumes { + volume_name = docker_volume.zigbee2mqtt.name + read_only = false + container_path = "/app/data" + } + + env = [ + "TZ=Europe/Oslo", + ] + + devices { + host_path = var.serial_port + container_path = "/dev/ttyACM0" + permissions = "rwm" + } +} diff --git a/terraform/telegraf/conflatorio/vault.yml b/terraform/telegraf/conflatorio/vault.yml index 90061a8..e380599 100644 --- a/terraform/telegraf/conflatorio/vault.yml +++ b/terraform/telegraf/conflatorio/vault.yml @@ -1,5 +1,4 @@ influx_token: ENC[AES256_GCM,data:48AbbP7v1QRvK7h73J6RYb1BBXsKdF+8YREXqtvPlEk3DFHoncmPIVWCH0G8it21BJtBsAupnJCPoa9IR7nJMWZMy/2NotmjeJuBD7LYY05BFEs4K5y+yw==,iv:RbWI8JWTg1LHqNUAEsx42rFp7IIntkz7PR6l/kCl7z8=,tag:lCpcfh7xQR+29RhWEkG1lA==,type:str] -config_url: ENC[AES256_GCM,data:tlhn8wfyD7EETkWGeeLEVOVQ3OS+PXnfWL6zXbuKYxz2I4EftRTAG9QAGCw2nb2VpTkBG4AE3kkLKLTiNWFBQsQ=,iv:V1pSBlTeE3zFBI29DtrzgAySHxhTS5jp8kuc7HtCKiI=,tag:Yo8vqUr9gohQYvuwqFkdFw==,type:str] sops: kms: [] gcp_kms: [] @@ -15,8 +14,8 @@ sops: Snd2V1FCL0hXUHA0R0FyUHBEUmNoeTAKK3uEAXKZetmJmn9vwleVzpfvIqyDMbuv FEYrJ4oBr+NykSfWqZSLB+y4DPTNyE2jhZ1vOK1u/CcxisaVa3o7+A== -----END AGE ENCRYPTED FILE----- - lastmodified: "2023-10-26T17:50:27Z" - mac: ENC[AES256_GCM,data:eFMCwmDaAvVaF1a45UQo/Z0lahAPVw5Mi7MH0m/UcVmvczad31gbPNuSZDAHyF+CWz4RmVCuqR0ukRBBXF5y18mVaTWC0zXhBaMsYIV3LR4CrdJ3wgmD5uY91X4un1aPJ/iR6T7w0wPfEaSnTR00n+f7tVhmyVfl6+9IwuUlcUo=,iv:Kme2RcQXWpYKPXfbzmK0JxbNyJqK1PEvLO6K4smWMLM=,tag:11nLZIVh7AYqhcO+1E6HmA==,type:str] + lastmodified: "2023-10-31T14:31:13Z" + mac: ENC[AES256_GCM,data:0KMb/2PdJybWd47RFIDn5bLaQzjKLATPDSgjmT7O79ErKvRu5gqt/or04kPcla1ToofNza1b1tH2nvJONTrIx8I/GCvy1nNa1sFfFa8cbb12em1SWwVIrqG8O2zEiQ9Wh2FW4x2wFRTinOEzwhAnum5OPD2K58fPWm6jFsG9fxY=,iv:SeCYnl/dngeAGOtTL3/qblrMXvRPPTfnhjoVSmbNGZA=,tag:t8grQyCkM0SWWFYWUomIJg==,type:str] pgp: [] unencrypted_suffix: _unencrypted version: 3.7.3 diff --git a/terraform/terragrunt.hcl b/terraform/terragrunt.hcl index 382cf17..8af2aca 100644 --- a/terraform/terragrunt.hcl +++ b/terraform/terragrunt.hcl @@ -3,14 +3,18 @@ generate "backend" { if_exists = "overwrite_terragrunt" contents = <<EOF terraform { + required_version = "~> 1.9.5" + backend "s3" { bucket = "terraform-a6726272-73ff-11ed-8bdd-c79eb8376e05" key = "${path_relative_to_include()}/terraform.tfstate" skip_region_validation = true skip_credentials_validation = true skip_metadata_api_check = true + skip_requesting_account_id = true + skip_s3_checksum = true region = "eu-central-1" - endpoint = "eu-central-1.linodeobjects.com" + endpoints = { s3 : "https://eu-central-1.linodeobjects.com" } } } EOF diff --git a/terraform/unifi-controller/.terraform.lock.hcl b/terraform/unifi-controller/.terraform.lock.hcl index 9fa446f..e61b376 100644 --- a/terraform/unifi-controller/.terraform.lock.hcl +++ b/terraform/unifi-controller/.terraform.lock.hcl @@ -24,24 +24,24 @@ provider "registry.terraform.io/cyrilgdn/postgresql" { } provider "registry.terraform.io/kreuzwerker/docker" { - version = "3.0.1" - constraints = "3.0.1" + version = "3.0.2" + constraints = "3.0.2" hashes = [ - "h1:X2wZHQoG54NmtojeFcX0PSJPelaIejQRqyyI2h+LjWg=", - "zh:02f60126ca16b344092df3c315296bf1a216c3b2a68eddb3c89fdfa5ea826118", - "zh:0d2ee9624a54dbc10538b0c4e296348641b9bfba1354b3f872e43f7ec69a75f2", - "zh:473d7427da8c9efc231266abc7fdc27fca5f9ee0bdfcdb9914f0a2886e3e23b8", - "zh:5f0189bcd0c944c001098cb17a23efa79df8f0eec8644a64fe0e4200983ba5b7", - "zh:6200319c41d6baad3f46701a4028412f8ae2496e29fc4fef9584cc71da5fbbe6", - "zh:650be621f2216b1240f148eae8fcf80ec57c35925e2b212db7c23a70b9e67e06", - "zh:72fcfa6207251105066a34f0ec6d27ecc658b565e84fa946da376dd1afadd265", - "zh:92fc352a2090d3d380c7c8e8bbdf6f99d93a0182701056bb1d2dbfd5049e8ca6", - "zh:a7e2ef666c2a7eb5661b06cfbd7635cb9543524e7bf6a3851dcf6eacc9950cc4", - "zh:a8604595e61e8919c51a8656800c8c64557f9a2bc00309315895b380f2e9be19", - "zh:caf65603a84b749d8f3af2ee47b66f7e21d481f981e2e1d1d59838751c5e3be4", - "zh:dad40c4e57da284e7f57b5c0cc9dfac3cb27b01d2f2436fbe3464f0a2111b262", - "zh:dc1b173dbcba9d74879b16f36f6d9e97ef62fbd6fca8db79ec4fe4ec69c0e2f3", - "zh:e506d04677383b6d62bd69d42dc9005e27a45ccc2efc6e0de607e1f8445981d2", + "h1:cT2ccWOtlfKYBUE60/v2/4Q6Stk1KYTNnhxSck+VPlU=", + "zh:15b0a2b2b563d8d40f62f83057d91acb02cd0096f207488d8b4298a59203d64f", + "zh:23d919de139f7cd5ebfd2ff1b94e6d9913f0977fcfc2ca02e1573be53e269f95", + "zh:38081b3fe317c7e9555b2aaad325ad3fa516a886d2dfa8605ae6a809c1072138", + "zh:4a9c5065b178082f79ad8160243369c185214d874ff5048556d48d3edd03c4da", + "zh:5438ef6afe057945f28bce43d76c4401254073de01a774760169ac1058830ac2", + "zh:60b7fadc287166e5c9873dfe53a7976d98244979e0ab66428ea0dea1ebf33e06", + "zh:61c5ec1cb94e4c4a4fb1e4a24576d5f39a955f09afb17dab982de62b70a9bdd1", + "zh:a38fe9016ace5f911ab00c88e64b156ebbbbfb72a51a44da3c13d442cd214710", + "zh:c2c4d2b1fd9ebb291c57f524b3bf9d0994ff3e815c0cd9c9bcb87166dc687005", + "zh:d567bb8ce483ab2cf0602e07eae57027a1a53994aba470fa76095912a505533d", + "zh:e83bf05ab6a19dd8c43547ce9a8a511f8c331a124d11ac64687c764ab9d5a792", + "zh:e90c934b5cd65516fbcc454c89a150bfa726e7cf1fe749790c7480bbeb19d387", + "zh:f05f167d2eaf913045d8e7b88c13757e3cf595dd5cd333057fdafc7c4b7fed62", + "zh:fcc9c1cea5ce85e8bcb593862e699a881bd36dffd29e2e367f82d15368659c3d", ] } diff --git a/terraform/unifi-controller/backend.tf b/terraform/unifi-controller/backend.tf index 5f2d6d0..bebc5a5 100644 --- a/terraform/unifi-controller/backend.tf +++ b/terraform/unifi-controller/backend.tf @@ -1,12 +1,16 @@ # Generated by Terragrunt. Sig: nIlQXj57tbuaRZEa terraform { + required_version = "~> 1.9.5" + backend "s3" { bucket = "terraform-a6726272-73ff-11ed-8bdd-c79eb8376e05" key = "unifi-controller/terraform.tfstate" skip_region_validation = true skip_credentials_validation = true skip_metadata_api_check = true + skip_requesting_account_id = true + skip_s3_checksum = true region = "eu-central-1" - endpoint = "eu-central-1.linodeobjects.com" + endpoints = { s3 : "https://eu-central-1.linodeobjects.com" } } } diff --git a/terraform/unifi-controller/main.tf b/terraform/unifi-controller/main.tf index 55c133c..f93bc78 100644 --- a/terraform/unifi-controller/main.tf +++ b/terraform/unifi-controller/main.tf @@ -1,10 +1,8 @@ terraform { - required_version = "~> 1.3.5" - required_providers { docker = { source = "kreuzwerker/docker" - version = "3.0.1" + version = "3.0.2" } linode = { source = "linode/linode" @@ -22,15 +20,16 @@ terraform { } provider "docker" { - host = "ssh://conflatorio.vpn.trygvis.io" + host = "ssh://unifi.dn42.trygvis.io" } locals { domain_name = "unifi.vpn.trygvis.io" - public_ip = "fdb1:4242:3538:2001::ffff" + public_ip = module.ipam.hosts.unifi.address - docker_image_controller = "lscr.io/linuxserver/unifi-controller:8.0.24-mongoless" +# docker_image_controller = "lscr.io/linuxserver/unifi-controller:8.0.24-mongoless" + docker_image_controller = "lscr.io/linuxserver/unifi-network-application:8.5.6-ls68" docker_image_mongo = "mongo:7.0" mongo_database = "unifi" @@ -42,3 +41,7 @@ data "sops_file_entry" "mongo_password" { source_file = "sops.yml" data_key = "mongo_password" } + +module "ipam" { + source = "../ipam6" +} diff --git a/terraform/unifi-controller/mongo.tf b/terraform/unifi-controller/mongo.tf index 2b83691..f7c1950 100644 --- a/terraform/unifi-controller/mongo.tf +++ b/terraform/unifi-controller/mongo.tf @@ -1,6 +1,6 @@ -resource "docker_network" "unifi" { - name = "unifi" -} +# resource "docker_network" "unifi" { +# name = "unifi" +# } data "docker_registry_image" "mongo" { name = local.docker_image_mongo @@ -20,11 +20,11 @@ resource "docker_container" "unifi-mongo" { name = "unifi-mongo" hostname = "unifi-mongo" - networks_advanced { - name = docker_network.unifi.name - } +# networks_advanced { +# name = docker_network.unifi.name +# } - network_mode = "bridge" + network_mode = "host" volumes { volume_name = docker_volume.unifi-mongo.name diff --git a/terraform/unifi-controller/terragrunt.hcl b/terraform/unifi-controller/terragrunt.hcl index 5236c23..f378bf5 100644 --- a/terraform/unifi-controller/terragrunt.hcl +++ b/terraform/unifi-controller/terragrunt.hcl @@ -2,10 +2,6 @@ include "root" { path = find_in_parent_folders() } -dependency "docker" { - config_path = "../conflatorio-docker" -} - -# inputs = { -# vpc_id = dependency.docker.outputs.foo -# } +#dependency "ipam6" { +# config_path = "../ipam6" +#} diff --git a/terraform/unifi-controller/unifi.tf b/terraform/unifi-controller/unifi.tf index 4b0f1c6..4f1317f 100644 --- a/terraform/unifi-controller/unifi.tf +++ b/terraform/unifi-controller/unifi.tf @@ -1,34 +1,36 @@ -data "docker_network" "traefik" { - name = "traefik" -} +# data "docker_network" "traefik" { +# name = "traefik" +# } -data "docker_registry_image" "unifi-controller" { +data "docker_registry_image" "unifi-network-application" { name = local.docker_image_controller } -resource "docker_image" "unifi-controller" { - name = data.docker_registry_image.unifi-controller.name - pull_triggers = [data.docker_registry_image.unifi-controller.sha256_digest] +resource "docker_image" "unifi-network-application" { + name = data.docker_registry_image.unifi-network-application.name + pull_triggers = [data.docker_registry_image.unifi-network-application.sha256_digest] } -resource "docker_volume" "unifi-controller" { - name = "unifi-controller-new" +resource "docker_volume" "unifi-network-application" { + name = "unifi-network-application" } -resource "docker_container" "unifi-controller" { - image = docker_image.unifi-controller.image_id - name = "unifi-controller" - hostname = "unifi-controller" +resource "docker_container" "unifi-network-application" { + image = docker_image.unifi-network-application.image_id + name = "unifi-network-application" + hostname = "unifi-network-application" # privileged = true - # must_run = false + must_run = true - networks_advanced { - name = data.docker_network.traefik.name - } + network_mode = "host" - networks_advanced { - name = docker_network.unifi.name - } +# networks_advanced { +# name = data.docker_network.traefik.name +# } + +# networks_advanced { +# name = docker_network.unifi.name +# } dynamic "ports" { for_each = [ @@ -40,7 +42,8 @@ resource "docker_container" "unifi-controller" { { port = 8080, proto = "tcp" }, # Required for device communication # Public HTTP is handled by traefik - # { port = 8443, proto = "tcp" }, # Unifi web admin port + # Not anymore! + { port = 8443, proto = "tcp" }, # Unifi web admin port # Not used # { port = 8843, proto = "tcp" }, # Unifi guest portal HTTPS redirect port @@ -57,27 +60,27 @@ resource "docker_container" "unifi-controller" { } volumes { - volume_name = docker_volume.unifi-controller.name + volume_name = docker_volume.unifi-network-application.name read_only = false container_path = "/config" } - dynamic "labels" { - for_each = [ - { label = "traefik.enable", value = "true" }, - { label = "traefik.http.routers.unifi-controller.rule", value = "Host(`${local.domain_name}`)" }, - { label = "traefik.http.routers.unifi-controller.entrypoints", value = "websecure" }, - { label = "traefik.http.routers.unifi-controller.tls.certresolver", value = "linode" }, - { label = "traefik.http.services.unifi-controller.loadbalancer.server.port", value = "8443" }, - { label = "traefik.http.services.unifi-controller.loadbalancer.server.scheme", value = "https" }, - { label = "traefik.docker.network", value = "traefik" }, - # { label = "traefik.http.services.unifi-controller.loadbalancer.passHostHeader", value = "false" }, - ] - content { - label = labels.value["label"] - value = labels.value["value"] - } - } +# dynamic "labels" { +# for_each = [ +# { label = "traefik.enable", value = "true" }, +# { label = "traefik.http.routers.unifi-network-application.rule", value = "Host(`${local.domain_name}`)" }, +# { label = "traefik.http.routers.unifi-network-application.entrypoints", value = "websecure" }, +# { label = "traefik.http.routers.unifi-network-application.tls.certresolver", value = "linode" }, +# { label = "traefik.http.services.unifi-network-application.loadbalancer.server.port", value = "8443" }, +# { label = "traefik.http.services.unifi-network-application.loadbalancer.server.scheme", value = "https" }, +# { label = "traefik.docker.network", value = "traefik" }, +# # { label = "traefik.http.services.unifi-network-application.loadbalancer.passHostHeader", value = "false" }, +# ] +# content { +# label = labels.value["label"] +# value = labels.value["value"] +# } +# } env = [ "PUID=1000", @@ -86,7 +89,8 @@ resource "docker_container" "unifi-controller" { "MEM_LIMIT=default", "MONGO_USER=${local.mongo_username}", "MONGO_PASS=${local.mongo_password}", - "MONGO_HOST=${docker_container.unifi-mongo.hostname}", + #"MONGO_HOST=${docker_container.unifi-mongo.hostname}", + "MONGO_HOST=localhost", "MONGO_PORT=27017", "MONGO_DBNAME=${local.mongo_database}", ] diff --git a/tnet/bird-deploy.yml b/tnet/bird-deploy.yml index ed7cecf..9759c01 100644 --- a/tnet/bird-deploy.yml +++ b/tnet/bird-deploy.yml @@ -1,9 +1,9 @@ - hosts: tnet_bird tasks: - become: yes - copy: - dest: "/etc/bird/{{ item }}" + template: src: "{{ inventory_hostname }}/{{ item }}" + dest: "/etc/bird/{{ item }}" owner: bird group: bird mode: 0640 @@ -23,4 +23,3 @@ systemd: name: bird state: reloaded - diff --git a/tnet/bird-gen-password.yml b/tnet/bird-gen-password.yml new file mode 100644 index 0000000..501c5ef --- /dev/null +++ b/tnet/bird-gen-password.yml @@ -0,0 +1 @@ +- tasks: diff --git a/tnet/bird-gen.yml b/tnet/bird-gen.yml index 9fa71b1..74a83b1 100644 --- a/tnet/bird-gen.yml +++ b/tnet/bird-gen.yml @@ -1,25 +1,16 @@ -- name: Remove old configuration - hosts: localhost - connection: local - gather_facts: False - tasks: - - file: - path: files - state: absent - changed_when: False - - name: Generate Bird configuration hosts: tnet_bird connection: local gather_facts: False tasks: - - file: + - name: rmdir files/$hostname + file: path: files/{{ inventory_hostname }} - state: directory + state: absent changed_when: False - template: src: "{{ item }}.j2" - dest: "files/{{ inventory_hostname }}/{{ item }}" + dest: "templates/{{ inventory_hostname }}/{{ item }}" loop: - bird-tnet-pre.conf - bird-tnet.conf diff --git a/tnet/group_vars/all/bird.sops.yml b/tnet/group_vars/all/bird.sops.yml new file mode 100644 index 0000000..334634f --- /dev/null +++ b/tnet/group_vars/all/bird.sops.yml @@ -0,0 +1,46 @@ +bgp_password: + conflatorio-knot: ENC[AES256_GCM,data:PBE4TnHXDw==,iv:Kj6SnVvwsYUrKt0Vqd76j6IaxufLP0Rf+Bw3i1M/3tI=,tag:9jPWHiqqTHSG8BMQ/k4pEw==,type:str] + coregonus-knot: ENC[AES256_GCM,data:WgO2B0FQVQ==,iv:zhaCbX6M7fMMHr63KgIrOcpnI9dmPJLTOlXJVqYkFb0=,tag:Y2H+RjuPGBMUFJJFEeL5Yw==,type:str] + hash-knot: ENC[AES256_GCM,data:SI2yYLIepg==,iv:Icky8rMsLQj77zu5vdqCZBWoHiYlNbIwlAvD5m+DH7A=,tag:9PImx9SXYuusNhZeWVPV7g==,type:str] + knot-kv24ix: ENC[AES256_GCM,data:z7SG+zuQ7g==,iv:APPjOs+MH9c0xfxmGEMoAQq00i847jGdbpoSkgwbpY0=,tag:jkgb7PlAF/kb50+i+3WEGw==,type:str] + knot-lhn2pi: ENC[AES256_GCM,data:k/pQyjnQyA==,iv:oW9t8Pruu/k/qIG6uG8Ex61QHerYhU09Ns0AI8NKkJA=,tag:H0A4jr/hBcGTuKeNV2zB1Q==,type:str] + knot-node1: ENC[AES256_GCM,data:rY0x5yu9zw==,iv:TyyhW1IwtkcU2q2y6ACgEqNEqMJ64PyMQ/kkkyCJB8E=,tag:fepqIEhEbrNFUr9f1iOMAQ==,type:str] + knot-node2: ENC[AES256_GCM,data:EE/JkIj23g==,iv:Gv1kd+lOFPir3z0TTlRdeOMffCQreBA5HiCHHwOUu+M=,tag:hwmABQCkbvQ6kSVchUZ6+g==,type:str] +sops: + kms: [] + gcp_kms: [] + azure_kv: [] + hc_vault: [] + age: + - recipient: age13wv3rp0varlg4nvt3tca48fq8u9q3mc6yfdekjeapcmc7kaq4dysrzcmv3 + enc: | + -----BEGIN AGE ENCRYPTED FILE----- + YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSAxb2RRcHh2UVN0U0ljeFgr + VndTMkRRR0Fzd042R0F5RnZpelZRNmVIcG1jCklHMkFoVjBhb3NrMjB5c3dMcjYv + Zkw5c3hIeElQOW54WDJ6a1MySDc2bGMKLS0tIEt3TTdLVkx4UFRCOU5WcWxjbXky + b05uMC94dUtxWE1qWHRTbVlubWQ4N1UKcPsMrAWryuaHar6qF/JL40hMkhkGoVsv + fj1FGz2xoI1FOtnqU8/LCOZF7ncUjzJS0m2GxiA/WDRLeLSWAi84vg== + -----END AGE ENCRYPTED FILE----- + - recipient: age1mvh832crygenu5tu5njtraraet656rzwnawuasjggvs999dc9ueqj9qclw + enc: | + -----BEGIN AGE ENCRYPTED FILE----- + YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSB6MEJWVjF4cm04UU44bU9N + VEpmVnVDN1VIcm5RVk1VcThqNjFQQ3EzNkdjCnFGcVBMb0NiTzFSUm1qckkzRjNR + WEo1ai95L1B2bEpCYnB2blNyOFBwR0kKLS0tIFEyWlRZbUZWdnR0dzVCc0NraHpj + OUxUbWp4T1E2TTBTN0NRSDdKaXlJd2cKMwUjax16RyxnQRpxtZDjnrJx7CX06Z37 + T5GfLprSS4vXGfQkuJTDn7a/v8DfftOBL9ubclIet9cOD8YzIcAiZw== + -----END AGE ENCRYPTED FILE----- + - recipient: age1teasctdpkatekpsa47q58d3ugwyyqcuj5v9udtusk7ca9sfv694sw057a5 + enc: | + -----BEGIN AGE ENCRYPTED FILE----- + YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBmZEdhUlBEV1FBeGhSNVNG + YkQ1dmlieWlVMmMvUERNTnJlcVpmV3lBa0JjCnBJUWJmUmp2d01ZdFRlR3M1ZUI0 + NHhnMmxYNmlHeFFGbjJnK0w4QU5HenMKLS0tIHd6aUk1NWR2SnFCMENzSGFES0hi + VzVzNmtJampuZ2tKQnU3Y3FTZFFhdkUKej0Hy9kOYDqg+8B+slMdGE2Krcvqr4uJ + X7GxDCdLV7sllK6OlHe2aQkXb16oT0iGG7N61LCzWBDOfx0hzdyFPA== + -----END AGE ENCRYPTED FILE----- + lastmodified: "2024-10-19T18:22:33Z" + mac: ENC[AES256_GCM,data:Gm09oBu15JksqrK3H1TabhshiOShqwZLYFon6aqd8MmNQU0ufItZARU2K32Gu09dmDerE5Kbrq5u5U4fJXDkFRVYcFktIlD5FcCN2DlG7pB9rbpMZEHUt89wMAX6uvFat+66PUbE56Cio3Hlv88sB98VIKSratK2E0mlFB0oqYY=,iv:QaG4djyDGv+bpSz3+q6BTWAZyuUtNSkdG79/HciQlVE=,tag:TZ/qUmvWadnHYW/B00oEmQ==,type:str] + pgp: [] + unencrypted_suffix: _unencrypted + version: 3.9.1 diff --git a/tnet/files/akili/bird-tnet-pre.conf b/tnet/templates/akili/bird-tnet-pre.conf index 74c981d..74c981d 100644 --- a/tnet/files/akili/bird-tnet-pre.conf +++ b/tnet/templates/akili/bird-tnet-pre.conf diff --git a/tnet/files/akili/bird-tnet.conf b/tnet/templates/akili/bird-tnet.conf index 24c9b8e..d306fcc 100644 --- a/tnet/files/akili/bird-tnet.conf +++ b/tnet/templates/akili/bird-tnet.conf @@ -10,8 +10,6 @@ template bgp tnet_tpl { direct; - password "trygvis"; - ipv6 { next hop self; import filter { @@ -40,9 +38,11 @@ template bgp tnet_tpl { protocol bgp tnet_hash from tnet_tpl { neighbor fdb1:4242:3538:ffff:ca85:f812:3935:5fba; interface "tnet-hash"; + password "{{ bgp_password['akili-hash'] }}"; } protocol bgp tnet_knot from tnet_tpl { neighbor fdb1:4242:3538:ffff:59d7:cf77:8b5d:761a; interface "tnet-knot"; + password "{{ bgp_password['akili-knot'] }}"; } diff --git a/tnet/files/astyanax/bird-tnet-pre.conf b/tnet/templates/astyanax/bird-tnet-pre.conf index 74c981d..74c981d 100644 --- a/tnet/files/astyanax/bird-tnet-pre.conf +++ b/tnet/templates/astyanax/bird-tnet-pre.conf diff --git a/tnet/files/astyanax/bird-tnet.conf b/tnet/templates/astyanax/bird-tnet.conf index 3dbf4c9..496cebe 100644 --- a/tnet/files/astyanax/bird-tnet.conf +++ b/tnet/templates/astyanax/bird-tnet.conf @@ -10,8 +10,6 @@ template bgp tnet_tpl { direct; - password "trygvis"; - ipv6 { next hop self; import filter { @@ -40,9 +38,11 @@ template bgp tnet_tpl { protocol bgp tnet_hash from tnet_tpl { neighbor fe80:a0fd:89e4:42c6:f617:7398:abf4:b516; interface "tnet-hash"; + password "{{ bgp_password['astyanax-hash'] }}"; } protocol bgp tnet_knot from tnet_tpl { neighbor fe80:6728:53fc:fc81:40b3:9beb:8336:ba56; interface "tnet-knot"; + password "{{ bgp_password['astyanax-knot'] }}"; } diff --git a/tnet/templates/bird-tnet.conf.j2 b/tnet/templates/bird-tnet.conf.j2 index 2ba456b..1185014 100644 --- a/tnet/templates/bird-tnet.conf.j2 +++ b/tnet/templates/bird-tnet.conf.j2 @@ -10,8 +10,6 @@ template bgp tnet_tpl { direct; - password "trygvis"; - ipv6 { next hop self; import filter { @@ -48,6 +46,12 @@ protocol bgp tnet_{{ p }} from tnet_tpl { {% else %} interface "tnet-{{ p }}"; {% endif %} +{% if inventory_hostname < p %} +{% set password_var = inventory_hostname + "-" + p %} +{% else %} +{% set password_var = p + "-" + inventory_hostname %} +{% endif %} + password "{{ "{{ bgp_password['" + password_var + "'] }}" }}"; {% if peer.rr_client|default(False) %} rr client; diff --git a/tnet/files/conflatorio/bird-tnet-pre.conf b/tnet/templates/conflatorio/bird-tnet-pre.conf index d60e8df..d60e8df 100644 --- a/tnet/files/conflatorio/bird-tnet-pre.conf +++ b/tnet/templates/conflatorio/bird-tnet-pre.conf diff --git a/tnet/files/conflatorio/bird-tnet.conf b/tnet/templates/conflatorio/bird-tnet.conf index 02780a6..4ffcc7f 100644 --- a/tnet/files/conflatorio/bird-tnet.conf +++ b/tnet/templates/conflatorio/bird-tnet.conf @@ -10,8 +10,6 @@ template bgp tnet_tpl { direct; - password "trygvis"; - ipv6 { next hop self; import filter { @@ -40,9 +38,11 @@ template bgp tnet_tpl { protocol bgp tnet_hash from tnet_tpl { neighbor fe80:4540:476c:d432:2f32:818b:811b:bb61; interface "tnet-hash"; + password "{{ bgp_password['conflatorio-hash'] }}"; } protocol bgp tnet_knot from tnet_tpl { neighbor fe80:47fc:0660:b91f:1063:a6ae:46bb:7589; interface "tnet-knot"; + password "{{ bgp_password['conflatorio-knot'] }}"; } diff --git a/tnet/files/coregonus/bird-tnet-pre.conf b/tnet/templates/coregonus/bird-tnet-pre.conf index d60e8df..d60e8df 100644 --- a/tnet/files/coregonus/bird-tnet-pre.conf +++ b/tnet/templates/coregonus/bird-tnet-pre.conf diff --git a/tnet/files/coregonus/bird-tnet.conf b/tnet/templates/coregonus/bird-tnet.conf index 95ede41..2d2a573 100644 --- a/tnet/files/coregonus/bird-tnet.conf +++ b/tnet/templates/coregonus/bird-tnet.conf @@ -10,8 +10,6 @@ template bgp tnet_tpl { direct; - password "trygvis"; - ipv6 { next hop self; import filter { @@ -40,4 +38,5 @@ template bgp tnet_tpl { protocol bgp tnet_knot from tnet_tpl { neighbor fe80:ba82:77f0:f96d:7a85:a7fa:ef6f:37d2; interface "tnet-knot"; + password "{{ bgp_password['coregonus-knot'] }}"; } diff --git a/tnet/files/hash/bird-tnet-pre.conf b/tnet/templates/hash/bird-tnet-pre.conf index 74c981d..74c981d 100644 --- a/tnet/files/hash/bird-tnet-pre.conf +++ b/tnet/templates/hash/bird-tnet-pre.conf diff --git a/tnet/files/hash/bird-tnet.conf b/tnet/templates/hash/bird-tnet.conf index a570291..d9c52b0 100644 --- a/tnet/files/hash/bird-tnet.conf +++ b/tnet/templates/hash/bird-tnet.conf @@ -10,8 +10,6 @@ template bgp tnet_tpl { direct; - password "trygvis"; - ipv6 { next hop self; import filter { @@ -40,6 +38,7 @@ template bgp tnet_tpl { protocol bgp tnet_conflatorio from tnet_tpl { neighbor fe80:4540:476c:d432:2f32:818b:811b:bb60; interface "tnet-confltrio"; + password "{{ bgp_password['conflatorio-hash'] }}"; rr client; } @@ -47,6 +46,7 @@ protocol bgp tnet_conflatorio from tnet_tpl { protocol bgp tnet_knot from tnet_tpl { neighbor fe80:3b20:4cb0:5315:22a:c7de:a45b:8a7c; interface "tnet-knot"; + password "{{ bgp_password['hash-knot'] }}"; rr client; } @@ -54,6 +54,7 @@ protocol bgp tnet_knot from tnet_tpl { protocol bgp tnet_lhn2pi from tnet_tpl { neighbor fe80:6195:1d43:9655:35f7:9dba:798c:26b9; interface "tnet-lhn2pi"; + password "{{ bgp_password['hash-lhn2pi'] }}"; rr client; } @@ -61,6 +62,7 @@ protocol bgp tnet_lhn2pi from tnet_tpl { protocol bgp tnet_node1 from tnet_tpl { neighbor fe80:a026:6ec2:b356:21c5:b51:22b9:a1df; interface "tnet-node1"; + password "{{ bgp_password['hash-node1'] }}"; rr client; } @@ -68,6 +70,7 @@ protocol bgp tnet_node1 from tnet_tpl { protocol bgp tnet_node2 from tnet_tpl { neighbor fe80:a7a6:c1a8:c261:232e:7d67:fc27:7c8d; interface "tnet-node2"; + password "{{ bgp_password['hash-node2'] }}"; rr client; } diff --git a/tnet/files/knot/bird-tnet-pre.conf b/tnet/templates/knot/bird-tnet-pre.conf index d60e8df..d60e8df 100644 --- a/tnet/files/knot/bird-tnet-pre.conf +++ b/tnet/templates/knot/bird-tnet-pre.conf diff --git a/tnet/files/knot/bird-tnet.conf b/tnet/templates/knot/bird-tnet.conf index f21be09..699c0f2 100644 --- a/tnet/files/knot/bird-tnet.conf +++ b/tnet/templates/knot/bird-tnet.conf @@ -10,8 +10,6 @@ template bgp tnet_tpl { direct; - password "trygvis"; - ipv6 { next hop self; import filter { @@ -40,6 +38,7 @@ template bgp tnet_tpl { protocol bgp tnet_conflatorio from tnet_tpl { neighbor fe80:47fc:660:b91f:1063:a6ae:46bb:7588; interface "tnet-confltrio"; + password "{{ bgp_password['conflatorio-knot'] }}"; rr client; } @@ -47,6 +46,7 @@ protocol bgp tnet_conflatorio from tnet_tpl { protocol bgp tnet_coregonus from tnet_tpl { neighbor fe80:ba82:77f0:f96d:7a85:a7fa:ef6f:37d3; interface "tnet-coregonus"; + password "{{ bgp_password['coregonus-knot'] }}"; rr client; } @@ -54,6 +54,7 @@ protocol bgp tnet_coregonus from tnet_tpl { protocol bgp tnet_hash from tnet_tpl { neighbor fe80:3b20:4cb0:5315:22a:c7de:a45b:8a7d; interface "tnet-hash"; + password "{{ bgp_password['hash-knot'] }}"; rr client; } @@ -61,6 +62,7 @@ protocol bgp tnet_hash from tnet_tpl { protocol bgp tnet_kv24ix from tnet_tpl { neighbor fe80:fef1:078a:5b64:efd3:ae7b:d286:d7cf; interface "tnet-kv24ix"; + password "{{ bgp_password['knot-kv24ix'] }}"; rr client; } @@ -68,6 +70,7 @@ protocol bgp tnet_kv24ix from tnet_tpl { protocol bgp tnet_lhn2pi from tnet_tpl { neighbor fe80:d83a:350b:2162:6eda:1cc1:9cd7:80e9; interface "tnet-lhn2pi"; + password "{{ bgp_password['knot-lhn2pi'] }}"; rr client; } @@ -75,6 +78,7 @@ protocol bgp tnet_lhn2pi from tnet_tpl { protocol bgp tnet_node1 from tnet_tpl { neighbor fe80:58eb:3930:1815:2a6d:8918:70c9:96f3; interface "tnet-node1"; + password "{{ bgp_password['knot-node1'] }}"; rr client; } @@ -82,6 +86,7 @@ protocol bgp tnet_node1 from tnet_tpl { protocol bgp tnet_node2 from tnet_tpl { neighbor fe80:9dd8:abac:cf05:aea3:dc03:4c74:32db; interface "tnet-node2"; + password "{{ bgp_password['knot-node2'] }}"; rr client; } diff --git a/tnet/files/lhn2pi/bird-tnet-pre.conf b/tnet/templates/lhn2pi/bird-tnet-pre.conf index 74c981d..74c981d 100644 --- a/tnet/files/lhn2pi/bird-tnet-pre.conf +++ b/tnet/templates/lhn2pi/bird-tnet-pre.conf diff --git a/tnet/files/lhn2pi/bird-tnet.conf b/tnet/templates/lhn2pi/bird-tnet.conf index 9f0ef8c..f755c3b 100644 --- a/tnet/files/lhn2pi/bird-tnet.conf +++ b/tnet/templates/lhn2pi/bird-tnet.conf @@ -10,8 +10,6 @@ template bgp tnet_tpl { direct; - password "trygvis"; - ipv6 { next hop self; import filter { @@ -40,9 +38,11 @@ template bgp tnet_tpl { protocol bgp tnet_hash from tnet_tpl { neighbor fe80:6195:1d43:9655:35f7:9dba:798c:26b8; interface "tnet-hash"; + password "{{ bgp_password['hash-lhn2pi'] }}"; } protocol bgp tnet_knot from tnet_tpl { neighbor fe80:d83a:350b:2162:6eda:1cc1:9cd7:80e8; interface "tnet-knot"; + password "{{ bgp_password['knot-lhn2pi'] }}"; } diff --git a/tnet/files/node1/bird-tnet-pre.conf b/tnet/templates/node1/bird-tnet-pre.conf index 74c981d..74c981d 100644 --- a/tnet/files/node1/bird-tnet-pre.conf +++ b/tnet/templates/node1/bird-tnet-pre.conf diff --git a/tnet/files/node1/bird-tnet.conf b/tnet/templates/node1/bird-tnet.conf index 6449582..bafb6de 100644 --- a/tnet/files/node1/bird-tnet.conf +++ b/tnet/templates/node1/bird-tnet.conf @@ -10,8 +10,6 @@ template bgp tnet_tpl { direct; - password "trygvis"; - ipv6 { next hop self; import filter { @@ -40,9 +38,11 @@ template bgp tnet_tpl { protocol bgp tnet_hash from tnet_tpl { neighbor fe80:a026:6ec2:b356:21c5:b51:22b9:a1de; interface "tnet-hash"; + password "{{ bgp_password['hash-node1'] }}"; } protocol bgp tnet_knot from tnet_tpl { neighbor fe80:58eb:3930:1815:2a6d:8918:70c9:96f2; interface "tnet-knot"; + password "{{ bgp_password['knot-node1'] }}"; } diff --git a/tnet/files/node2/bird-tnet-pre.conf b/tnet/templates/node2/bird-tnet-pre.conf index 74c981d..74c981d 100644 --- a/tnet/files/node2/bird-tnet-pre.conf +++ b/tnet/templates/node2/bird-tnet-pre.conf diff --git a/tnet/files/node2/bird-tnet.conf b/tnet/templates/node2/bird-tnet.conf index b9a2294..8a7b887 100644 --- a/tnet/files/node2/bird-tnet.conf +++ b/tnet/templates/node2/bird-tnet.conf @@ -10,8 +10,6 @@ template bgp tnet_tpl { direct; - password "trygvis"; - ipv6 { next hop self; import filter { @@ -40,9 +38,11 @@ template bgp tnet_tpl { protocol bgp tnet_hash from tnet_tpl { neighbor fe80:a7a6:c1a8:c261:232e:7d67:fc27:7c8c; interface "tnet-hash"; + password "{{ bgp_password['hash-node2'] }}"; } protocol bgp tnet_knot from tnet_tpl { neighbor fe80:9dd8:abac:cf05:aea3:dc03:4c74:32da; interface "tnet-knot"; + password "{{ bgp_password['knot-node2'] }}"; } diff --git a/utils/.gitignore b/utils/.gitignore new file mode 100644 index 0000000..9487075 --- /dev/null +++ b/utils/.gitignore @@ -0,0 +1 @@ +utils diff --git a/utils/Makefile b/utils/Makefile new file mode 100644 index 0000000..409ef2d --- /dev/null +++ b/utils/Makefile @@ -0,0 +1,18 @@ +IPAM=../ansible/group_vars/all/ipam.yml + +all: utils + +networks: ../ansible/group_vars/all/networks.tmp.png +routers: ../ansible/group_vars/all/routers.tmp.png + +%.png:%.dot + dot -Tpng $< > $@ + +../ansible/group_vars/all/networks.tmp.dot: $(IPAM) + go run main.go networks $< > $@ + +../ansible/group_vars/all/routers.tmp.dot: $(IPAM) + go run main.go routers $< > $@ + +utils: + go build diff --git a/utils/go.mod b/utils/go.mod new file mode 100644 index 0000000..0090185 --- /dev/null +++ b/utils/go.mod @@ -0,0 +1,5 @@ +module utils + +go 1.23 + +require gopkg.in/yaml.v3 v3.0.1 diff --git a/utils/go.sum b/utils/go.sum new file mode 100644 index 0000000..a62c313 --- /dev/null +++ b/utils/go.sum @@ -0,0 +1,4 @@ +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/utils/ipam/ipam.go b/utils/ipam/ipam.go new file mode 100644 index 0000000..d61fa3e --- /dev/null +++ b/utils/ipam/ipam.go @@ -0,0 +1,183 @@ +package ipam + +import ( + "cmp" + "fmt" + "log" + "net/netip" + "slices" + "utils/ipam/yaml_model" +) + +func LoadIpam(bs []byte) (*Ipam, error) { + parsed, err := yaml_model.Parse(bs) + if err != nil { + return nil, err + } + + ipam := Ipam{} + err = processNetworks(parsed.Ipam6.Networks, &ipam) + if err != nil { + return nil, err + } + + err = processRouters(parsed.Routers, &ipam) + if err != nil { + return nil, err + } + + ipam.ResolveParents() + + return &ipam, nil +} + +type Ipam struct { + Networks []*Network + Routers []*Router +} + +func contains(a, b netip.Prefix) bool { + return b.Bits() > a.Bits() && b.Overlaps(a) +} + +func (ipam *Ipam) ResolveParents() { + for _, n := range ipam.Networks { + log.Printf("network %s/%s", n.Name, n.Prefix) + for _, p := range ipam.Networks { + if n == p { + continue + } + log.Printf(" candidate %s/%s", p.Name, p.Prefix) + if contains(p.Prefix, n.Prefix) { + if n.Parent == nil { + log.Printf(" found parent %s/%s", p.Name, p.Prefix) + n.Parent = p + } else { + if n.Parent.Prefix.Bits() < p.Prefix.Bits() { + log.Printf(" found better parent %s/%s", p.Name, p.Prefix) + n.Parent = p + } + } + } + } + } + + return +} + +func (ipam *Ipam) FindRoots() []*Network { + var ns []*Network + + for _, n := range ipam.Networks { + if n.Parent == nil { + ns = append(ns, n) + } + } + + return ns +} + +type Network struct { + Name string + Parent *Network + Prefix netip.Prefix + hosts []networkHost +} + +func CompareNetwork(a, b *Network) int { + return cmp.Compare(a.Name, b.Name) +} + +func (n *Network) Compare(other *Network) int { + return cmp.Compare(n.Name, other.Name) +} + +type networkHost struct { + name string + address netip.Addr +} + +func processNetworks(networks map[string]yaml_model.Network6Yaml, ipam *Ipam) error { + var ns []*Network + + for name, net := range networks { + log.Printf("Processing net %v\n", name) + prefix, err := netip.ParsePrefix(net.Range) + if err != nil { + return fmt.Errorf("error parsing net range: %v", err) + } + log.Printf("prefix: %s", prefix.String()) + + n := Network{Name: name, Prefix: prefix} + for hostname, a := range net.Hosts { + addr, err := netip.ParseAddr(a) + if err != nil { + return fmt.Errorf("network: %s, unable to parse host address %s", n.Name, a) + } + + n.hosts = append(n.hosts, networkHost{ + name: hostname, + address: addr, + }) + } + + ns = append(ns, &n) + } + + ipam.Networks = ns + return nil +} + +type Router struct { + Name string + As string + Peers []Peer +} + +func (r *Router) Compare(other *Router) int { + return cmp.Compare(r.Name, other.Name) +} + +type Peer struct { + Name string + /// Router is set if this is a known peer + Router *Router + + As string +} + +func processRouters(routers map[string]yaml_model.Router, ipam *Ipam) error { + var rs []*Router + rsIndex := make(map[string]*Router) + for name, router := range routers { + r := &Router{ + Name: name, + As: router.As, + } + + rs = append(rs, r) + rsIndex[name] = r + } + + for _, r := range rs { + router := routers[r.Name] + + for name, peer := range router.Peers { + remote := rsIndex[name] + + r.Peers = append(r.Peers, Peer{ + Name: name, + Router: remote, + As: peer.As, + }) + } + } + + compare := func(a *Router, b *Router) int { + return a.Compare(b) + } + + ipam.Routers = slices.SortedStableFunc(slices.Values(rs), compare) + + return nil +} diff --git a/utils/ipam/yaml_model/yaml_model.go b/utils/ipam/yaml_model/yaml_model.go new file mode 100644 index 0000000..4109e12 --- /dev/null +++ b/utils/ipam/yaml_model/yaml_model.go @@ -0,0 +1,36 @@ +package yaml_model + +import "gopkg.in/yaml.v3" + +type Ipam struct { + Ipam6 Ipam6 `yaml:"ipam6,omitempty"` + Routers map[string]Router `yaml:"routers,omitempty"` +} + +type Ipam6 struct { + Networks map[string]Network6Yaml `yaml:"networks"` +} + +type Network6Yaml struct { + Range string `yaml:"range"` + Hosts map[string]string `yaml:"hosts"` +} + +type Router struct { + As string `yaml:"as,omitempty"` + Peers map[string]Peer `yaml:"peers,omitempty"` +} + +type Peer struct { + As string `yaml:"as"` +} + +func Parse(bs []byte) (Ipam, error) { + var ipam Ipam + err := yaml.Unmarshal(bs, &ipam) + if err != nil { + return Ipam{}, err + } + + return ipam, nil +} diff --git a/utils/main.go b/utils/main.go new file mode 100644 index 0000000..32f9682 --- /dev/null +++ b/utils/main.go @@ -0,0 +1,50 @@ +package main + +import ( + "fmt" + "os" + Ipam "utils/ipam" + "utils/networks" + "utils/routers" +) + +func main() { + if len(os.Args) != 3 { + _, _ = fmt.Fprintf(os.Stderr, "Usage: %s IPAM-FILE PICTURE\n", os.Args[0]) + os.Exit(1) + } + + ipam, err := loadIpam() + if err != nil { + return + } + + if os.Args[1] == "networks" { + err = networks.RunNetworks(ipam) + } else if os.Args[1] == "routers" { + err = routers.RunRouters(ipam) + } else { + _, _ = fmt.Fprintf(os.Stderr, "Unknown command: %s\n", os.Args[2]) + os.Exit(1) + } + + if err != nil { + _, _ = fmt.Fprintf(os.Stderr, "%v\n", err) + os.Exit(1) + } +} + +func loadIpam() (*Ipam.Ipam, error) { + ipamYaml := os.Args[2] + bs, err := os.ReadFile(ipamYaml) + if err != nil { + return nil, err + } + + ipam, err := Ipam.LoadIpam(bs) + if err != nil { + return nil, err + } + + return ipam, nil +} diff --git a/utils/networks/networks.go b/utils/networks/networks.go new file mode 100644 index 0000000..9ecf256 --- /dev/null +++ b/utils/networks/networks.go @@ -0,0 +1,55 @@ +package networks + +import ( + "fmt" + "slices" + Ipam "utils/ipam" +) + +func RunNetworks(ipam *Ipam.Ipam) error { + networks := slices.SortedFunc(slices.Values(ipam.Networks), Ipam.CompareNetwork) + roots := slices.SortedFunc(slices.Values(ipam.FindRoots()), Ipam.CompareNetwork) + + fmt.Printf("digraph {\n") + //fmt.Printf(" layout=dot\n") + //fmt.Printf(" layout=twopi\n") + fmt.Printf(" layout=fdp\n") + //fmt.Printf(" layout=circo\n") + //fmt.Printf(" layout=neato\n") + //fmt.Printf(" ranksep=3\n") + //fmt.Printf(" ratio=auto\n") + //fmt.Printf(" rankdir=LR\n") + //fmt.Printf(" rankdir=RL\n") + fmt.Printf(" rankdir=TB\n") + //fmt.Printf(" sep=3\n") + //fmt.Printf(" overlap_scaling=-10\n") + fmt.Printf("node [len=10];") + fmt.Printf("node [shape=box];") + fmt.Printf("overlap=false") + + fmt.Printf("\n") + fmt.Printf(" # Nodes\n") + for _, n := range networks { + fmt.Printf(" %s [ label = \"%s\\n%s\"];\n", n.Name, n.Name, n.Prefix) + } + + fmt.Printf("\n") + fmt.Printf(" # Roots\n") + for _, n := range roots { + fmt.Printf(" %s [ root = true ];\n", n.Name) + } + + fmt.Printf("\n") + fmt.Printf(" # Relationships\n") + for _, n := range networks { + for _, c := range ipam.Networks { + if c.Parent == n { + fmt.Printf(" %s -> %s", n.Name, c.Name) + fmt.Printf(";\n") + } + } + } + fmt.Printf("}\n") + + return nil +} diff --git a/utils/routers/routers.go b/utils/routers/routers.go new file mode 100644 index 0000000..24d25e3 --- /dev/null +++ b/utils/routers/routers.go @@ -0,0 +1,51 @@ +package routers + +import ( + "fmt" + Ipam "utils/ipam" +) + +func RunRouters(ipam *Ipam.Ipam) error { + routers := ipam.Routers + + fmt.Printf("digraph {\n") + //fmt.Printf(" layout=dot\n") + //fmt.Printf(" layout=twopi\n") + fmt.Printf(" layout=fdp\n") + //fmt.Printf(" layout=circo\n") + //fmt.Printf(" layout=neato\n") + //fmt.Printf(" ranksep=3\n") + //fmt.Printf(" ratio=auto\n") + //fmt.Printf(" rankdir=LR\n") + //fmt.Printf(" rankdir=RL\n") + fmt.Printf(" rankdir=TB\n") + //fmt.Printf(" sep=3\n") + //fmt.Printf(" overlap_scaling=-10\n") + fmt.Printf("node [len=10];") + fmt.Printf("node [shape=box];") + fmt.Printf("overlap=false") + + fmt.Printf("\n") + fmt.Printf(" # Nodes\n") + for _, r := range routers { + fmt.Printf(" %s [ label = \"%s\"];\n", r.Name, r.Name) + } + + fmt.Printf("\n") + fmt.Printf(" # Connections\n") + for _, n := range routers { + fmt.Printf(" %s [ root = true ];\n", n.Name) + } + + fmt.Printf("\n") + fmt.Printf(" # Peers\n") + for _, r := range routers { + for _, p := range r.Peers { + fmt.Printf(" %s -> %s", r.Name, p.Name) + fmt.Printf(";\n") + } + } + fmt.Printf("}\n") + + return nil +} |