-
Notifications
You must be signed in to change notification settings - Fork 0
/
media-server.yml
92 lines (82 loc) · 2.2 KB
/
media-server.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
---
- name: Configure Media Server
hosts: media-server
vars_files:
- host_vars/media-server/secrets.yml
tasks:
- name: 'Update apt cache'
become: true
apt:
update_cache: true
- name: 'Upgrade packages'
become: true
apt:
upgrade: safe
autoremove: yes
- name: 'Install apt packages'
become: true
apt:
package:
- curl
- openssh-server
- screen
- fish
- neovim
- htop
- iotop
- ffmpeg
- nfs-kernel-server
- bat
- tree
- unzip
- nfs-common
- autofs
- mediainfo
- name: 'Add media drive to fstab'
become: true
blockinfile:
path: /etc/fstab
block: |
UUID=de1c2ba1-fb26-465f-8bd4-605474532e62 /media ext4 defaults,nofail 0 0
marker: "# {mark} ANSIBLE MANAGED BLOCK"
- name: 'Create local code directory'
file:
path: ~/code
state: directory
- name: 'Copy auto-editor docker files to server'
copy:
src: configs/media-server/auto-editor-docker/
dest: ~/code/auto-editor-docker/
- name: 'Copy audiobookshelf compose file to server'
copy:
src: configs/media-server/audiobookshelf/
dest: ~/code/audiobookshelf/
- name: 'copy nfs exports config'
become: true
copy:
src: configs/media-server/nfs-exports
dest: /etc/exports
notify:
- Restart NFS service
# MANUAL: set up jellyfin with curl https://repo.jellyfin.org/install-debuntu.sh | sudo bash
roles:
- role: generate_ssh_key
- role: geerlingguy.docker
become: true
vars:
docker_install_compose_plugin: true
docker_compose_package: docker-compose-plugin
docker_compoes_package_state: present
docker_users:
- "{{ user }}"
- role: install_powershell_arm64linux
- role: configure_nfs_client
become: true
vars:
autofs_mounts_file: configs/media-server/auto.nfs
handlers:
- name: Restart NFS service
become: true
service:
name: nfs-kernel-server
state: restarted