updates
This commit is contained in:
parent
63968031db
commit
ea76ca57a3
19 changed files with 193 additions and 666 deletions
|
|
@ -1,53 +0,0 @@
|
|||
# Mailcow Setup Instructions
|
||||
|
||||
## Current Status
|
||||
|
||||
1. **DNS Records Applied** ✅
|
||||
- A records: mail.w5isp.com, mail.mcintire.me → 204.110.191.216
|
||||
- Autodiscover/Autoconfig records for both domains
|
||||
- MX record for w5isp.com → mail.w5isp.com
|
||||
- SPF record for w5isp.com: `v=spf1 mx a ip4:204.110.191.216 ~all`
|
||||
- DMARC record for w5isp.com with quarantine policy
|
||||
- DKIM placeholder (needs actual key from Mailcow)
|
||||
|
||||
2. **Mailcow Deployed** ✅
|
||||
- Running on sync.w5isp.com with Docker Compose
|
||||
- All containers running successfully
|
||||
- Web interface accessible via HTTPS (Mailcow includes nginx)
|
||||
- No additional reverse proxy needed - Mailcow's nginx handles SSL
|
||||
|
||||
## Next Steps
|
||||
|
||||
### 1. Access Mailcow Web UI
|
||||
Access the web interface at: https://mail.w5isp.com
|
||||
Default admin login: admin / moohoo (change immediately!)
|
||||
|
||||
### 3. Configure Domains in Mailcow
|
||||
1. Log into Mailcow admin panel
|
||||
2. Go to Configuration → Domains
|
||||
3. Add domain: w5isp.com
|
||||
4. Add domain: mcintire.me (for receiving only, MX still points to ProtonMail)
|
||||
|
||||
### 4. Get DKIM Key and Update DNS
|
||||
1. In Mailcow: Configuration → Domains → w5isp.com → DKIM
|
||||
2. Copy the public key
|
||||
3. Update the DKIM record in `terraform/dns_w5isp.tf`
|
||||
4. Apply with `tofu apply`
|
||||
|
||||
### 5. Create Mailboxes
|
||||
1. Go to Mailboxes → Add mailbox
|
||||
2. Create postmaster@w5isp.com (required for DMARC reports)
|
||||
3. Create any other mailboxes needed
|
||||
|
||||
### 6. Test Mail Delivery
|
||||
1. Send test email to/from w5isp.com addresses
|
||||
2. Check mail logs in Mailcow UI
|
||||
3. Verify DMARC/SPF/DKIM with mail-tester.com
|
||||
|
||||
## Important Notes
|
||||
|
||||
- mcintire.me remains with ProtonMail (MX records unchanged)
|
||||
- Only w5isp.com is fully migrated to Mailcow
|
||||
- Firewall ports 25, 587, 465, 143, 993, 110, 995 are opened by the role
|
||||
- Mailcow data is stored in /opt/mailcow-dockerized
|
||||
- The mail server IP is 204.110.191.216 (sync.w5isp.com)
|
||||
|
|
@ -19,15 +19,16 @@ sync.w5isp.com ansible_host=204.110.191.216
|
|||
g.w5isp.com
|
||||
|
||||
[k3s_servers]
|
||||
node1 # ansible_host=10.0.101.211
|
||||
node2 # ansible_host=10.0.101.212
|
||||
node3 # ansible_host=10.0.101.213
|
||||
#node1 # ansible_host=10.0.101.211
|
||||
#node2 # ansible_host=10.0.101.212
|
||||
#node3 # ansible_host=10.0.101.213
|
||||
|
||||
[tailscale_home]
|
||||
sync.w5isp.com
|
||||
|
||||
[caddy_servers]
|
||||
g.w5isp.com
|
||||
skippy.w5isp.com
|
||||
|
||||
[syncthing_servers]
|
||||
sync.w5isp.com
|
||||
|
|
|
|||
|
|
@ -1,53 +0,0 @@
|
|||
#!/bin/bash
|
||||
# Script to install k3s on node3 and join it to the existing cluster
|
||||
|
||||
# Configuration
|
||||
K3S_VERSION="v1.28.4+k3s1"
|
||||
K3S_SERVER_URL="https://node1:6443"
|
||||
|
||||
echo "Installing k3s on node3..."
|
||||
|
||||
# First, get the token from node1
|
||||
echo "Getting k3s token from node1..."
|
||||
TOKEN=$(ssh graham@node1 "sudo cat /var/lib/rancher/k3s/server/node-token")
|
||||
|
||||
if [ -z "$TOKEN" ]; then
|
||||
echo "Error: Could not get k3s token from node1"
|
||||
echo "Please make sure:"
|
||||
echo "1. k3s is installed on node1"
|
||||
echo "2. node1 is accessible via SSH"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Token retrieved successfully"
|
||||
|
||||
# Install k3s on node3
|
||||
echo "Installing k3s on node3..."
|
||||
ssh graham@node3 "curl -sfL https://get.k3s.io | INSTALL_K3S_SKIP_START=true INSTALL_K3S_VERSION='${K3S_VERSION}' K3S_URL='${K3S_SERVER_URL}' K3S_TOKEN='${TOKEN}' sh -"
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "k3s installed successfully on node3"
|
||||
|
||||
# Check if node3 can reach node1
|
||||
echo "Checking connectivity from node3 to node1..."
|
||||
ssh graham@node3 "ping -c 1 node1 && curl -k https://node1:6443 --connect-timeout 5 || echo 'Cannot reach node1:6443'"
|
||||
|
||||
# Start k3s-agent manually
|
||||
echo "Starting k3s-agent service..."
|
||||
ssh graham@node3 "sudo systemctl start k3s-agent"
|
||||
|
||||
# Check service status
|
||||
echo "Checking k3s-agent status..."
|
||||
ssh graham@node3 "sudo systemctl status k3s-agent --no-pager || sudo journalctl -u k3s-agent -n 50 --no-pager"
|
||||
|
||||
# Wait a bit for the node to register
|
||||
echo "Waiting for node to register with cluster..."
|
||||
sleep 10
|
||||
|
||||
# Check if node joined the cluster
|
||||
echo "Checking cluster status..."
|
||||
ssh graham@node1 "sudo kubectl get nodes"
|
||||
else
|
||||
echo "Error: Failed to install k3s on node3"
|
||||
exit 1
|
||||
fi
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
---
|
||||
- name: Install k3s on node3
|
||||
hosts: node3
|
||||
become: true
|
||||
gather_facts: no
|
||||
vars:
|
||||
ansible_user: ansible
|
||||
ansible_ssh_private_key_file: ~/.ssh/ansible
|
||||
tasks:
|
||||
- name: Install k3s using direct command
|
||||
raw: |
|
||||
if ! command -v k3s &> /dev/null; then
|
||||
# Get token from node1
|
||||
TOKEN=$(ssh -o StrictHostKeyChecking=no -i ~/.ssh/ansible ansible@10.0.101.211 "sudo cat /var/lib/rancher/k3s/server/node-token" 2>/dev/null)
|
||||
if [ -n "$TOKEN" ]; then
|
||||
curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION='v1.28.4+k3s1' K3S_URL='https://10.0.101.211:6443' K3S_TOKEN="$TOKEN" sh -
|
||||
else
|
||||
echo "Failed to get token from master"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "k3s already installed"
|
||||
fi
|
||||
|
|
@ -1,300 +0,0 @@
|
|||
---
|
||||
# Playbook to deploy a 3-node Kubernetes cluster on Proxmox
|
||||
# This creates VMs on Proxmox and then installs K8s
|
||||
|
||||
- name: Create VMs on Proxmox
|
||||
hosts: proxmox
|
||||
gather_facts: yes
|
||||
vars:
|
||||
k8s_nodes:
|
||||
- name: k8s-master
|
||||
vmid: 200
|
||||
cores: 2
|
||||
memory: 4096
|
||||
disk: 40
|
||||
ip: 10.0.19.200/24
|
||||
- name: k8s-worker1
|
||||
vmid: 201
|
||||
cores: 2
|
||||
memory: 4096
|
||||
disk: 40
|
||||
ip: 10.0.19.201/24
|
||||
- name: k8s-worker2
|
||||
vmid: 202
|
||||
cores: 2
|
||||
memory: 4096
|
||||
disk: 40
|
||||
ip: 10.0.19.202/24
|
||||
template_vmid: 9000 # Your cloud-init template
|
||||
gateway: 10.0.19.254
|
||||
nameserver: 10.0.19.254
|
||||
storage: local-lvm
|
||||
network_bridge: vmbr0
|
||||
|
||||
tasks:
|
||||
- name: Clone VMs from template
|
||||
community.general.proxmox_kvm:
|
||||
api_user: root@pam
|
||||
api_password: "{{ proxmox_password }}"
|
||||
api_host: "{{ ansible_host | default(ansible_default_ipv4.address) }}"
|
||||
clone: "{{ template_vmid }}"
|
||||
name: "{{ item.name }}"
|
||||
vmid: "{{ item.vmid }}"
|
||||
node: "{{ ansible_hostname }}"
|
||||
storage: "{{ storage }}"
|
||||
timeout: 300
|
||||
loop: "{{ k8s_nodes }}"
|
||||
when: ansible_hostname == "lab01" # Create all VMs on first host
|
||||
|
||||
- name: Configure VM resources
|
||||
community.general.proxmox_kvm:
|
||||
api_user: root@pam
|
||||
api_password: "{{ proxmox_password }}"
|
||||
api_host: "{{ ansible_host | default(ansible_default_ipv4.address) }}"
|
||||
name: "{{ item.name }}"
|
||||
cores: "{{ item.cores }}"
|
||||
memory: "{{ item.memory }}"
|
||||
update: yes
|
||||
loop: "{{ k8s_nodes }}"
|
||||
when: ansible_hostname == "lab01"
|
||||
|
||||
- name: Configure cloud-init
|
||||
community.general.proxmox_kvm:
|
||||
api_user: root@pam
|
||||
api_password: "{{ proxmox_password }}"
|
||||
api_host: "{{ ansible_host | default(ansible_default_ipv4.address) }}"
|
||||
name: "{{ item.name }}"
|
||||
ciuser: debian
|
||||
cipassword: "{{ vm_password | default('changeme') }}"
|
||||
ipconfig:
|
||||
ipconfig0: "ip={{ item.ip }},gw={{ gateway }}"
|
||||
nameservers: "{{ nameserver }}"
|
||||
sshkeys: "{{ lookup('file', '~/.ssh/id_rsa.pub') }}"
|
||||
update: yes
|
||||
loop: "{{ k8s_nodes }}"
|
||||
when: ansible_hostname == "lab01"
|
||||
|
||||
- name: Start VMs
|
||||
community.general.proxmox_kvm:
|
||||
api_user: root@pam
|
||||
api_password: "{{ proxmox_password }}"
|
||||
api_host: "{{ ansible_host | default(ansible_default_ipv4.address) }}"
|
||||
name: "{{ item.name }}"
|
||||
state: started
|
||||
loop: "{{ k8s_nodes }}"
|
||||
when: ansible_hostname == "lab01"
|
||||
|
||||
- name: Wait for VMs to be reachable
|
||||
wait_for:
|
||||
host: "{{ item.ip.split('/')[0] }}"
|
||||
port: 22
|
||||
delay: 30
|
||||
timeout: 300
|
||||
loop: "{{ k8s_nodes }}"
|
||||
delegate_to: localhost
|
||||
|
||||
- name: Prepare K8s nodes
|
||||
hosts: k8s_cluster
|
||||
become: yes
|
||||
tasks:
|
||||
- name: Update apt cache
|
||||
apt:
|
||||
update_cache: yes
|
||||
cache_valid_time: 3600
|
||||
|
||||
- name: Install required packages
|
||||
apt:
|
||||
name:
|
||||
- apt-transport-https
|
||||
- ca-certificates
|
||||
- curl
|
||||
- gnupg
|
||||
- lsb-release
|
||||
- software-properties-common
|
||||
state: present
|
||||
|
||||
- name: Disable swap
|
||||
command: swapoff -a
|
||||
|
||||
- name: Remove swap from fstab
|
||||
lineinfile:
|
||||
path: /etc/fstab
|
||||
regexp: '\sswap\s'
|
||||
state: absent
|
||||
|
||||
- name: Load required kernel modules
|
||||
modprobe:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
loop:
|
||||
- overlay
|
||||
- br_netfilter
|
||||
|
||||
- name: Setup required sysctl params
|
||||
sysctl:
|
||||
name: "{{ item.key }}"
|
||||
value: "{{ item.value }}"
|
||||
sysctl_set: yes
|
||||
state: present
|
||||
reload: yes
|
||||
loop:
|
||||
- { key: net.bridge.bridge-nf-call-iptables, value: 1 }
|
||||
- { key: net.bridge.bridge-nf-call-ip6tables, value: 1 }
|
||||
- { key: net.ipv4.ip_forward, value: 1 }
|
||||
|
||||
- name: Install containerd
|
||||
hosts: k8s_cluster
|
||||
become: yes
|
||||
tasks:
|
||||
- name: Add Docker GPG key
|
||||
apt_key:
|
||||
url: https://download.docker.com/linux/debian/gpg
|
||||
state: present
|
||||
|
||||
- name: Add Docker repository
|
||||
apt_repository:
|
||||
repo: "deb [arch=amd64] https://download.docker.com/linux/debian {{ ansible_distribution_release }} stable"
|
||||
state: present
|
||||
|
||||
- name: Install containerd
|
||||
apt:
|
||||
name: containerd.io
|
||||
state: present
|
||||
|
||||
- name: Create containerd config directory
|
||||
file:
|
||||
path: /etc/containerd
|
||||
state: directory
|
||||
|
||||
- name: Generate default containerd config
|
||||
shell: containerd config default > /etc/containerd/config.toml
|
||||
args:
|
||||
creates: /etc/containerd/config.toml
|
||||
|
||||
- name: Configure containerd to use systemd cgroup
|
||||
lineinfile:
|
||||
path: /etc/containerd/config.toml
|
||||
regexp: ' SystemdCgroup = false'
|
||||
line: ' SystemdCgroup = true'
|
||||
|
||||
- name: Restart containerd
|
||||
systemd:
|
||||
name: containerd
|
||||
state: restarted
|
||||
enabled: yes
|
||||
|
||||
- name: Install Kubernetes
|
||||
hosts: k8s_cluster
|
||||
become: yes
|
||||
vars:
|
||||
kubernetes_version: "1.33"
|
||||
kubernetes_patch_version: "1.33.3"
|
||||
tasks:
|
||||
- name: Add Kubernetes GPG key
|
||||
apt_key:
|
||||
url: https://pkgs.k8s.io/core:/stable:/v{{ kubernetes_version }}/deb/Release.key
|
||||
state: present
|
||||
|
||||
- name: Add Kubernetes repository
|
||||
apt_repository:
|
||||
repo: "deb https://pkgs.k8s.io/core:/stable:/v{{ kubernetes_version }}/deb/ /"
|
||||
state: present
|
||||
|
||||
- name: Install Kubernetes packages
|
||||
apt:
|
||||
name:
|
||||
- kubelet={{ kubernetes_patch_version }}-*
|
||||
- kubeadm={{ kubernetes_patch_version }}-*
|
||||
- kubectl={{ kubernetes_patch_version }}-*
|
||||
state: present
|
||||
|
||||
- name: Hold Kubernetes packages
|
||||
dpkg_selections:
|
||||
name: "{{ item }}"
|
||||
selection: hold
|
||||
loop:
|
||||
- kubelet
|
||||
- kubeadm
|
||||
- kubectl
|
||||
|
||||
- name: Initialize Kubernetes master
|
||||
hosts: k8s_master
|
||||
become: yes
|
||||
vars:
|
||||
pod_network_cidr: "10.244.0.0/16"
|
||||
tasks:
|
||||
- name: Check if kubeadm has already run
|
||||
stat:
|
||||
path: /etc/kubernetes/admin.conf
|
||||
register: kubeadm_init
|
||||
|
||||
- name: Initialize master node
|
||||
command: |
|
||||
kubeadm init --pod-network-cidr={{ pod_network_cidr }} \
|
||||
--apiserver-advertise-address={{ ansible_default_ipv4.address }}
|
||||
when: not kubeadm_init.stat.exists
|
||||
register: kubeadm_output
|
||||
|
||||
- name: Create .kube directory for debian user
|
||||
file:
|
||||
path: /home/debian/.kube
|
||||
state: directory
|
||||
owner: debian
|
||||
group: debian
|
||||
mode: '0755'
|
||||
|
||||
- name: Copy admin.conf to debian user
|
||||
copy:
|
||||
src: /etc/kubernetes/admin.conf
|
||||
dest: /home/debian/.kube/config
|
||||
remote_src: yes
|
||||
owner: debian
|
||||
group: debian
|
||||
mode: '0644'
|
||||
|
||||
- name: Install Flannel CNI
|
||||
become: no
|
||||
command: kubectl apply -f https://github.com/flannel-io/flannel/releases/latest/download/kube-flannel.yml
|
||||
|
||||
- name: Generate join command
|
||||
command: kubeadm token create --print-join-command
|
||||
register: join_command
|
||||
|
||||
- name: Save join command
|
||||
set_fact:
|
||||
kubeadm_join_command: "{{ join_command.stdout }}"
|
||||
|
||||
- name: Join worker nodes
|
||||
hosts: k8s_workers
|
||||
become: yes
|
||||
tasks:
|
||||
- name: Check if node has already joined
|
||||
stat:
|
||||
path: /etc/kubernetes/kubelet.conf
|
||||
register: kubelet_conf
|
||||
|
||||
- name: Join cluster
|
||||
command: "{{ hostvars[groups['k8s_master'][0]]['kubeadm_join_command'] }}"
|
||||
when: not kubelet_conf.stat.exists
|
||||
|
||||
- name: Configure kubectl for management
|
||||
hosts: k8s_master
|
||||
become: no
|
||||
tasks:
|
||||
- name: Check nodes
|
||||
command: kubectl get nodes
|
||||
register: nodes_output
|
||||
|
||||
- name: Display nodes
|
||||
debug:
|
||||
var: nodes_output.stdout_lines
|
||||
|
||||
- name: Install metrics server
|
||||
command: kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
|
||||
|
||||
- name: Create dashboard namespace
|
||||
command: kubectl create namespace kubernetes-dashboard
|
||||
ignore_errors: yes
|
||||
|
||||
- name: Install Kubernetes dashboard
|
||||
command: kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.7.0/aio/deploy/recommended.yaml
|
||||
|
|
@ -1,138 +0,0 @@
|
|||
---
|
||||
# Install Kubernetes on existing Debian 12 VMs
|
||||
# Usage: ansible-playbook -i inventories/k8s-cluster/hosts k8s-install-only.yml
|
||||
|
||||
- name: Prepare nodes for Kubernetes
|
||||
hosts: k8s_cluster
|
||||
become: yes
|
||||
tasks:
|
||||
- name: Update apt cache
|
||||
apt:
|
||||
update_cache: yes
|
||||
|
||||
- name: Install required packages
|
||||
apt:
|
||||
name:
|
||||
- apt-transport-https
|
||||
- ca-certificates
|
||||
- curl
|
||||
- gnupg
|
||||
- lsb-release
|
||||
state: present
|
||||
|
||||
- name: Disable swap
|
||||
shell: |
|
||||
swapoff -a
|
||||
sed -i '/swap/d' /etc/fstab
|
||||
|
||||
- name: Load kernel modules
|
||||
modprobe:
|
||||
name: "{{ item }}"
|
||||
loop: [overlay, br_netfilter]
|
||||
|
||||
- name: Persist kernel modules
|
||||
copy:
|
||||
content: |
|
||||
overlay
|
||||
br_netfilter
|
||||
dest: /etc/modules-load.d/k8s.conf
|
||||
|
||||
- name: Configure sysctl
|
||||
sysctl:
|
||||
name: "{{ item.key }}"
|
||||
value: "{{ item.value }}"
|
||||
sysctl_set: yes
|
||||
reload: yes
|
||||
loop:
|
||||
- { key: net.bridge.bridge-nf-call-iptables, value: 1 }
|
||||
- { key: net.bridge.bridge-nf-call-ip6tables, value: 1 }
|
||||
- { key: net.ipv4.ip_forward, value: 1 }
|
||||
|
||||
- name: Add Docker GPG key
|
||||
apt_key:
|
||||
url: https://download.docker.com/linux/debian/gpg
|
||||
|
||||
- name: Add Docker repo
|
||||
apt_repository:
|
||||
repo: "deb [arch=amd64] https://download.docker.com/linux/debian {{ ansible_distribution_release }} stable"
|
||||
|
||||
- name: Install containerd
|
||||
apt:
|
||||
name: containerd.io
|
||||
state: present
|
||||
|
||||
- name: Configure containerd
|
||||
shell: |
|
||||
mkdir -p /etc/containerd
|
||||
containerd config default > /etc/containerd/config.toml
|
||||
sed -i 's/SystemdCgroup = false/SystemdCgroup = true/g' /etc/containerd/config.toml
|
||||
|
||||
- name: Restart containerd
|
||||
systemd:
|
||||
name: containerd
|
||||
state: restarted
|
||||
enabled: yes
|
||||
|
||||
- name: Add Kubernetes GPG key
|
||||
apt_key:
|
||||
url: https://pkgs.k8s.io/core:/stable:/v1.33/deb/Release.key
|
||||
|
||||
- name: Add Kubernetes repo
|
||||
apt_repository:
|
||||
repo: "deb https://pkgs.k8s.io/core:/stable:/v1.33/deb/ /"
|
||||
|
||||
- name: Install Kubernetes
|
||||
apt:
|
||||
name:
|
||||
- kubelet=1.33.3-*
|
||||
- kubeadm=1.33.3-*
|
||||
- kubectl=1.33.3-*
|
||||
state: present
|
||||
|
||||
- name: Hold Kubernetes packages
|
||||
dpkg_selections:
|
||||
name: "{{ item }}"
|
||||
selection: hold
|
||||
loop: [kubelet, kubeadm, kubectl]
|
||||
|
||||
- name: Initialize master
|
||||
hosts: k8s_master
|
||||
become: yes
|
||||
tasks:
|
||||
- name: Initialize cluster
|
||||
command: kubeadm init --pod-network-cidr=10.244.0.0/16
|
||||
args:
|
||||
creates: /etc/kubernetes/admin.conf
|
||||
register: kubeadm_init
|
||||
|
||||
- name: Create .kube directory
|
||||
file:
|
||||
path: "/home/{{ ansible_user }}/.kube"
|
||||
state: directory
|
||||
owner: "{{ ansible_user }}"
|
||||
group: "{{ ansible_user }}"
|
||||
|
||||
- name: Copy admin.conf
|
||||
copy:
|
||||
src: /etc/kubernetes/admin.conf
|
||||
dest: "/home/{{ ansible_user }}/.kube/config"
|
||||
remote_src: yes
|
||||
owner: "{{ ansible_user }}"
|
||||
group: "{{ ansible_user }}"
|
||||
|
||||
- name: Install Flannel
|
||||
become_user: "{{ ansible_user }}"
|
||||
command: kubectl apply -f https://github.com/flannel-io/flannel/releases/latest/download/kube-flannel.yml
|
||||
|
||||
- name: Get join command
|
||||
command: kubeadm token create --print-join-command
|
||||
register: join_command
|
||||
|
||||
- name: Join workers
|
||||
hosts: k8s_workers
|
||||
become: yes
|
||||
tasks:
|
||||
- name: Join cluster
|
||||
command: "{{ hostvars[groups['k8s_master'][0]]['join_command']['stdout'] }}"
|
||||
args:
|
||||
creates: /etc/kubernetes/kubelet.conf
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
---
|
||||
# Deploy Mailcow mail server
|
||||
|
||||
- name: Deploy Mailcow
|
||||
hosts: mailcow_servers
|
||||
become: yes
|
||||
vars_files:
|
||||
- host_vars/sync.w5isp.com.vault.yml
|
||||
roles:
|
||||
- mailcow
|
||||
|
|
@ -100,6 +100,8 @@
|
|||
- name: Install and configure Caddy
|
||||
hosts: caddy_servers
|
||||
become: true
|
||||
tags:
|
||||
- caddy
|
||||
roles:
|
||||
- caddy
|
||||
|
||||
|
|
|
|||
|
|
@ -26,8 +26,7 @@ base_packages_by_os_family:
|
|||
- smartmontools
|
||||
- lm-sensors
|
||||
- debconf-utils
|
||||
- ntp
|
||||
- ntpdate
|
||||
- chrony
|
||||
- samba
|
||||
- samba-common
|
||||
- sssd
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
home: "{{ item.home | default(omit) }}"
|
||||
group: "{{ item.primary_group | default(omit) }}"
|
||||
groups: "{{ (user_groups | join(',')) if user_groups else omit }}"
|
||||
append: true
|
||||
append: "{{ true if user_groups else omit }}"
|
||||
create_home: "{{ item.create_home | default(true) }}"
|
||||
state: "{{ item.state | default('present') }}"
|
||||
vars:
|
||||
|
|
|
|||
|
|
@ -91,7 +91,24 @@
|
|||
state: started
|
||||
enabled: yes
|
||||
|
||||
- name: Configure Caddy
|
||||
- name: Check if host-specific Caddyfile template exists
|
||||
stat:
|
||||
path: "{{ playbook_dir }}/roles/caddy/templates/Caddyfile-{{ inventory_hostname }}.j2"
|
||||
register: host_specific_template
|
||||
delegate_to: localhost
|
||||
become: false
|
||||
|
||||
- name: Configure Caddy (host-specific template)
|
||||
template:
|
||||
src: "Caddyfile-{{ inventory_hostname }}.j2"
|
||||
dest: /etc/caddy/Caddyfile
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0644'
|
||||
notify: restart caddy
|
||||
when: host_specific_template.stat.exists
|
||||
|
||||
- name: Configure Caddy (default template)
|
||||
template:
|
||||
src: Caddyfile.j2
|
||||
dest: /etc/caddy/Caddyfile
|
||||
|
|
@ -99,3 +116,4 @@
|
|||
group: root
|
||||
mode: '0644'
|
||||
notify: restart caddy
|
||||
when: not host_specific_template.stat.exists
|
||||
|
|
|
|||
90
ansible/roles/caddy/templates/Caddyfile-g.w5isp.com.j2
Normal file
90
ansible/roles/caddy/templates/Caddyfile-g.w5isp.com.j2
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
{
|
||||
servers {
|
||||
protocols h1 h2
|
||||
}
|
||||
default_bind 66.206.18.162 [::]
|
||||
admin off
|
||||
persist_config off
|
||||
}
|
||||
|
||||
66.206.18.162:80 {
|
||||
bind 66.206.18.162
|
||||
root * /var/www/html
|
||||
file_server
|
||||
encode gzip
|
||||
|
||||
# Basic logging
|
||||
log {
|
||||
output file /var/log/caddy/access.log
|
||||
format json
|
||||
}
|
||||
}
|
||||
|
||||
truck.w5isp.com {
|
||||
reverse_proxy http://100.105.74.2
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
w5isp.com {
|
||||
reverse_proxy http://localhost:2368
|
||||
encode gzip
|
||||
|
||||
log {
|
||||
output file /var/log/caddy/w5isp.com.log
|
||||
format json
|
||||
}
|
||||
}
|
||||
|
||||
# Mailcow configuration
|
||||
mail.w5isp.com {
|
||||
reverse_proxy https://mail.w5isp.com:9443 {
|
||||
header_up Host {host}
|
||||
header_up X-Real-IP {remote}
|
||||
header_up X-Forwarded-For {remote}
|
||||
header_up X-Forwarded-Proto {scheme}
|
||||
}
|
||||
}
|
||||
|
||||
autodiscover.w5isp.com {
|
||||
reverse_proxy https://mail.w5isp.com:9443
|
||||
}
|
||||
|
||||
autoconfig.w5isp.com {
|
||||
reverse_proxy https://mail.w5isp.com:9443
|
||||
}
|
||||
|
||||
mail.mcintire.me {
|
||||
reverse_proxy https://mail.w5isp.com:9443 {
|
||||
header_up Host {host}
|
||||
header_up X-Real-IP {remote}
|
||||
header_up X-Forwarded-For {remote}
|
||||
header_up X-Forwarded-Proto {scheme}
|
||||
}
|
||||
}
|
||||
|
||||
autodiscover.mcintire.me {
|
||||
reverse_proxy https://mail.w5isp.com:9443
|
||||
}
|
||||
|
||||
autoconfig.mcintire.me {
|
||||
reverse_proxy https://mail.w5isp.com:9443
|
||||
}
|
||||
38
ansible/roles/caddy/templates/Caddyfile-skippy.w5isp.com.j2
Normal file
38
ansible/roles/caddy/templates/Caddyfile-skippy.w5isp.com.j2
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
servers {
|
||||
protocols h1 h2
|
||||
}
|
||||
admin off
|
||||
persist_config off
|
||||
}
|
||||
|
||||
skippy.w5isp.com, g.vntx.net {
|
||||
# Set this path to your site's directory.
|
||||
# root * /usr/share/caddy
|
||||
root * /home/graham/public
|
||||
|
||||
log {
|
||||
format console
|
||||
}
|
||||
|
||||
# Enable the static file server.
|
||||
file_server
|
||||
|
||||
@public {
|
||||
path /public/*
|
||||
}
|
||||
file_server @public browse
|
||||
|
||||
@g {
|
||||
path /g/*
|
||||
}
|
||||
file_server @g browse
|
||||
}
|
||||
|
||||
photos.w5isp.com {
|
||||
reverse_proxy http://100.107.11.77:2283
|
||||
}
|
||||
|
||||
log.w5isp.com {
|
||||
reverse_proxy http://127.0.0.1:8086
|
||||
}
|
||||
|
|
@ -5,17 +5,16 @@ metadata:
|
|||
name: aprs-config
|
||||
namespace: aprs
|
||||
data:
|
||||
CALLSIGN: "W5ISP-2"
|
||||
# APRS-IS Connection Configuration
|
||||
APRS_CALLSIGN: "W5ISP-1"
|
||||
APRS_SERVER: "204.110.191.232"
|
||||
APRS_PORT: "10152"
|
||||
APRS_FILTER: "r/33/-96/1000000000000"
|
||||
APRS_PASSCODE: "15748"
|
||||
|
||||
# Application Configuration
|
||||
PACKET_RETENTION_DAYS: "7"
|
||||
CLUSTER_ENABLED: "true"
|
||||
PHX_SERVER: "true"
|
||||
MIX_ENV: "prod"
|
||||
PORT: "4000"
|
||||
POOL_SIZE: "10"
|
||||
RELEASE_DISTRIBUTION: "name"
|
||||
RELEASE_NODE: "aprsme"
|
||||
|
|
@ -65,11 +65,6 @@ spec:
|
|||
- ALL
|
||||
seccompProfile:
|
||||
type: RuntimeDefault
|
||||
volumes:
|
||||
- name: tmp-volume
|
||||
emptyDir: {}
|
||||
- name: app-volume
|
||||
emptyDir: {}
|
||||
containers:
|
||||
- name: aprs
|
||||
image: ghcr.io/aprsme/aprs.me:latest
|
||||
|
|
|
|||
|
|
@ -19,14 +19,6 @@ kubectl apply -f postgres-deployment.yaml --validate=false
|
|||
echo "Waiting for PostgreSQL to be ready..."
|
||||
kubectl wait --for=condition=ready pod -l app=postgres-aprs -n aprs --timeout=300s
|
||||
|
||||
# Deploy Redis
|
||||
echo "Deploying Redis..."
|
||||
kubectl apply -f redis.yaml --validate=false
|
||||
|
||||
# Wait for Redis to be ready
|
||||
echo "Waiting for Redis to be ready..."
|
||||
kubectl wait --for=condition=ready pod -l app=redis -n aprs --timeout=120s
|
||||
|
||||
# Deploy APRS.me
|
||||
echo "Deploying APRS.me application..."
|
||||
kubectl apply -f aprs-secret-secure.yaml --validate=false
|
||||
|
|
|
|||
|
|
@ -1,62 +0,0 @@
|
|||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: redis
|
||||
namespace: aprs
|
||||
spec:
|
||||
selector:
|
||||
app: redis
|
||||
ports:
|
||||
- port: 6379
|
||||
targetPort: 6379
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: redis
|
||||
namespace: aprs
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: redis
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: redis
|
||||
spec:
|
||||
containers:
|
||||
- name: redis
|
||||
image: redis:7-alpine
|
||||
ports:
|
||||
- containerPort: 6379
|
||||
resources:
|
||||
requests:
|
||||
memory: "128Mi"
|
||||
cpu: "100m"
|
||||
limits:
|
||||
memory: "256Mi"
|
||||
cpu: "200m"
|
||||
securityContext:
|
||||
allowPrivilegeEscalation: false
|
||||
runAsNonRoot: true
|
||||
runAsUser: 999
|
||||
runAsGroup: 999
|
||||
capabilities:
|
||||
drop:
|
||||
- ALL
|
||||
seccompProfile:
|
||||
type: RuntimeDefault
|
||||
livenessProbe:
|
||||
tcpSocket:
|
||||
port: 6379
|
||||
initialDelaySeconds: 15
|
||||
periodSeconds: 20
|
||||
readinessProbe:
|
||||
exec:
|
||||
command:
|
||||
- redis-cli
|
||||
- ping
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 5
|
||||
|
|
@ -92,3 +92,19 @@ resource "dnsimple_zone_record" "mcintire_dkim_mailcow" {
|
|||
type = "TXT"
|
||||
ttl = 3600
|
||||
}
|
||||
|
||||
resource "dnsimple_zone_record" "mcintire_headscale" {
|
||||
zone_name = "mcintire.me"
|
||||
name = "headscale"
|
||||
value = "66.206.18.166"
|
||||
type = "A"
|
||||
ttl = 3600
|
||||
}
|
||||
|
||||
resource "dnsimple_zone_record" "mcintire_hs" {
|
||||
zone_name = "mcintire.me"
|
||||
name = "hs"
|
||||
value = "66.206.18.166"
|
||||
type = "A"
|
||||
ttl = 3600
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
resource "dnsimple_zone_record" "w5isp_root" {
|
||||
zone_name = "w5isp.com"
|
||||
name = ""
|
||||
value = "204.110.191.212"
|
||||
value = "66.206.18.162"
|
||||
type = "A"
|
||||
ttl = 3600
|
||||
}
|
||||
|
|
@ -26,7 +26,7 @@ resource "dnsimple_zone_record" "w5isp_home" {
|
|||
resource "dnsimple_zone_record" "w5isp_photos" {
|
||||
zone_name = "w5isp.com"
|
||||
name = "photos"
|
||||
value = "66.206.18.162"
|
||||
value = "204.110.191.8"
|
||||
type = "A"
|
||||
ttl = 3600
|
||||
}
|
||||
|
|
@ -186,3 +186,19 @@ resource "dnsimple_zone_record" "w5isp_nodered" {
|
|||
type = "A"
|
||||
ttl = 3600
|
||||
}
|
||||
|
||||
resource "dnsimple_zone_record" "w5isp_headscale" {
|
||||
zone_name = "w5isp.com"
|
||||
name = "headscale"
|
||||
value = "66.206.18.166"
|
||||
type = "A"
|
||||
ttl = 3600
|
||||
}
|
||||
|
||||
resource "dnsimple_zone_record" "w5isp_hs" {
|
||||
zone_name = "w5isp.com"
|
||||
name = "hs"
|
||||
value = "66.206.18.166"
|
||||
type = "A"
|
||||
ttl = 3600
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue