[英]Plex using Ansible and Docker
I've been using Plex on my home server for a while and I have bought a few upgrades for my NAS so decided to try to automate a docker setup. 我在家庭服务器上使用Plex已有一段时间了,我为NAS购买了一些升级产品,因此决定尝试自动化Docker设置。 I am completely new to Ansible and only quite simple exposure to Docker.
我对Ansible完全陌生,只是非常简单地接触Docker。 Most things seem to have worked except for the actual Plex deployment.
除了实际的Plex部署以外,大多数事情似乎都起作用了。
I tried adjusting the become paramter in-case this could help, initially I used it for all commands, but I really wasn't sure what I am doing so I have come here. 我尝试调整变为参数的情况,以防万一这有帮助,最初我将其用于所有命令,但是我真的不确定自己在做什么,所以我来了。
The error I am getting is; 我得到的错误是;
Error: Unable to set up server: sqlite3_statement_backend::loadOne: database is locked
Starting Plex Media Server.
6 3000 /config/Library/Application Support
8192
I have checked the file itself on the NAS drive and has the following properties, where Support is the ssh user; 我已经检查了NAS驱动器上的文件本身,并具有以下属性,其中Support是ssh用户;
208 -rwxr-xr-x 1 support root 209920 Apr 30 12:21 com.plexapp.plugins.library.db
And the Playbook I have created is as follows; 我创建的剧本如下:
---
# 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
I had similar errors when using Docker on Windows . 在Windows上使用Docker时,我遇到了类似的错误。 For me the problem was that I was assigning wrong PUID and PGID to the plex container I was using.
对我来说,问题是我向使用的plex容器分配了错误的PUID和PGID。 Once I assigned the proper id, the server ran without any errors.
分配正确的ID后,服务器即可正常运行。
Not exactly your problem, but I hope this helps. 不完全是您的问题,但我希望这会有所帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.