Compare commits
1 Commits
74a559f1f6
...
jellyfin
Author | SHA1 | Date | |
---|---|---|---|
ba44547066 |
@@ -4,24 +4,6 @@ base_domain: vm.krislamo.org
|
|||||||
allow_reboot: false
|
allow_reboot: false
|
||||||
manage_network: false
|
manage_network: false
|
||||||
|
|
||||||
users:
|
|
||||||
- name: jellyfin
|
|
||||||
|
|
||||||
samba:
|
|
||||||
users:
|
|
||||||
- name: jellyfin
|
|
||||||
password: jellyfin
|
|
||||||
shares:
|
|
||||||
- name: jellyfin
|
|
||||||
path: /srv/jellyfin
|
|
||||||
owner: jellyfin
|
|
||||||
group: jellyfin
|
|
||||||
valid_users: jellyfin
|
|
||||||
firewall:
|
|
||||||
- 10.0.0.0/8
|
|
||||||
- 172.16.0.0/12
|
|
||||||
- 192.168.0.0/16
|
|
||||||
|
|
||||||
# proxy
|
# proxy
|
||||||
proxy:
|
proxy:
|
||||||
#production: true
|
#production: true
|
||||||
@@ -53,4 +35,3 @@ traefik_http_only: true # if behind reverse-proxy
|
|||||||
# jellyfin
|
# jellyfin
|
||||||
jellyfin_domain: "jellyfin.{{ base_domain }}"
|
jellyfin_domain: "jellyfin.{{ base_domain }}"
|
||||||
jellyfin_version: latest
|
jellyfin_version: latest
|
||||||
jellyfin_media: /srv/jellyfin
|
|
||||||
|
18
docker.yml
18
docker.yml
@@ -1,7 +1,21 @@
|
|||||||
|
# Copyright (C) 2020 Kris Lamoureux
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, version 3 of the License.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
- name: Install Docker Server
|
- name: Install Docker Server
|
||||||
hosts: "{{ PLAYBOOK_HOST | default('none') }}"
|
hosts: dockerhosts
|
||||||
become: true
|
become: true
|
||||||
roles:
|
roles:
|
||||||
- base
|
- base
|
||||||
- jenkins
|
|
||||||
- docker
|
- docker
|
||||||
|
- jenkins
|
||||||
|
@@ -1,9 +1,8 @@
|
|||||||
- name: Install Media Server
|
- name: Install Media Server
|
||||||
hosts: "{{ PLAYBOOK_HOST | default('none') }}"
|
hosts: mediaservers
|
||||||
become: true
|
become: true
|
||||||
roles:
|
roles:
|
||||||
- base
|
- base
|
||||||
- jenkins
|
|
||||||
- proxy
|
- proxy
|
||||||
- docker
|
- docker
|
||||||
- traefik
|
- traefik
|
||||||
|
@@ -22,9 +22,3 @@
|
|||||||
name: ddclient
|
name: ddclient
|
||||||
state: restarted
|
state: restarted
|
||||||
listen: restart_ddclient
|
listen: restart_ddclient
|
||||||
|
|
||||||
- name: Restart Samba
|
|
||||||
ansible.builtin.service:
|
|
||||||
name: smbd
|
|
||||||
state: restarted
|
|
||||||
listen: restart_samba
|
|
@@ -29,8 +29,3 @@
|
|||||||
ansible.builtin.import_tasks: wireguard.yml
|
ansible.builtin.import_tasks: wireguard.yml
|
||||||
tags: wireguard
|
tags: wireguard
|
||||||
when: wireguard is defined
|
when: wireguard is defined
|
||||||
|
|
||||||
- name: Import Samba tasks
|
|
||||||
ansible.builtin.import_tasks: samba.yml
|
|
||||||
tags: samba
|
|
||||||
when: samba is defined
|
|
||||||
|
@@ -3,18 +3,8 @@
|
|||||||
name: samba
|
name: samba
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Create nologin shell accounts for Samba
|
|
||||||
ansible.builtin.user:
|
|
||||||
name: "{{ item.name }}"
|
|
||||||
state: present
|
|
||||||
shell: /usr/sbin/nologin
|
|
||||||
createhome: false
|
|
||||||
system: yes
|
|
||||||
loop: "{{ samba.users }}"
|
|
||||||
when: item.manage_user is defined and item.manage_user is true
|
|
||||||
|
|
||||||
- name: Create Samba users
|
- name: Create Samba users
|
||||||
ansible.builtin.shell: "smbpasswd -a {{ item.name }}"
|
ansible.builtin.command: "smbpasswd -a -s {{ item.name }}"
|
||||||
args:
|
args:
|
||||||
stdin: "{{ item.password }}\n{{ item.password }}"
|
stdin: "{{ item.password }}\n{{ item.password }}"
|
||||||
loop: "{{ samba.users }}"
|
loop: "{{ samba.users }}"
|
||||||
@@ -24,8 +14,6 @@
|
|||||||
- name: Ensure share directories exist
|
- name: Ensure share directories exist
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{{ item.path }}"
|
path: "{{ item.path }}"
|
||||||
owner: "{{ item.owner }}"
|
|
||||||
group: "{{ item.group }}"
|
|
||||||
state: directory
|
state: directory
|
||||||
mode: 0755
|
mode: 0755
|
||||||
loop: "{{ samba.shares }}"
|
loop: "{{ samba.shares }}"
|
||||||
@@ -34,19 +22,4 @@
|
|||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: smb.conf.j2
|
src: smb.conf.j2
|
||||||
dest: /etc/samba/smb.conf
|
dest: /etc/samba/smb.conf
|
||||||
notify: restart_samba
|
notify: samba_restart
|
||||||
|
|
||||||
- name: Start smbd and enable on boot
|
|
||||||
ansible.builtin.service:
|
|
||||||
name: smbd
|
|
||||||
state: started
|
|
||||||
enabled: true
|
|
||||||
|
|
||||||
- name: Allow SMB connections
|
|
||||||
community.general.ufw:
|
|
||||||
rule: allow
|
|
||||||
port: 445
|
|
||||||
proto: tcp
|
|
||||||
from: "{{ item }}"
|
|
||||||
state: enabled
|
|
||||||
loop: "{{ samba.firewall }}"
|
|
||||||
|
@@ -11,23 +11,6 @@
|
|||||||
mode: 0400
|
mode: 0400
|
||||||
when: authorized_keys is defined
|
when: authorized_keys is defined
|
||||||
|
|
||||||
- name: Create system users
|
|
||||||
ansible.builtin.user:
|
|
||||||
name: "{{ item.name }}"
|
|
||||||
state: present
|
|
||||||
shell: "{{ item.shell | default('/bin/bash') }}"
|
|
||||||
create_home: "{{ item.home | default(false) }}"
|
|
||||||
loop: "{{ users }}"
|
|
||||||
when: users is defined
|
|
||||||
|
|
||||||
- name: Set authorized_keys for system users
|
|
||||||
ansible.posix.authorized_key:
|
|
||||||
user: "{{ item.key }}"
|
|
||||||
key: "{{ item.value.key }}"
|
|
||||||
state: present
|
|
||||||
loop: "{{ users }}"
|
|
||||||
when: users is defined and item.value.key is defined
|
|
||||||
|
|
||||||
- name: Manage filesystem mounts
|
- name: Manage filesystem mounts
|
||||||
ansible.posix.mount:
|
ansible.posix.mount:
|
||||||
path: "{{ item.path }}"
|
path: "{{ item.path }}"
|
||||||
|
@@ -11,7 +11,6 @@
|
|||||||
args:
|
args:
|
||||||
chdir: /etc/wireguard/
|
chdir: /etc/wireguard/
|
||||||
creates: /etc/wireguard/privatekey
|
creates: /etc/wireguard/privatekey
|
||||||
executable: /usr/bin/bash
|
|
||||||
|
|
||||||
- name: Grab WireGuard private key for configuration
|
- name: Grab WireGuard private key for configuration
|
||||||
ansible.builtin.slurp:
|
ansible.builtin.slurp:
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
jellyfin_name: jellyfin
|
jellyfin_name: jellyfin
|
||||||
|
jellyfin_volume: "{{ jellyfin_name }}"
|
||||||
jellyfin_router: "{{ jellyfin_name }}"
|
jellyfin_router: "{{ jellyfin_name }}"
|
||||||
jellyfin_rooturl: "https://{{ jellyfin_domain }}"
|
jellyfin_rooturl: "https://{{ jellyfin_domain }}"
|
||||||
jellyfin_root: "{{ docker_compose_root }}/{{ jellyfin_name }}"
|
jellyfin_root: "{{ docker_compose_root }}/{{ jellyfin_name }}"
|
||||||
|
@@ -4,6 +4,11 @@
|
|||||||
state: directory
|
state: directory
|
||||||
mode: 0500
|
mode: 0500
|
||||||
|
|
||||||
|
- name: Create jellyfin user
|
||||||
|
ansible.builtin.user:
|
||||||
|
name: jellyfin
|
||||||
|
state: present
|
||||||
|
|
||||||
- name: Get user jellyfin uid
|
- name: Get user jellyfin uid
|
||||||
ansible.builtin.getent:
|
ansible.builtin.getent:
|
||||||
database: passwd
|
database: passwd
|
||||||
|
@@ -1,8 +1,7 @@
|
|||||||
version: '3.7'
|
version: '3.7'
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
config:
|
{{ jellyfin_volume }}:
|
||||||
cache:
|
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
traefik:
|
traefik:
|
||||||
@@ -25,6 +24,6 @@ services:
|
|||||||
- "traefik.docker.network=traefik"
|
- "traefik.docker.network=traefik"
|
||||||
- "traefik.enable=true"
|
- "traefik.enable=true"
|
||||||
volumes:
|
volumes:
|
||||||
- config:/config
|
- ./config:/config
|
||||||
- cache:/cache
|
- ./cache:/cache
|
||||||
- {{ jellyfin_media }}:/media
|
- {{ jellyfin_volume }}:/media
|
||||||
|
@@ -19,14 +19,14 @@
|
|||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: nginx.conf.j2
|
src: nginx.conf.j2
|
||||||
dest: /etc/nginx/nginx.conf
|
dest: /etc/nginx/nginx.conf
|
||||||
mode: 0644
|
mode: '0644'
|
||||||
notify: reload_nginx
|
notify: reload_nginx
|
||||||
|
|
||||||
- name: Install nginx sites configuration
|
- name: Install nginx sites configuration
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: server-nginx.conf.j2
|
src: server-nginx.conf.j2
|
||||||
dest: "/etc/nginx/sites-available/{{ item.domain }}.conf"
|
dest: "/etc/nginx/sites-available/{{ item.domain }}.conf"
|
||||||
mode: 0400
|
mode: '0644'
|
||||||
loop: "{{ proxy.servers }}"
|
loop: "{{ proxy.servers }}"
|
||||||
notify: reload_nginx
|
notify: reload_nginx
|
||||||
register: nginx_sites
|
register: nginx_sites
|
||||||
|
Reference in New Issue
Block a user