ansible-nas/roles/mymediaforalexa/tasks/main.yml
2023-04-15 14:11:49 +01:00

31 lines
1 KiB
YAML

---
- name: Start Mymediaforalexa
block:
- name: Create Mymediaforalexa Directories
ansible.builtin.file:
path: "{{ item }}"
state: directory
with_items:
- "{{ mymediaforalexa_media_directory }}"
- "{{ mymediaforalexa_data_directory }}"
- name: Mymediaforalexa Docker Container
community.docker.docker_container:
name: "{{ mymediaforalexa_container_name }}"
image: "{{ mymediaforalexa_image_name }}:{{ mymediaforalexa_image_version }}"
pull: true
volumes:
- "{{ mymediaforalexa_media_directory }}:/medialibrary:rw"
- "{{ mymediaforalexa_data_directory }}:/datadir:rw"
network_mode: host
restart_policy: unless-stopped
memory: "{{ mymediaforalexa_memory }}"
when: mymediaforalexa_enabled is true
- name: Stop Mymediaforalexa
block:
- name: Stop Mymediaforalexa
community.docker.docker_container:
name: "{{ mymediaforalexa_container_name }}"
state: absent
when: mymediaforalexa_enabled is false