Compare commits

..

15 Commits

Author SHA1 Message Date
f87ce122b4 Change device path
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-09 20:50:29 +02:00
60cf28ad91 Remove photo folder
All checks were successful
continuous-integration/drone/push Build is passing
2023-01-14 16:54:54 +01:00
2b9ef8e5ba Remove audio folder
All checks were successful
continuous-integration/drone/push Build is passing
2023-01-13 20:38:06 +01:00
600f15ad0d Disable SSH host key checking
All checks were successful
continuous-integration/drone/push Build is passing
2022-10-15 17:47:55 +02:00
257ecc6890 Override /dev/dri mapping
All checks were successful
continuous-integration/drone/push Build is passing
2022-04-12 18:10:25 +02:00
1b2150abe2 Add devicemapping for Intel QuickSink
All checks were successful
continuous-integration/drone/push Build is passing
2022-04-12 17:10:51 +02:00
51b708a5cd Add apt upgrade w/ reboot
All checks were successful
continuous-integration/drone/push Build is passing
2022-04-12 14:13:36 +02:00
c2601b10f1 Add restart_policy
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone Build is passing
2021-08-19 10:19:47 +02:00
20108076a0 Fix typo
All checks were successful
continuous-integration/drone/push Build is passing
2021-07-14 15:30:48 +02:00
c339ca0fd2 Add cleanup logic
Some checks failed
continuous-integration/drone/push Build is failing
2021-07-14 15:29:25 +02:00
c3ab086a5c Explicitly recreate container
All checks were successful
continuous-integration/drone/push Build is passing
2021-07-14 15:04:00 +02:00
55f9e0f830 Remove share/library;Remove claimtoken
All checks were successful
continuous-integration/drone/push Build is passing
2021-07-14 13:50:21 +02:00
86cb38d76b Add plex claim token
All checks were successful
continuous-integration/drone/push Build is passing
2021-07-14 13:40:44 +02:00
dc67891278 Add extra shares/libraries
All checks were successful
continuous-integration/drone/push Build is passing
2021-07-14 13:35:17 +02:00
1fb2d375c0 Remove debugging 2021-07-14 09:28:49 +02:00
5 changed files with 57 additions and 36 deletions

View File

@@ -17,6 +17,7 @@ steps:
--extra-vars "cifs_username=$${cifs_username} cifs_password=$${cifs_password}" \ --extra-vars "cifs_username=$${cifs_username} cifs_password=$${cifs_password}" \
playbook.yml playbook.yml
environment: environment:
ANSIBLE_HOST_KEY_CHECKING: false
cifs_username: cifs_username:
from_secret: cifs_username from_secret: cifs_username
cifs_password: cifs_password:

View File

@@ -3,5 +3,6 @@
remote_user: root remote_user: root
gather_facts: false gather_facts: false
roles: roles:
- common
- dockerhost - dockerhost
- mediaserver - mediaserver

View File

@@ -0,0 +1,20 @@
- name: Upgrade all packages
ansible.builtin.apt:
name: "*"
state: latest
update_cache: yes
- name: Check if a reboot is needed
ansible.builtin.stat:
path: /var/run/reboot-required
get_checksum: no
register: rebootrequired
- name: Trigger reboot
ansible.builtin.reboot:
msg: "Reboot initiated by Ansible due to kernel updates"
reboot_timeout: 300
pre_reboot_delay: 0
post_reboot_delay: 30
test_command: uptime
when: rebootrequired.stat.exists

View File

