Skip to content

Commit

Permalink
Split into two machines
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbovbel committed Nov 14, 2024
1 parent f3bd989 commit c9bb163
Show file tree
Hide file tree
Showing 12 changed files with 66 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ansible-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
matrix:
target:
- media.bovbel.com
# - home.bovbel.com
- franklin.bovbel.com

steps:
- name: Cancel Previous Runs
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ To deploy on the current machine:

To deploy homelab:

`./venv/bin/ansible-playbook -i inventory/bovbel playbooks/lab.yaml`
`./venv/bin/ansible-playbook -i inventory/vedell playbooks/lab.yaml`
`./venv/bin/ansible-playbook -i inventory/bovbel playbooks/lab.yaml --limit media.bovbel.com`
`./venv/bin/ansible-playbook -i inventory/bovbel playbooks/lab.yaml --limit franklin.bovbel.com`
12 changes: 12 additions & 0 deletions TODO
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# dev deploy

Remove gnome keybinds, conflict with vscode:

gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-down "['']"
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-up "['']"
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-down "['']"
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-up "['']"

Maybe disable workspaces entirely too?

Vscode trim newlines and whitespace
13 changes: 13 additions & 0 deletions inventory/bovbel/group_vars/server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,16 @@ mam_id: !vault |
66343838343435643833636265643866626537383366663334393262666665303435363837623563
33633934306466616430386439306462373634376230363630323865303063336265623232383064
626634366536346239323534306632623261
caddy_extras:
users:
- email: [email protected]
roles: ['admin', 'share']
- email: [email protected]
roles: ['admin', 'share']
- email: [email protected]
roles: ['share']
- email: [email protected]
roles: ['share']
- email: [email protected]
roles: ['share']
8 changes: 8 additions & 0 deletions inventory/bovbel/host_vars/franklin.bovbel.com.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
# Useful paths
data_folder: "/home/{{ ansible_user }}"
app_folder: "{{ data_folder }}/app"
backup_folder: "{{ data_folder }}/backup"
share_folder: "{{ data_folder }}/share"


2 changes: 2 additions & 0 deletions inventory/bovbel/host_vars/media.bovbel.com.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ docker_extras:
x-systemd-requires: ['storage.mount']
jackett:
x-systemd-requires: ['storage.mount']
syncthing:
x-systemd-requires: ['storage.mount']

# upnp_forwards_extras:
# enshrouded1: {from: 15636, to: 15636, proto: tcp}
Expand Down
10 changes: 7 additions & 3 deletions inventory/bovbel/hosts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@
all:
children:
server:
hosts:
# home.bovbel.com:
media.bovbel.com:
children:
media_server:
hosts:
media.bovbel.com:
home_server:
hosts:
franklin.bovbel.com:
dell_xps:
hosts:
pbovbel-dell:
6 changes: 3 additions & 3 deletions library/tailscale/tailscale.bash
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
{
if command -v tailscale &> /dev/null; then
tailscale status --json | jq -cM '{ansible_facts: {tailscale: .} }'
} || {
else
echo '{ "ansible_facts": {} }'
}
fi
15 changes: 12 additions & 3 deletions playbooks/lab.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@
---
- hosts: server
- hosts: media_server
roles:
- base
- aws-ddns
- cockpit
- caddy
- homeassistant
- sync
- upnp
- media-server

- hosts: home_server
roles:
- base
- aws-ddns
- cockpit
- caddy
- homeassistant
- sync
- upnp
- miyoo-backup

- hosts:
- server
- all
tasks:
- name: update all remaining packages
apt:
Expand Down
6 changes: 3 additions & 3 deletions roles/base/defaults/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ sshd_config:
UsePAM: 'yes'
X11Forwarding: 'no'

# Disable port forwards. SSH should work over tailscale or LAN.
upnp_forwards_base: {}
# ssh: {from: 22, to: 22, proto: tcp}
# TODO(pbovbel) Disable port forwards. SSH should work over tailscale or LAN?
upnp_forwards_base:
ssh: {from: 22, to: 22, proto: tcp}

grafana_password: !vault |
$ANSIBLE_VAULT;1.1;AES256
Expand Down
3 changes: 3 additions & 0 deletions roles/docker/defaults/main.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
docker: {}
docker_extras: {}

docker_no_log: true

Expand Down Expand Up @@ -27,6 +28,8 @@ docker_defaults:
volumes:
- /var/run/docker.sock:/var/run/docker.sock
restart: "no"
environment:
WATCHTOWER_CLEANUP: "true"

docker_systemd_dir: /etc/docker/systemd

Expand Down
2 changes: 0 additions & 2 deletions roles/sync/defaults/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ docker_sync:
PUID: "{{ ansible_user_uid }}"
PGID: "{{ ansible_user_gid }}"
TZ: America/Toronto
x-systemd-requires:
- storage.mount

caddy_sync:
endpoints:
Expand Down

0 comments on commit c9bb163

Please sign in to comment.