This commit is contained in:
Graham McIntire 2025-10-14 14:35:33 -05:00
parent 58e1c137d9
commit ef8b473681
No known key found for this signature in database
12 changed files with 107 additions and 109 deletions

6
.gitignore vendored
View file

@ -1,3 +1,7 @@
# Terraform directories
**/.terraform/
**/terraform/
**/terraform/
# Terraform state files
**/terraform.tfstate
**/terraform.tfstate.*

View file

@ -101,4 +101,9 @@ Roles follow a standard structure with:
- Templates use host-specific variables
- Handlers manage service restarts
- Fact caching improves performance
- Collections required: ansible.posix, netbox.netbox
- Collections required: ansible.posix, netbox.netbox
## Memories
### Playbook Defaults
- The default ansible playbook is `playbook.yml`

View file

@ -1,3 +1,4 @@
---
# Host-specific variables for g.w5isp.com
ansible_user: ansible
ansible_user: ansible
ansible_python_interpreter: /usr/bin/python3

View file

@ -8,16 +8,15 @@ netbox.vntx.net
ns1.vntx.net
ns2.vntx.net
#ntp.vntx.net
#akkoma ansible_host=204.110.191.213
[monitoring_servers]
monitor.vntx.net
[app_servers]
apps.w5isp.com
[home_servers]
skippy.w5isp.com
sync.w5isp.com ansible_host=204.110.191.216
g.w5isp.com
[k3s_servers]
node1 # ansible_host=10.0.101.211
@ -28,12 +27,9 @@ node3 # ansible_host=10.0.101.213
sync.w5isp.com
[caddy_servers]
caddy.w5isp.com
g.w5isp.com
[syncthing_servers]
sync.w5isp.com
[postgresql_servers]
[mailcow_servers]
sync.w5isp.com

View file

@ -3,4 +3,8 @@
service:
name: caddy
state: restarted
- name: update apt cache
apt:
update_cache: yes

View file

