Skip to content

Emby

Auto Documentation

Documentation Generated with Python on 2021-04-03

Default Variables

Tasks

main.yml

- include: mount.yml
- include: container.yml

container.yml

- name: ensures emby directory dir exists
  file:
    path: "{{ item }}"
    state: directory
    owner: "{{ main_user}}"
    group: "{{ main_group }}"
  loop:
    - "{{ docker_dir }}/emby/config"

- name: Emby Media Server Container
  docker_container:
    name: emby
    image: "emby/embyserver:latest"
    restart_policy: always
    networks:
      - name: web
        aliases: emby
    ports:
      - "{{ proxy.emby.port }}:8096"
      - "8920:8920"
    mounts:
      - type: bind
        source: "{{ docker_dir }}/emby/config/"
        target: /config
      - type: bind
        source: "{{ nas_media_local }}/Media/Movies"
        target: /mnt/Movies
      - type: bind
        source: "{{ nas_media_local }}/Media/TV Shows"
        target: /mnt/TV Shows
      - type: bind
        source: "{{ nas_media_local }}/Media/Courses"
        target: /mnt/Courses
      - type: bind

        source: "{{ nas_media_local }}/MetaData/"
        target: /metadata
      - type: bind
        source: "{{ nas_media_local }}/MetaData/Backups"
        target: /backups
    env:
      UID: "1000"
      GID: "100"
      GIDLIST: "100"
      TZ: "{{ time_zone }}"

mount.yml

- name: Create credential file (used for fstab entry)
  copy:
    content: |
      username={{ nas_un }}
      password={{ nas_pw }}
    dest: "/home/{{ main_username }}/.credential"
    mode: 0600
  become: true
  become_user: "{{ main_username }}"

- name: Install cifs helper package
  become: yes
  apt:
    name: cifs-utils
    state: latest
    update_cache: yes
    force_apt_get: yes

- name: Mount Media
  become: true
  become_user: "{{ main_username }}"
  mount:
    path: /media/NAS_Media
    src: "{{ nas_media }}"
    opts: "credentials=/home/{{ main_username }}/.credential,uid={{ main_username }},gid=1000,iocharset=utf8,file_mode=0777,dir_mode=0777"
    state: mounted
    fstype: cifs

- name: Mount Media
  become: true
  become_user: "{{ main_username }}"
  mount:
    path: /media/NAS_Backups
    src: "{{ nas_backups }}"
    opts: "credentials=/home/{{ main_username }}/.credential,uid={{ main_username }},gid=1000,iocharset=utf8,file_mode=0777,dir_mode=0777"
    state: mounted
    fstype: cifs

- name: Mount Media
  become: true
  become_user: "{{ main_username }}"
  mount:
    path: /media/NAS_Docs
    src: "{{ nas_docs }}"
    opts: "credentials=/home/{{ main_username }}/.credential,uid={{ main_username }},gid=1000,iocharset=utf8,file_mode=0777,dir_mode=0777"
    state: mounted
    fstype: cifs