@@ -1,5 +1,5 @@
- name: Remove undesired packages - name: Remove undesired packages
apt: ansible.builtin.apt:
name: name:
- containerd - containerd
- docker - docker
@@ -12,7 +12,7 @@
purge: yes purge: yes
- name: Install prereqs for custom apt repository over https - name: Install prereqs for custom apt repository over https
apt: ansible.builtin.apt:
update_cache: yes update_cache: yes
name: name:
- apt-transport-https - apt-transport-https
@@ -23,39 +23,22 @@
state: present state: present
- name: Add Docker repo key - name: Add Docker repo key
apt_key: ansible.builtin.apt_key:
url: https://download.docker.com/linux/ubuntu/gpg url: https://download.docker.com/linux/ubuntu/gpg
id: 9DC858229FC7DD38854AE2D88D81803C0EBFCD88 id: 9DC858229FC7DD38854AE2D88D81803C0EBFCD88
state: present state: present
- name: Determine Ubuntu distribution name - name: Determine Ubuntu distribution name
command: lsb_release -cs ansible.builtin.command: lsb_release -cs
register: releasename register: releasename
- name: Add Docker apt repository - name: Add Docker apt repository
apt_repository: ansible.builtin.apt_repository:
repo: deb [arch=amd64] https://download.docker.com/linux/ubuntu {{ releasename.stdout }} stable repo: deb [arch=amd64] https://download.docker.com/linux/ubuntu {{ releasename.stdout }} stable
state: present state: present
# # Pinning versions due to odd DNS issue in 20.x
# - name: Pin Docker engine to specific version
# copy:
# dest: "{{ item.dest }}"
# content: "{{ item.content }}"
# with_items:
# - dest: /etc/apt/preferences.d/docker-ce
# content: |
# Package: docker-ce
# Pin: version 5:19.03.13~3-0~ubuntu-focal
# Pin-Priority: 1001
# - dest: /etc/apt/preferences.d/docker-ce-cli
# content: |
# Package: docker-ce-cli
# Pin: version 5:19.03.13~3-0~ubuntu-focal
# Pin-Priority: 1001
- name: Install Docker engine - name: Install Docker engine
apt: ansible.builtin.apt:
update_cache: yes update_cache: yes
allow_unauthenticated: yes allow_unauthenticated: yes
name: name:
@@ -70,12 +53,12 @@
state: latest state: latest
- name: Install Docker Compose - name: Install Docker Compose
get_url: ansible.builtin.get_url:
url: https://github.com/docker/compose/releases/download/1.27.4/docker-compose-Linux-x86_64 url: https://github.com/docker/compose/releases/download/1.27.4/docker-compose-Linux-x86_64
dest: /usr/local/bin/docker-compose dest: /usr/local/bin/docker-compose
mode: '0755' mode: '0755'
- name: Add Docker Compose to path - name: Add Docker Compose to path
command: ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose ansible.builtin.command: ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
args: args:
creates: /usr/bin/docker-compose creates: /usr/bin/docker-compose

View File

@@ -1,3 +1,20 @@
- 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 - name: Create Docker volumes
community.docker.docker_volume: community.docker.docker_volume:
name: "{{ item.name }}" name: "{{ item.name }}"
@@ -7,16 +24,10 @@
o: "username={{ cifs_username }},password={{ cifs_password }},domain=bessems.eu,file_mode=0777,dir_mode=0777,iocharset=utf8" 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 }}" device: "//192.168.11.225/{{ item.path }}"
loop: loop:
- name: cifs_books
path: Public/Boeken
- name: cifs_photos
path: Public/Foto's
- name: cifs_videos-series - name: cifs_videos-series
path: Public/Video's/Series path: Public/Video's/Series
- name: cifs_videos-films - name: cifs_videos-films
path: Public/Video's/Films path: Public/Video's/Films
- name: cifs_songs
path: Public/Audio/DeSchakel
- name: Start Plex container - name: Start Plex container
community.docker.docker_container: community.docker.docker_container:
@@ -25,12 +36,17 @@
network_mode: host network_mode: host
env: env:
VERSION: latest VERSION: latest
# PLEX_CLAIM: <expired>
devices:
# - /dev/dri/card1:/dev/dri/card0
# - /dev/dri/renderD129:/dev/dri/renderD128
- /dev/dri/card0:/dev/dri/card0
- /dev/dri/renderD128:/dev/dri/renderD128
volumes: volumes:
- /root/containers/pvr/plex/config:/config - /root/containers/pvr/plex/config:/config
- cifs_photos:/data/photos
- cifs_videos-films:/data/movies - cifs_videos-films:/data/movies
- cifs_videos-series:/data/series - cifs_videos-series:/data/series
register: output state: started
restart_policy: unless-stopped
- ansible.builtin.debug: recreate: yes
var: output keep_volumes: no