Compare commits

..

No commits in common. "vpn_clients" and "main" have entirely different histories.

10 changed files with 34 additions and 60 deletions

View File

@ -1,5 +1,3 @@
---
docker_users:
- "{{ ansible_user }}"
docker_compose_projects_base_path: "/home/{{ ansible_user }}/compose_projects"
- "{{ ansible_user }}"

View File

@ -11,5 +11,4 @@
- geerlingguy.docker
- prepare_node
- include_role:
name: pangolin
- include_role: pangolin

View File

@ -1,14 +1,14 @@
---
- name: Create docker compose directory
ansible.builtin.file:
path: "{{ docker_compose_projects_base_path }}/forgejo"
path: "/home/{{ ansible_user }}/compose_projects/forgejo"
state: directory
mode: '0755'
register: compose_dir
- name: Create data directory
ansible.builtin.file:
path: "{{ compose_dir }}/data"
path: "/home/{{ ansible_user }}/forgejo/data"
state: directory
mode: '0755'
register: forgejo_data_dir
@ -16,7 +16,7 @@
- name: Create DB data directory
ansible.builtin.file:
path: "{{ compose_dir }}/db"
path: "/home/{{ ansible_user }}/forgejo/db"
state: directory
mode: '0755'
register: forgejo_db_dir

View File

@ -1,7 +1,7 @@
---
- name: Create docker compose directory
ansible.builtin.file:
path: "{{ docker_compose_projects_base_path }}/newt_compose"
path: "/home/{{ ansible_user }}/compose_projects/newt_compose"
state: directory
mode: '0755'
register: compose_dir

View File

@ -1,12 +1,4 @@
---
pangolin_version: "ee-latest"
gerbil_version: "latest"
traefik_version: "latest"
pangolin_base_path: "{{ docker_compose_projects_base_path }}/pangolin"
# Derived Variables
pangolin_cors_origin: "{{ pangolin_dashboard_url }}"

View File

@ -1,46 +1,38 @@
---
- name: Ensure Pangolin directory exists
ansible.builtin.file:
path: "{{ pangolin_base_path }}"
path: /home/ubuntu/pangolin
state: directory
- name: Ensure Pangolin config directory exists
ansible.builtin.file:
path: "{{ pangolin_base_path }}/pangolin_config"
path: /home/ubuntu/pangolin/pangolin_config
state: directory
register: pangolin_config_dir
- name: Template Pangolin config file
ansible.builtin.template:
src: pangolin_config.yml.j2
dest: "{{ pangolin_config_dir.path }}/config.yaml"
- name: Ensure Letsencrypt config directory exists
ansible.builtin.file:
path: "{{ pangolin_config_dir.path }}/letsencrypt"
state: directory
register: letsencrypt_config_directory
dest: /home/ubuntu/pangolin/pangolin_config/config.yaml
- name: Ensure Traefik config directory exists
ansible.builtin.file:
path: "{{ pangolin_config_dir.path }}/traefik"
path: /home/ubuntu/pangolin/config/traefik
state: directory
register: traefik_config_directory
- name: Template Traefik config file
ansible.builtin.template:
src: traefik_config.yml.j2
dest: "{{ traefik_config_directory.path }}/traefik_config.yml"
dest: /home/ubuntu/pangolin/config/traefik/traefik_config.yml
- name: Template Traefik dynamic config file
ansible.builtin.template:
src: dynamic_config.yml.j2
dest: "{{ traefik_config_directory.path }}/dynamic_config.yml"
dest: /home/ubuntu/pangolin/config/traefik/dynamic_config.yml
- name: Template docker-compose.yml for Pangolin
ansible.builtin.template:
src: docker-compose.yml.j2
dest: "{{ pangolin_base_path }}/docker-compose.yml"
dest: /home/ubuntu/pangolin/docker-compose.yml
register: pangolin_compose_template
- name: Check if Pangolin container is running
@ -72,7 +64,7 @@
- name: Start Pangolin and Gerbil with Docker Compose (force recreate if needed)
ansible.builtin.shell: |
cd {{ pangolin_base_path }}
cd /home/ubuntu/pangolin
docker compose up -d --force-recreate
when: pangolin_compose_needs_up
register: docker_compose_up
@ -80,7 +72,7 @@
- name: Check Docker Compose service status
ansible.builtin.shell: |
cd {{ pangolin_base_path }}
cd /home/ubuntu/pangolin
docker compose ps
register: docker_compose_status

