Removed unused site-confs and added stub template

Signed-off-by: TuDatTr <tuan-dat.tran@tudattr.dev>
This commit is contained in:
TuDatTr
2023-06-12 22:16:28 +02:00
parent 8b1acb4eb7
commit 6c8a33e730
12 changed files with 184 additions and 141 deletions

View File

@@ -0,0 +1,31 @@
---
- name: Create swag container
docker_container:
image: lscr.io/linuxserver/swag:latest
name: "{{ swag_host }}"
restart_policy: "unless-stopped"
networks:
- name: "{{ docker_net_name }}"
ipv4_address: 172.16.69.2
aliases: "{{ swag_host }}"
dns_servers:
- "{{ aya01_ip }}"
- "{{ pi_ip }}"
- 1.1.1.1
capabilities:
- NET_ADMIN
env:
PUID: "{{ puid }}"
PGID: "{{ pgid }}"
TZ: "{{ timezone }}"
URL: "{{ remote_domain }}"
VALIDATION: "http"
SUBDOMAINS: "{{ swag_subdomains }}"
DNSPLUGIN: "cloudflare"
EMAIL: "{{ swag_email }}"
ONLY_SUBDOMAINS: "false"
volumes:
- "{{ swag_config }}:/config"
ports:
- "{{ swag_port }}:443"
- 80:80 #optional

View File

@@ -0,0 +1,3 @@
---
- include_tasks: setup.yml
- include_tasks: docker.yml

View File

@@ -0,0 +1,20 @@
---
- name: Create swag-config directory
file:
path: "{{ item }}"
owner: "{{ puid }}"
group: "{{ pgid }}"
state: directory
loop:
- "{{ swag_config }}"
- name: Copy site-confs
template:
owner: "{{ puid }}"
group: "{{ pgid }}"
src: "{{ item }}"
dest: "{{ swag_remote_site_confs }}"
mode: '664'
loop: "{{ swag_site_confs }}"
become: true