move znc to role

This commit is contained in:
PurpleNinja225 2021-02-07 14:38:10 -09:00
parent 3645e1ac29
commit 4d44ad017d
4 changed files with 29 additions and 20 deletions

View file

@ -51,7 +51,6 @@ timemachine_enabled: false
gitlab_enabled: false
# IRC
znc_enabled: false
thelounge_enabled: false
# Finance
@ -326,17 +325,6 @@ youtubedlmaterial_port_http: "8998"
###
openvpn_config_directory: "{{ docker_home }}/openvpn"
###
### ZNC
###
znc_available_externally: "false"
znc_data_directory: "{{ docker_home }}/znc"
znc_user_id: "0"
znc_group_id: "0"
znc_port: "6677"
###
### Stats
###

View file

@ -198,6 +198,11 @@
- watchtower
when: (watchtower_enabled | default(False))
- role: znc
tags:
- znc
when: (znc_enabled | default(False))
tasks:
- import_tasks: tasks/firefly.yml
when: (firefly_enabled | default(False))
@ -219,10 +224,6 @@
when: (glances_enabled | default(False))
tags: glances
- import_tasks: tasks/znc.yml
when: (znc_enabled | default(False))
tags: znc
- import_tasks: tasks/miniflux.yml
when: (miniflux_enabled | default(False))
tags: miniflux

View file

@ -0,0 +1,18 @@
---
# enable or disable the application
znc_enabled: false
znc_available_externally: "false"
# directories
znc_data_directory: "{{ docker_home }}/znc"
# uid / gid
znc_user_id: "0"
znc_group_id: "0"
# network
znc_hostname: "znc"
znc_port: "6677"
# specs
znc_memory: "1g"

View file

@ -3,10 +3,11 @@
file:
path: "{{ item }}"
state: directory
# mode: 0755
with_items:
- "{{ znc_data_directory }}"
- name: ZNC
- name: Create ZNC Docker Container
docker_container:
name: znc
image: znc
@ -14,17 +15,18 @@
volumes:
- "{{ znc_data_directory }}:/znc-data:rw"
- "/etc/timezone:/etc/timezone:ro"
network_mode: "bridge"
ports:
- "{{ znc_port }}:6677"
env:
PUID: "{{ znc_user_id }}"
PGID: "{{ znc_group_id }}"
restart_policy: unless-stopped
memory: 1g
memory: "{{ znc_memory }}"
labels:
traefik.enable: "{{ znc_available_externally }}"
traefik.http.routers.znc.rule: "Host(`znc.{{ ansible_nas_domain }}`)"
traefik.http.routers.znc.rule: "Host(`{{ znc_hostname }}.{{ ansible_nas_domain }}`)"
traefik.http.routers.znc.tls.certresolver: "letsencrypt"
traefik.http.routers.znc.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.znc.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
traefik.http.services.znc.loadbalancer.server.port: "6677"
traefik.http.services.znc.loadbalancer.server.port: "6677"