---
- hosts: localhost
  tasks:
    - name: Create jellyfin_config
      docker_volume:
        name: jellyfin_config

    - name: Create network interfaces
      command: /usr/bin/ip addr add 192.168.1.66/24 dev enp2s0
      ignore_errors: True

    - name: Start jellyfin
      docker_container:
        name: jellyfin
        hostname: jellyfin
        recreate: yes
        image: jellyfin/jellyfin:10.9.6
        ports:
            - "192.168.1.66:8096:8096"
        volumes:
            - jellyfin_config:/config
            - /tmp/jellyfin:/cache
            - /etc_media/Movies:/media
        memory: 8G
        container_default_behavior: compatibility
        restart_policy: unless-stopped