View File

@ -1,3 +1,10 @@
---
- ansible.builtin.include_tasks: prepare_node.yaml
- include_role:
name: geerlingguy.docker
apply:
become: true
- ansible.builtin.include_tasks:
file: docker_pangolin.yaml
file: docker_pangolin.yaml
apply:
become: true

View File

@ -1,10 +1,10 @@
services:
pangolin:
image: fosrl/pangolin:{{ pangolin_version }}
image: fosrl/pangolin:ee-latest
container_name: pangolin
restart: unless-stopped
volumes:
- {{ pangolin_config_dir.path }}:/app/config
- ./pangolin_config:/app/config
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3001/api/v1/"]
interval: "3s"
@ -12,7 +12,7 @@ services:
retries: 15
gerbil:
image: fosrl/gerbil:{{ gerbil_version }}
image: fosrl/gerbil:1.0.0
container_name: gerbil
restart: unless-stopped
depends_on:
@ -30,12 +30,11 @@ services:
- SYS_MODULE
ports:
- 51820:51820/udp
- 21820:21820/udp
- 443:443 # Port for traefik because of the network_mode
- 80:80 # Port for traefik because of the network_mode
traefik:
image: traefik:{{ traefik_version }}
image: traefik:v3.4.1
container_name: traefik
restart: unless-stopped
network_mode: service:gerbil # Ports appear on the gerbil service
@ -45,9 +44,9 @@ services:
command:
- --configFile=/etc/traefik/traefik_config.yml
volumes:
- {{ traefik_config_directory.path }}:/etc/traefik:ro # Volume to store the Traefik configuration
- {{ letsencrypt_config_directory.path }}:/letsencrypt # Volume to store the Let's Encrypt certificates
- {{ traefik_config_directory.path }}/logs:/var/log/traefik # Volume to store Traefik logs
- ./config/traefik:/etc/traefik:ro # Volume to store the Traefik configuration
- ./config/letsencrypt:/letsencrypt # Volume to store the Let's Encrypt certificates
- ./config/traefik/logs:/var/log/traefik # Volume to store Traefik logs
networks:
default:
driver: bridge

View File

@ -11,12 +11,11 @@
- { protocol: tcp, port: '80', description: 'HTTP for Lets Encrypt ACME challenge' }
- { protocol: tcp, port: '443', description: 'HTTPS for secure web traffic' }
- { protocol: udp, port: '51820', description: 'WireGuard VPN traffic' }
- { protocol: udp, port: '21820', description: 'WireGuard VPN traffic clients' }
become: true
become_exe: "{{ become_exe_value }}"
register: iptables_result
- name: Display iptables configuration status
ansible.builtin.debug:
msg: "Configured firewall rules for ports: 80 (HTTP), 443 (HTTPS), 51820 (WireGuard UDP), 21820 (VPN UDP clients)"
msg: "Configured firewall rules for ports: 80 (HTTP), 443 (HTTPS), 51820 (WireGuard UDP)"
when: iptables_result is changed

View File

@ -1,18 +1,6 @@
---
- ansible.builtin.include_tasks:
file: updates.yaml
apply:
become: true
- ansible.builtin.include_tasks:
file: swap.yaml
apply:
become: true
- include_role: updates.yaml
- include_role: swap.yaml
when: configure_swap is defined
- ansible.builtin.include_tasks:
file: iptables.yaml
apply:
become: true
- include_role: iptables.yaml
when: ip_tables_coonfig is defined