diff --git a/group_vars/all.yml b/group_vars/all.yml index 382a92d8..35b18993 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -48,10 +48,6 @@ ubooquity_enabled: false # Joomla joomla_enabled: false -# PyTivo -pytivo_enabled: false - - ### ### General ### @@ -248,20 +244,6 @@ joomla_available_externally: "false" joomla_database_password: top_secret joomla_port: "8181" -### -### PyTivo -### -pytivo_available_externally: "false" -pytivo_config_directory: "{{ docker_home }}/pytivo/config" -pytivo_movies_directory: "{{ movies_root }}" -pytivo_tv_directory: "{{ tv_root }}" -pytivo_photos_directory: "{{ photos_root }}" -pytivo_music_directory: "{{ music_root }}" -pytivo_podcasts_directory: "{{ podcasts_root }}" -pytivo_user_id: "0" -pytivo_group_id: "0" - - ### ### YouTubeDL-Material ### diff --git a/nas.yml b/nas.yml index f216b722..fc481db9 100644 --- a/nas.yml +++ b/nas.yml @@ -263,6 +263,11 @@ - plex when: (plex_enabled | default(False)) + - role: pytivo + tags: + - pytivo + when: (pytivo_enabled | default(False)) + - role: radarr tags: - radarr @@ -380,7 +385,3 @@ - import_tasks: tasks/virtual_desktop.yml when: (virtual_desktop_enabled | default(False)) tags: virtual_desktop - - - import_tasks: tasks/pytivo.yml - when: (pytivo_enabled | default(False)) - tags: pytivo diff --git a/roles/pytivo/defaults/main.yml b/roles/pytivo/defaults/main.yml new file mode 100644 index 00000000..d9075181 --- /dev/null +++ b/roles/pytivo/defaults/main.yml @@ -0,0 +1,18 @@ +--- +pytivo_enabled: false +pytivo_available_externally: "false" + +# directories +pytivo_config_directory: "{{ docker_home }}/pytivo/config" +pytivo_movies_directory: "{{ movies_root }}" +pytivo_tv_directory: "{{ tv_root }}" +pytivo_photos_directory: "{{ photos_root }}" +pytivo_music_directory: "{{ music_root }}" +pytivo_podcasts_directory: "{{ podcasts_root }}" + +# uid / gid +pytivo_user_id: "0" +pytivo_group_id: "0" + +# network +pytivo_hostname: "pytivo" \ No newline at end of file diff --git a/tasks/pytivo.yml b/roles/pytivo/tasks/main.yml similarity index 85% rename from tasks/pytivo.yml rename to roles/pytivo/tasks/main.yml index fe50b24b..882e27e2 100644 --- a/tasks/pytivo.yml +++ b/roles/pytivo/tasks/main.yml @@ -1,5 +1,5 @@ --- -- name: PyTivo - create config directory +- name: Create Pytivo Directories file: path: "{{ item }}" state: directory @@ -7,14 +7,11 @@ with_items: - "{{ pytivo_config_directory }}" -- name: PyTivo - install Docker container +- name: Pytivo docker_container: name: pytivo image: pinion/docker-pytivo pull: true - ports: - - "9032:9032" - - "2190:2190/udp" volumes: - "/etc/localtime:/etc/localtime:ro" - "{{ pytivo_config_directory }}:/config:rw" @@ -23,7 +20,9 @@ - "{{ pytivo_photos_directory }}:/photos:ro" - "{{ pytivo_music_directory }}:/music:ro" - "{{ pytivo_podcasts_directory }}:/podcasts:ro" - network_mode: "host" + ports: + - "9032:9032" + - "2190:2190/udp" env: TZ: "{{ ansible_nas_timezone }}" PUID: "{{ pytivo_user_id }}" @@ -32,8 +31,8 @@ memory: 1g labels: traefik.enable: "{{ pytivo_available_externally }}" - traefik.http.routers.pytivo.rule: "Host(`pytivo.{{ ansible_nas_domain }}`)" + traefik.http.routers.pytivo.rule: "Host(`{{ pytivo_hostname }}.{{ ansible_nas_domain }}`)" traefik.http.routers.pytivo.tls.certresolver: "letsencrypt" traefik.http.routers.pytivo.tls.domains[0].main: "{{ ansible_nas_domain }}" traefik.http.routers.pytivo.tls.domains[0].sans: "*.{{ ansible_nas_domain }}" - traefik.http.services.pytivo.loadbalancer.server.port: "9032" + traefik.http.services.pytivo.loadbalancer.server.port: "9032" \ No newline at end of file