0

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

我尝试调整 become 参数以防万一这可能会有所帮助,最初我将它用于所有命令,但我真的不确定我在做什么所以我来到这里。

我得到的错误是;

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
4

1 回答 1

0

在 Windows 上使用Docker时我遇到了类似的错误。对我来说,问题是我为我正在使用的plex容器分配了错误的 PUID 和 PGID。一旦我分配了正确的 ID,服务器就会运行而没有任何错误。

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

于 2016-07-16T15:43:00.883 回答