feat: kedge_tunnel Ansible role

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Tyler King 2026-03-18 15:55:19 -04:00
parent eca07a45d5
commit 3db2f3b0c7
3 changed files with 44 additions and 0 deletions

View file

@ -0,0 +1,6 @@
---
kedge_tunnel_site_id: ""
kedge_tunnel_entity_id: ""
kedge_tunnel_vni: ""
kedge_tunnel_wireguard_interface: wg-substrate
kedge_tunnel_namespace: kedge-system

View file

@ -0,0 +1,23 @@
---
# Map WireGuard tunnel to Kedge governed overlay.
# Creates a KedgeTunnel CR that binds the WireGuard interface to a VNI.
- name: Ensure kubectl is available
ansible.builtin.command: kubectl version --client
changed_when: false
- name: Deploy KedgeTunnel manifest
ansible.builtin.template:
src: kedge-tunnel.yml.j2
dest: "/tmp/kedge-tunnel-{{ kedge_tunnel_site_id }}.yml"
mode: "0644"
- name: Apply KedgeTunnel CR
ansible.builtin.command: >
kubectl apply -f /tmp/kedge-tunnel-{{ kedge_tunnel_site_id }}.yml
changed_when: true
- name: Clean up temporary manifest
ansible.builtin.file:
path: "/tmp/kedge-tunnel-{{ kedge_tunnel_site_id }}.yml"
state: absent

View file

@ -0,0 +1,15 @@
apiVersion: kedge.guildhouse.dev/v1alpha1
kind: KedgeTunnel
metadata:
name: "tunnel-{{ kedge_tunnel_site_id }}"
namespace: "{{ kedge_tunnel_namespace }}"
labels:
guildhouse.dev/entity: "{{ kedge_tunnel_entity_id }}"
guildhouse.dev/site: "{{ kedge_tunnel_site_id }}"
spec:
wireguardInterface: "{{ kedge_tunnel_wireguard_interface }}"
vni: {{ kedge_tunnel_vni }}
mode: overlay
governance:
entityId: "{{ kedge_tunnel_entity_id }}"
siteId: "{{ kedge_tunnel_site_id }}"