|
26 | 26 | - "/opt/plex/Library/Application Support/Plex Media Server/Plug-ins" |
27 | 27 | - "/opt/plex/Library/Logs" |
28 | 28 | - "/opt/plex/Library/Logs/Plex Media Server" |
29 | | - - "{{ plex.transcodes }}/1" |
30 | | - - "{{ plex.transcodes }}/2" |
| 29 | + - "{{ plex.transcodes }}/plex" |
31 | 30 |
|
32 | 31 | - name: "Stop and remove any existing container" |
33 | 32 | docker_container: |
|
48 | 47 | path: "/opt/plex/Library/Application Support/Plex Media Server/Preferences.xml" |
49 | 48 | register: preferences_xml |
50 | 49 |
|
51 | | -- name: Check 'Preferences.xml' for Plex Token |
| 50 | +- name: "'Preferences.xml' Tasks" |
52 | 51 | block: |
53 | 52 |
|
54 | 53 | - name: Get 'Preferences.xml' XML data |
55 | 54 | xml: |
56 | 55 | path: "/opt/plex/Library/Application Support/Plex Media Server/Preferences.xml" |
57 | 56 | xpath: /Preferences |
58 | 57 | content: attribute |
59 | | - attribute: PlexOnlineToken |
60 | 58 | register: preferences_xml_resp |
61 | 59 | ignore_errors: yes |
62 | 60 |
|
63 | | - - name: "Remove 'Preferences.xml' file when malformed" |
| 61 | + - name: "Remove 'Preferences.xml' if malformed" |
64 | 62 | file: |
65 | 63 | path: "/opt/plex/Library/Application Support/Plex Media Server/Preferences.xml" |
66 | 64 | state: absent |
67 | 65 | when: (preferences_xml_resp is failed) |
68 | 66 |
|
| 67 | + - name: Set 'transcoder_path_fix' variable |
| 68 | + set_fact: |
| 69 | + transcoder_path_fix: "{{ (preferences_xml_resp is succeeded) and |
| 70 | + (preferences_xml_resp.matches[0].Preferences.TranscoderTempDirectory is defined) and |
| 71 | + (preferences_xml_resp.matches[0].Preferences.TranscoderTempDirectory | trim == '/transcodes') }}" |
| 72 | + |
| 73 | + - name: "Fix 'TranscoderTempDirectory'" |
| 74 | + xml: |
| 75 | + path: "/opt/plex/Library/Application Support/Plex Media Server/Preferences.xml" |
| 76 | + xpath: /Preferences |
| 77 | + attribute: TranscoderTempDirectory |
| 78 | + value: "/transcode" |
| 79 | + state: present |
| 80 | + ignore_errors: yes |
| 81 | + when: (transcoder_path_fix) |
| 82 | + |
69 | 83 | - name: Set 'plex_server_claimed' variable |
70 | 84 | set_fact: |
71 | 85 | plex_server_claimed: "{{ (preferences_xml_resp is succeeded) and |
|
137 | 151 | - "/etc/localtime:/etc/localtime:ro" |
138 | 152 | - "/opt/plex:/config" |
139 | 153 | - "/opt/scripts:/scripts" |
140 | | - - "{{ plex.transcodes }}/1:/transcode" |
141 | | - - "{{ plex.transcodes }}/2:/transcodes" |
142 | 154 | - "/mnt/unionfs/Media:/data" |
143 | 155 | - "/mnt:/mnt" |
144 | 156 | - "/tmp:/tmp" |
145 | 157 | - "/dev/shm:/dev/shm" |
| 158 | + - "{{ plex.transcodes }}/plex:/transcode" |
146 | 159 | devices: "{{ '/dev/dri:/dev/dri' if (gpu.intel and dev_dri.stat.exists) | default(false) else omit }}" |
147 | 160 | etc_hosts: "{{ (plex_default_hosts) | combine(plex_custom_hosts|default([])) }}" |
148 | 161 | labels: |
|
0 commit comments