2021-07-14 13:29:25 +00:00
|
|
|
- name: Get current running containers
|
|
|
|
community.docker.docker_host_info:
|
|
|
|
containers: yes
|
|
|
|
register: docker_info
|
|
|
|
|
|
|
|
- name: Stop/Remove all current containers
|
2021-07-14 13:30:48 +00:00
|
|
|
community.docker.docker_container:
|
2021-07-14 13:29:25 +00:00
|
|
|
name: "{{ item }}"
|
|
|
|
state: absent
|
|
|
|
loop: "{{ docker_info.containers | map(attribute='Id') | list }}"
|
|
|
|
|
|
|
|
- name: Prune everything
|
|
|
|
community.docker.docker_prune:
|
|
|
|
containers: yes
|
|
|
|
images: yes
|
|
|
|
volumes: yes
|
|
|
|
|
2021-07-13 20:04:25 +00:00
|
|
|
- name: Create Docker volumes
|
|
|
|
community.docker.docker_volume:
|
|
|
|
name: "{{ item.name }}"
|
|
|
|
driver: local
|
|
|
|
driver_options:
|
|
|
|
type: cifs
|
2021-07-13 21:17:02 +00:00
|
|
|
o: "username={{ cifs_username }},password={{ cifs_password }},domain=bessems.eu,file_mode=0777,dir_mode=0777,iocharset=utf8"
|
2021-07-13 20:04:25 +00:00
|
|
|
device: "//192.168.11.225/{{ item.path }}"
|
|
|
|
loop:
|
|
|
|
- name: cifs_photos
|
|
|
|
path: Public/Foto's
|
|
|
|
- name: cifs_videos-series
|
|
|
|
path: Public/Video's/Series
|
|
|
|
- name: cifs_videos-films
|
|
|
|
path: Public/Video's/Films
|
|
|
|
- name: cifs_songs
|
|
|
|
path: Public/Audio/DeSchakel
|
|
|
|
|
|
|
|
- name: Start Plex container
|
|
|
|
community.docker.docker_container:
|
|
|
|
name: Plex
|
|
|
|
image: linuxserver/plex
|
|
|
|
network_mode: host
|
|
|
|
env:
|
|
|
|
VERSION: latest
|
2021-07-14 11:50:21 +00:00
|
|
|
# PLEX_CLAIM: <expired>
|
2021-07-13 20:04:25 +00:00
|
|
|
volumes:
|
|
|
|
- /root/containers/pvr/plex/config:/config
|
|
|
|
- cifs_photos:/data/photos
|
2021-07-13 21:17:02 +00:00
|
|
|
- cifs_videos-films:/data/movies
|
|
|
|
- cifs_videos-series:/data/series
|
2021-07-14 11:35:17 +00:00
|
|
|
- cifs_songs:/data/songs
|
2021-07-14 13:04:00 +00:00
|
|
|
state: started
|
2021-08-19 08:19:47 +00:00
|
|
|
restart_policy: unless-stopped
|
2021-07-14 13:04:00 +00:00
|
|
|
recreate: yes
|
|
|
|
keep_volumes: no
|