Rework repo - move files around and update play

Updating repo and files to look a bit more on par with the style of
ansible I'm used to writing. Removing inventory as it can easily go
stale and the homelab env needs to be a bit more dynamic anyway. need to
find a good way to manage this but for now, no inventory is better than
outdated inv.
This commit is contained in:
Zach Wayer
2024-07-04 22:43:34 -05:00
parent 5d4f177c6b
commit 8f1c29b847
3 changed files with 53 additions and 52 deletions

View File

@@ -1,6 +1,6 @@
---
version: '3.4'
x-function: &function
x-function: &traefik-config
networks:
- traefik_proxy1
labels:
@@ -23,9 +23,8 @@ x-function: &function
# Media Server
services:
# Grabber, manage TV shows
sonarr:
<<: *function
<<: *traefik-config
image: linuxserver/sonarr:latest
container_name: sonarr
volumes:
@@ -43,7 +42,7 @@ services:
# Indexer, Used by managers to query sites for content
jackett:
<<: *function
<<: *traefik-config
image: linuxserver/jackett:latest
container_name: jackett
volumes:
@@ -58,7 +57,7 @@ services:
- "docker.group=internal"
# Reverse Proxy, Used to route applications to domain
traefik:
<<: *function
<<: *traefik-config
hostname: traefik
image: traefik:v1.7
container_name: traefik
@@ -85,7 +84,7 @@ services:
- /opt/appdata/traefik/tmp:/tmp
# Downloader, pull in content from torrents & hide traffic behind VPN
arch-deluge:
<<: *function
<<: *traefik-config
image: binhex/arch-delugevpn:latest
container_name: arch-deluge
ports:
@@ -123,9 +122,9 @@ services:
- "traefik.port=8112"
- "docker.group=external"
privileged: true
#updated version of plex requests
# User Request, auto add to searchers
ombi:
<<: *function
<<: *traefik-config
image: linuxserver/ombi
container_name: ombi
environment:
@@ -148,7 +147,7 @@ services:
- 3579:3579
# NZBGet - usenet downloader
nzbget:
<<: *function
<<: *traefik-config
image: linuxserver/nzbget:latest
container_name: nzbget
volumes:
@@ -168,7 +167,5 @@ services:
# Networks, Needed for Traefik
networks:
traefik_proxy1:
# external: true
default:
driver: bridge

View File

@@ -1,6 +0,0 @@
---
all:
hosts:
tower:
ansible_host: 192.168.0.62
vars:

View File

@@ -1,11 +1,15 @@
- hosts: all
---
- name: Install and setup Server for media acqusition
hosts: all
become: true
become_user: root
vars:
pip_install_packages:
- name: Docker
nfs_host: 192.168.0.109
nfs_options: "auto,nofail,noatime,nolock,intr,tcp,actimeo=1800"
nfs_options:
"auto,nofail,noatime,nolock,intr,tcp,actimeo=1800,x-systemd.automount"
nfs_mounts:
- remote_path: /export/Movies
local_path: /mnt/storage/movies
@@ -18,7 +22,7 @@
- geerlingguy.pip
- geerlingguy.docker
tasks:
- name: Install docker tools
- name: Install system packages
ansible.builtin.package:
name: "{{ item }}"
state: present
@@ -54,24 +58,30 @@
shell: "{{ item.shell }}"
groups: "{{ item.groups }}"
loop:
- { user: "zware", shell: "/bin/zsh", groups: "sudo,docker" }
- { user: "dockeruser", shell: "/bin/bash", groups: "docker" }
- {user: "dockeruser",
shell: "/bin/bash",
groups: "docker"}
# zware user should already exist when this is run,
# most likely needs ot happen in a cloud init step
# - {user: "zware",
# shell: "/bin/zsh",
# groups: "sudo,docker"}
- name: Copy docker-compose
ansible.builtin.copy:
src: docker-compose.yml
dest: /opt/docker-compose.yml
owner: root
group: root
mode: "0644"
- name: Copy env file
ansible.builtin.copy:
src: environment
dest: /opt/environment
owner: zware
group: zware
mode: "0600"
src: "{{ item.src }}"
dest: "{{ item.dest }}"
owner: dockeruser
group: dockeruser
mode: "{{ item.mode }}"
backup: true
loop:
- {src: "files/docker-compose.yaml",
dest: "/opt/docker-compose.yaml",
mode: "0644"}
- {src: "files/environmnet",
dest: "/opt/.env",
mode: "0600"}
- name: Start containers
community.docker.docker_compose: