2021-02-06 07:33:05 +00:00
|
|
|
---
|
2023-03-09 20:47:42 +00:00
|
|
|
- name: Start Mymediaforalexa
|
|
|
|
block:
|
|
|
|
- name: Create Mymediaforalexa Directories
|
|
|
|
ansible.builtin.file:
|
|
|
|
path: "{{ item }}"
|
|
|
|
state: directory
|
|
|
|
with_items:
|
|
|
|
- "{{ mymediaforalexa_media_directory }}"
|
|
|
|
- "{{ mymediaforalexa_data_directory }}"
|
2019-03-01 23:05:33 +00:00
|
|
|
|
2023-03-09 20:47:42 +00:00
|
|
|
- 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
|