@ -1,5 +1,12 @@
---
# Debian/Ubuntu tasks
- name: Check if Caddy is already installed
command: which caddy
register: caddy_installed
changed_when: false
failed_when: false
when: ansible_os_family == "Debian"
- name: Install required packages (Debian/Ubuntu)
apt:
name:
@ -12,11 +19,44 @@
update_cache: yes
when: ansible_os_family == "Debian"
- name: Check for conflicting Caddy repositories
stat:
path: /usr/share/keyrings/caddy-stable-archive-keyring.gpg
register: old_keyring
when: ansible_os_family == "Debian"
- name: Remove old Caddy repository files if they exist
file:
path: "{{ item }}"
state: absent
loop:
- /etc/apt/sources.list.d/caddy-stable.list
- /etc/apt/sources.list.d/caddy.list
- /usr/share/keyrings/caddy-stable-archive-keyring.gpg
when:
- ansible_os_family == "Debian"
- old_keyring.stat.exists | default(false)
notify: update apt cache
- name: Check if Caddy GPG key exists and is valid
stat:
path: /etc/apt/trusted.gpg.d/caddy-stable.asc
register: caddy_gpg_key
when: ansible_os_family == "Debian"
- name: Add Caddy GPG key (Debian/Ubuntu)
get_url:
url: "https://dl.cloudsmith.io/public/caddy/stable/gpg.key"
dest: /etc/apt/trusted.gpg.d/caddy-stable.asc
mode: '0644'
when:
- ansible_os_family == "Debian"
- not caddy_gpg_key.stat.exists | default(false)
- name: Check if Caddy repository is configured
shell: grep -l "dl.cloudsmith.io/public/caddy/stable" /etc/apt/sources.list.d/*.list 2>/dev/null || true
register: caddy_repo_check
changed_when: false
when: ansible_os_family == "Debian"
- name: Add Caddy repository (Debian/Ubuntu)
@ -24,14 +64,18 @@
repo: "deb [signed-by=/etc/apt/trusted.gpg.d/caddy-stable.asc] https://dl.cloudsmith.io/public/caddy/stable/deb/debian any-version main"
state: present
filename: caddy-stable
when: ansible_os_family == "Debian"
when:
- ansible_os_family == "Debian"
- caddy_repo_check.stdout == ""
- name: Install Caddy (Debian/Ubuntu)
apt:
name: caddy
state: present
update_cache: yes
when: ansible_os_family == "Debian"
when:
- ansible_os_family == "Debian"
- caddy_installed.rc != 0
# Alpine Linux tasks
- name: Install Caddy (Alpine)

View file

@ -1,5 +1,8 @@
{
# Global options
servers {
protocols h1 h2
}
default_bind 0.0.0.0 [::]
admin off
persist_config off
}
@ -8,7 +11,7 @@
root * {{ caddy_default_site_root }}
file_server
encode gzip
# Basic logging
log {
output file /var/log/caddy/access.log
@ -24,9 +27,29 @@ photos.w5isp.com {
reverse_proxy http://100.107.11.77:2283
}
log.w5isp.com {
reverse_proxy http://localhost:8086
encode gzip
log {
output file /var/log/caddy/log.w5isp.com.log
format json
}
}
git.w5isp.com {
reverse_proxy http://localhost:3000
encode gzip
log {
output file /var/log/caddy/git.w5isp.com.log
format json
}
}
# Mailcow configuration
mail.w5isp.com {
reverse_proxy http://204.110.191.216:8080 {
reverse_proxy https://mail.w5isp.com:9443 {
header_up Host {host}
header_up X-Real-IP {remote}
header_up X-Forwarded-For {remote}
@ -35,15 +58,15 @@ mail.w5isp.com {
}
autodiscover.w5isp.com {
reverse_proxy http://204.110.191.216:8080
reverse_proxy https://mail.w5isp.com:9443
}
autoconfig.w5isp.com {
reverse_proxy http://204.110.191.216:8080
reverse_proxy https://mail.w5isp.com:9443
}
mail.mcintire.me {
reverse_proxy http://204.110.191.216:8080 {
reverse_proxy https://mail.w5isp.com:9443 {
header_up Host {host}
header_up X-Real-IP {remote}
header_up X-Forwarded-For {remote}
@ -52,9 +75,9 @@ mail.mcintire.me {
}
autodiscover.mcintire.me {
reverse_proxy http://204.110.191.216:8080
reverse_proxy https://mail.w5isp.com:9443
}
autoconfig.mcintire.me {
reverse_proxy http://204.110.191.216:8080
reverse_proxy https://mail.w5isp.com:9443
}

View file

@ -7,7 +7,7 @@ metadata:
data:
CALLSIGN: "W5ISP-2"
APRS_CALLSIGN: "W5ISP-1"
APRS_SERVER: "dallas.aprs2.net"
APRS_SERVER: "204.110.191.232"
APRS_PORT: "10152"
APRS_FILTER: "r/33/-96/1000000000000"
APRS_PASSCODE: "15748"

View file

@ -105,7 +105,7 @@ resource "dnsimple_zone_record" "mcintire_cname_test" {
resource "dnsimple_zone_record" "mcintire_mail" {
zone_name = "mcintire.me"
name = "mail"
value = "204.110.191.216" # sync.w5isp.com - Mailcow server
value = "66.206.18.162"
type = "A"
ttl = 3600
}
@ -142,7 +142,7 @@ resource "dnsimple_zone_record" "mcintire_autoconfig" {
resource "dnsimple_zone_record" "mcintire_spf_mailcow" {
zone_name = "mcintire.me"
name = ""
value = "v=spf1 mx a ip4:204.110.191.216 ~all"
value = "v=spf1 mx a ip4:66.206.18.162 ~all"
type = "TXT"
ttl = 3600
}

View file

@ -6,26 +6,10 @@ resource "dnsimple_zone_record" "w5isp_root" {
ttl = 3600
}
resource "dnsimple_zone_record" "w5isp_apps" {
zone_name = "w5isp.com"
name = "apps"
value = "204.110.191.210"
type = "A"
ttl = 3600
}
resource "dnsimple_zone_record" "w5isp_gmc" {
zone_name = "w5isp.com"
name = "gmc"
value = "204.110.191.236"
type = "A"
ttl = 3600
}
resource "dnsimple_zone_record" "w5isp_git" {
zone_name = "w5isp.com"
name = "git"
value = "204.110.191.2" # Home k3s cluster
value = "66.206.18.163"
type = "A"
ttl = 3600
}
@ -42,7 +26,7 @@ resource "dnsimple_zone_record" "w5isp_home" {
resource "dnsimple_zone_record" "w5isp_photos" {
zone_name = "w5isp.com"
name = "photos"
value = "204.110.191.212" # Points to Caddy proxy server
value = "66.206.18.162"
type = "A"
ttl = 3600
}
@ -55,30 +39,6 @@ resource "dnsimple_zone_record" "w5isp_skippy" {
ttl = 3600
}
resource "dnsimple_zone_record" "w5isp_ntfy" {
zone_name = "w5isp.com"
name = "ntfy"
value = "204.110.191.8"
type = "A"
ttl = 3600
}
resource "dnsimple_zone_record" "w5isp_jellyfin" {
zone_name = "w5isp.com"
name = "jellyfin"
value = "204.110.191.212" # Points to Caddy proxy server
type = "A"
ttl = 3600
}
resource "dnsimple_zone_record" "w5isp_wildcard" {
zone_name = "w5isp.com"
name = "*"
value = "204.110.191.212" # New Caddy proxy server
type = "A"
ttl = 3600
}
resource "dnsimple_zone_record" "w5isp_ha" {
zone_name = "w5isp.com"
name = "ha"
@ -99,7 +59,7 @@ resource "dnsimple_zone_record" "w5isp_mx1" {
resource "dnsimple_zone_record" "w5isp_txt" {
zone_name = "w5isp.com"
name = ""
value = "v=spf1 mx a ip4:204.110.191.216 ~all"
value = "v=spf1 mx a ip4:66.206.18.162 ~all"
type = "TXT"
ttl = 3600
}
@ -116,7 +76,7 @@ resource "dnsimple_zone_record" "w5isp_dkim" {
resource "dnsimple_zone_record" "w5isp_g" {
zone_name = "w5isp.com"
name = "g"
value = "204.110.191.217"
value = "66.206.18.162"
type = "A"
ttl = 3600
}
@ -161,34 +121,15 @@ resource "dnsimple_zone_record" "w5isp_dmarc" {
ttl = 3600
}
# Caddy proxy server
resource "dnsimple_zone_record" "w5isp_caddy" {
zone_name = "w5isp.com"
name = "caddy"
value = "204.110.191.212" # New Caddy proxy server
type = "A"
ttl = 3600
}
# Mail server
resource "dnsimple_zone_record" "w5isp_mail" {
zone_name = "w5isp.com"
name = "mail"
value = "204.110.191.216" # sync.w5isp.com - Mailcow server
value = "66.206.18.162"
type = "A"
ttl = 3600
}
# W5ISP server - single-node K3s
resource "dnsimple_zone_record" "w5isp_server" {
zone_name = "w5isp.com"
name = "w5isp"
value = "204.110.191.200"
type = "A"
ttl = 3600
}
# Sync server - Mailcow
resource "dnsimple_zone_record" "w5isp_sync" {
zone_name = "w5isp.com"
name = "sync"
@ -197,16 +138,14 @@ resource "dnsimple_zone_record" "w5isp_sync" {
ttl = 3600
}
# Wavelog - Amateur radio logging
resource "dnsimple_zone_record" "w5isp_log" {
zone_name = "w5isp.com"
name = "log"
value = "204.110.191.8" # skippy.w5isp.com
type = "A"
value = "g.w5isp.com"
type = "CNAME"
ttl = 3600
}
# Autodiscover for mail clients
resource "dnsimple_zone_record" "w5isp_autodiscover" {
zone_name = "w5isp.com"
name = "autodiscover"
@ -215,7 +154,6 @@ resource "dnsimple_zone_record" "w5isp_autodiscover" {
ttl = 3600
}
# Autodiscover SRV record
resource "dnsimple_zone_record" "w5isp_autodiscover_srv" {
zone_name = "w5isp.com"
name = "_autodiscover._tcp"
@ -225,7 +163,6 @@ resource "dnsimple_zone_record" "w5isp_autodiscover_srv" {
ttl = 3600
}
# Autoconfig for mail clients
resource "dnsimple_zone_record" "w5isp_autoconfig" {
zone_name = "w5isp.com"
name = "autoconfig"
@ -234,7 +171,6 @@ resource "dnsimple_zone_record" "w5isp_autoconfig" {
ttl = 3600
}
# n8n workflow automation
resource "dnsimple_zone_record" "w5isp_n8n" {
zone_name = "w5isp.com"
name = "n8n"
@ -242,16 +178,3 @@ resource "dnsimple_zone_record" "w5isp_n8n" {
type = "A"
ttl = 3600
}
# Node-RED flow-based programming
resource "dnsimple_zone_record" "w5isp_nodered" {
zone_name = "w5isp.com"
name = "nodered"
value = "204.110.191.2" # Traefik ingress on k3s cluster
type = "A"
ttl = 3600
}
# TLSA record for SMTP on port 25 - DNSimple doesn't support TLSA records
# You'll need to add this manually through a different DNS provider if needed:
# _25._tcp.mail.w5isp.com TLSA 3 1 1 885717a52f0e26cdde481d2d44110c3374ff3b7977626afe2f952b655358308a

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long