Plex using Ansible and Docker



我在家庭服务器上使用Plex已经有一段时间了,我为我的NAS购买了一些升级,所以我决定尝试自动化docker设置。我对Ansible完全陌生,对Docker的接触也很简单。除了实际的Plex部署之外,大多数事情似乎都奏效了。

我试着调整being paramter以防有帮助,最初我把它用于所有命令,但我真的不确定我在做什么,所以我来到了这里。

我得到的错误是;

Error: Unable to set up server: sqlite3_statement_backend::loadOne: database   is locked
Starting Plex Media Server.
6 3000 /config/Library/Application Support
8192

我已经检查了NAS驱动器上的文件本身,并具有以下属性,其中Support是ssh用户;

208 -rwxr-xr-x 1 support root 209920 Apr 30 12:21 com.plexapp.plugins.library.db

我创作的《花花公子》如下:;

---
# Install Docker
- hosts: mediaservers
  remote_user: support
  roles:
    - { role: angstwad.docker_ubuntu, sudo: yes }
# Mount NAS and create folders
- hosts: mediaservers
  remote_user: support
  become: no
  tasks:
    - name: Install required package
      apt: pkg={{item}} state=installed update-cache=yes
      become: yes
      with_items:
        - cifs-utils
    - name: Upload credentials file
      copy: src=env/.smbcredentials dest=/root/ mode=0700
      become: yes
    - name: Create mount directory
      file: state=directory path=/mnt/NAS/universe-01
    - name: mount NAS to fstab
      mount: fstype=cifs name=/mnt/NAS/universe-01 src=//192.168.1.73/universe-01 opts="credentials=/root/.smbcredentials,uid=1000" state=mounted
      become: yes
    # Directories to store media files
    - name: Creates tvshow directory
      file: state=directory path=/mnt/NAS/universe-01/media/tvshows
    - name: Creates movies directory
      file: state=directory path=/mnt/NAS/universe-01/media/movies
    - name: Creates music directory
      file: state=directory path=/mnt/NAS/universe-01/media/music
    - name: Creates photos directory
      file: state=directory path=/mnt/NAS/universe-01/media/photos
    # Directories to store docker data/config
    - name: Creates plex configuration directory
      file: state=directory path=/mnt/NAS/universe-01/data/docker/plex/config
# Deploy docker images
- hosts: mediaservers
  remote_user: support
  become: no
  tasks:
    - name: Create Plex docker image
      become: yes
      docker:
        name: plex
        hostname: plex
        image: linuxserver/plex
        pull: missing
        state: started
        restart_policy: always
        ports:
        - "32400:32400"
        - "32400:32400/udp"
        - "32469:32469"
        - "32469:32469/udp"
        - "5353:5353/udp"
        - "1900:1900/udp"
        volumes: [
          '/mnt/NAS/universe-01/data/docker/plex/config:/config',
          '/mnt/NAS/universe-01/media/tvshows:/data/tvshows',
          '/mnt/NAS/universe-01/media/movies:/data/movies',
          '/mnt/NAS/universe-01/media/music:/data/music',
          '/mnt/NAS/universe-01/media/photos:/data/photos'
        ]
        env:
          VERSION: latest
          PGID: 999
          PUID: 1000

我在Windows上使用Docker时也遇到过类似的错误。对我来说,问题是我给正在使用的丛容器分配了错误的PUID和PGID。一旦我分配了正确的id,服务器运行时没有任何错误。

不完全是你的问题,但我希望这能有所帮助。

相关内容

  • 没有找到相关文章

最新更新