ansible-nas/roles/mymediaforalexa/tasks/main.yml
2023-03-09 21:47:42 +01:00

32 lines
1.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:
container_default_behavior: no_defaults
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