Couchpotato start and stop

This commit is contained in:
David Stephens 2022-08-31 00:29:40 +01:00
parent 79c9040c64
commit dafd55e076
2 changed files with 46 additions and 32 deletions

View file

@ -17,3 +17,6 @@ couchpotato_port: "5050"
# specs
couchpotato_memory: 1g
# docker
couchpotato_container_name: couchpotato

View file

@ -1,5 +1,7 @@
---
- name: Create Couchpotato Directories
- name: Start Couchpotato
block:
- name: Create Couchpotato Directories
file:
path: "{{ item }}"
state: directory
@ -7,9 +9,9 @@
with_items:
- "{{ docker_home }}/couchpotato/config"
- name: Couchpotato Docker Container
- name: Couchpotato Docker Container
docker_container:
name: couchpotato
name: "{{ couchpotato_container_name }}"
image: linuxserver/couchpotato
pull: true
volumes:
@ -32,3 +34,12 @@
traefik.http.routers.couchpotato.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.couchpotato.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
traefik.http.services.couchpotato.loadbalancer.server.port: "5050"
when: couchpotato_enabled is true
- name: Stop Couchpotato
block:
- name: Stop Couchpotato
docker_container:
name: "{{ couchpotato_container_name }}"
state: absent
when: couchpotato_enabled is false