Skip to content

Commit

Permalink
Merge pull request #18 from Diesel-Net/development
Browse files Browse the repository at this point in the history
Networking Improvements
  • Loading branch information
tomdaley92 authored Mar 13, 2022
2 parents 0630cc7 + 04649de commit b8cff98
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 28 deletions.
6 changes: 3 additions & 3 deletions .ansible/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
- name: allow ports through firewall on host
ufw:
rule: allow
port: "{{ port['host'] }}"
proto: "{{ port['proto'] }}"
port: "{{ item['port'] }}"
proto: "{{ item['proto'] }}"
become: yes
loop: "{{ plex_ports }}"
loop_control:
loop_var: port
loop_var: item

- name: reload firewall and enable at boot
ufw:
Expand Down
30 changes: 10 additions & 20 deletions .ansible/group_vars/all/plex.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,25 @@
plex_web_port: 32400

plex_ports:
- host: "{{ plex_web_port }}"
docker: 32400
- port: "{{ plex_web_port }}"
proto: tcp
- host: 1900
docker: 1900
- port: 1900
proto: udp
- host: 3005
docker: 3005
- port: 3005
proto: tcp
- host: 5353
docker: 5353
- port: 5353
proto: udp
- host: 8324
docker: 8324
- port: 8324
proto: tcp
- host: 32410
docker: 32410
- port: 32410
proto: udp
- host: 32412
docker: 32412
- port: 32412
proto: udp
- host: 32413
docker: 32413
- port: 32413
proto: udp
- host: 32414
docker: 32414
- port: 32414
proto: udp
- host: 32469
docker: 32469
- port: 32469
proto: tcp

plex_user_id: "{{ ansible_user_uid }}"
Expand Down
2 changes: 1 addition & 1 deletion .ansible/inventories/production/hosts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ all:

plex:
hosts:
gpu.diesel.net:
quadro.diesel.net:

vars:
ansible_user: automation
Expand Down
11 changes: 7 additions & 4 deletions .ansible/templates/docker-compose.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ services:
media-server:
image: plexinc/pms-docker:public
hostname: {{ plex_host }}
ports:
{% for port in plex_ports %}
- {{ port['host'] }}:{{ port['docker'] }}/{{ port['proto'] }}
{% endfor %}
environment:
- PLEX_UID={{ plex_user_id }}
- PLEX_GID={{ plex_group_id }}
Expand All @@ -20,6 +16,8 @@ services:
- {{ config_dir }}:/config
- {{ data_dir }}:/transcode
- nas-media:/data:ro
networks:
hostnet: {}

volumes:
nas-media:
Expand All @@ -30,3 +28,8 @@ volumes:
type: nfs
o: addr={{ nfs_host }},ro,nfsvers=4,async
device: :{{ nfs_path }}

networks:
hostnet:
external: true
name: host

0 comments on commit b8cff98

Please sign in to comment.