- name: Get current running containers community.docker.docker_host_info: containers: yes register: docker_info - name: Stop/Remove all current containers community.docker.docker_container: 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 - name: Create Docker volumes community.docker.docker_volume: name: "{{ item.name }}" driver: local driver_options: type: cifs o: "username={{ cifs_username }},password={{ cifs_password }},domain=bessems.eu,file_mode=0777,dir_mode=0777,iocharset=utf8" 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 # PLEX_CLAIM: volumes: - /root/containers/pvr/plex/config:/config - cifs_photos:/data/photos - cifs_videos-films:/data/movies - cifs_videos-series:/data/series - cifs_songs:/data/songs state: started restart_policy: unless-stopped recreate: yes keep_volumes: no