mirror of
https://github.com/davestephens/ansible-nas
synced 2025-01-13 12:08:53 +00:00
31 lines
1 KiB
YAML
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
|