2025-11-28 15:34:52 +01:00
|
|
|
---
|
2025-11-28 20:53:52 +01:00
|
|
|
name: tofu plan k8s-wheatley
|
2025-11-28 15:34:52 +01:00
|
|
|
on:
|
|
|
|
|
workflow_dispatch:
|
|
|
|
|
workflow_call:
|
|
|
|
|
pull_request:
|
|
|
|
|
branches:
|
|
|
|
|
- main
|
|
|
|
|
# paths:
|
|
|
|
|
# - pve01.wheatley.in/k8s-whealtey/**
|
|
|
|
|
|
|
|
|
|
jobs:
|
2025-11-28 20:53:52 +01:00
|
|
|
tofu-plan-k8s-wheatley:
|
2025-11-28 15:34:52 +01:00
|
|
|
runs-on: docker
|
|
|
|
|
steps:
|
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
|
- uses: opentofu/setup-opentofu@v1
|
|
|
|
|
|
2025-11-28 21:13:42 +01:00
|
|
|
- name: Setup apt repository
|
|
|
|
|
run: |
|
2025-11-28 21:14:20 +01:00
|
|
|
echo "deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware" | tee -a /etc/apt/sources.list
|
2025-11-28 21:13:42 +01:00
|
|
|
apt update
|
|
|
|
|
|
2025-11-28 20:53:52 +01:00
|
|
|
- name: Setup Wireguard
|
|
|
|
|
run: |
|
2025-11-28 21:06:20 +01:00
|
|
|
apt-cache policy
|
2025-11-28 20:53:52 +01:00
|
|
|
echo "Installing Wireguard..."
|
2025-11-28 21:06:20 +01:00
|
|
|
apt install resolvconf
|
2025-11-28 20:55:14 +01:00
|
|
|
apt install wireguard
|
2025-11-28 20:53:52 +01:00
|
|
|
echo "Installing Wireguard ✅"
|
|
|
|
|
echo "Configuring Wireguard..."
|
|
|
|
|
echo "${{ secrets.WG_CONFIG }}" > /tmp/wg0.conf
|
2025-11-28 20:55:14 +01:00
|
|
|
chmod 600 wg0.conf
|
2025-11-28 20:53:52 +01:00
|
|
|
echo "Configuring Wireguard ✅"
|
|
|
|
|
echo "Starting Wireguard..."
|
2025-11-28 20:55:14 +01:00
|
|
|
wg-quick up /tmp/wg0.conf
|
2025-11-28 20:53:52 +01:00
|
|
|
echo "Started Wireguard ✅"
|
|
|
|
|
|
2025-11-28 15:34:52 +01:00
|
|
|
- name: OpenTofu fmt
|
|
|
|
|
id: fmt
|
|
|
|
|
run: tofu fmt -check
|
|
|
|
|
continue-on-error: true
|
|
|
|
|
|
|
|
|
|
- name: OpenTofu Init
|
|
|
|
|
id: init
|
|
|
|
|
run: tofu init
|
|
|
|
|
|
|
|
|
|
- name: OpenTofu Validate
|
|
|
|
|
id: validate
|
|
|
|
|
run: tofu validate -no-color
|
|
|
|
|
|
|
|
|
|
- name: OpenTofu Plan
|
|
|
|
|
id: plan
|
|
|
|
|
run: tofu plan -no-color
|
|
|
|
|
continue-on-error: true
|