Commit graph

55 commits

Author SHA1 Message Date
961e10223c
ref(system): Fix ssh authorized keys task
Fixed the loop for authorized keys. While I read previously that the
Ansible module can take keys in the array format:

```yaml
    key:
      - key1
      - key2
      - ...
```

This seems to not be the case.
Instead, we now do a 'sub-loop' through all the existing authorized_keys
entries in the data structure, running the task once for each key.

This also means we can simplify the 'when' condition to only check the
data structure itself exists, not the key since we only loop once for
each existing key anyway.

More in-depth explanation on the subelements filter here:
https://docs.ansible.com/projects/ansible/latest/playbook_guide/playbooks_filters.html#combining-objects-and-subelements

Concise explanation of use here:
https://overflow.ducks.party/questions/56086290/how-can-i-traverse-nested-lists-in-ansible

One drawback:
we can now _not_ change the key setting in the module to be exclusive
(`exclusive: true` for `authorized_keys` module). As described in the
documentation, if there are more than one key for a user, this would
lead to the following keys overwriting the first key.

Currently do not know how to fix this, but we are not supplying
exclusive keys so it is fine for the moment.
2025-11-28 18:39:33 +01:00
e0efc51c34
feat(system): Add tags to system role tasks 2025-11-28 18:39:32 +01:00
a5a6e297ff
feat(nfs): Restrict server to v4 by default
Can be changed with `nfs_v4_only=false` which defaults to true.

Information taken from: https://wiki.debian.org/NFSServerSetup
and applied directly through Ansible.

Currently _irreversible_, meaning once we set the server to v4 only
there is NO ansible-supported playbook to reset it to all NFSv2/3/4
versions.

Has to be done manually, or could be included as manually-run playbook.
2025-11-28 14:19:29 +01:00
ef1823da20
chore(arr): Pin jellyfin to updated version
Moved the jellyfin installation to 10.11.x, so now we should pin it to a
minimum of that. Also, since the 'latest' container for the linuxserver
container images is still the 10.10.7 container, we can't just use that.
So we pin the exact version for now instead.
2025-11-28 14:19:29 +01:00
7f56c80cf4
ref(arr): Pin jellyfin container version
Since jellyfin version 10.11.0 is a _massive_ upgrade, including
non-backwards compatible db migration, we pin the version for now.

See: https://jellyfin.org/posts/jellyfin-release-10.11.0/
2025-11-28 14:19:28 +01:00
9de2aaea48
feat(arr): Move arrstack container versions into vars 2025-11-28 14:19:28 +01:00
e5feb235df
feat(arr): Add fanedits directory to jellyfin media 2025-11-28 14:19:27 +01:00
40b687a3f3
feat: Create skeleton for terraform provisioning role
The terraform module does not expect its file contents (project_path) in
the 'files/' folder like the core roles, instead looking for it relative
to the _invocation_ pwd.
So, for now it just resides in the root level of the repository and may
be moved from there to wherever it is more pertinent.

Additionally, we check for the existence of the OpenTofu binary (tofu),
and prefer that if it exists. Otherwise we fall back to the Terraform
binary.
2025-11-28 14:19:26 +01:00
6e30232057
ref: Install authorized keys per user
Instead of installing authorized keys globally (same for everybody), we
pass in the authorized_keys variable per user, and thus the installation
also takes place per user.

This makes much more sense and works with minimal refactoring.
2025-11-19 22:13:11 +01:00
2fc23d9774
feat: Set up timezone and users and groups on system host 2025-11-19 22:13:10 +01:00
b493485b90
feat: Add authorized ssh keys to host 2025-11-19 22:13:09 +01:00
bb9de502ce
feat: Set up filesystems
Automatically set up btrfs root and data filesystem, as well as external
HDD.

This automation change assumes a layout exactly as in current bob to
function by default, can be changed to any btrfs layout with the
`btrfs_mounts` configuration option, however.
2025-11-19 22:13:08 +01:00
a217d65640
feat: Update incus installation role
Now uses simple external ansible galaxy role, and should install incus
from a pre-fixed seed.
2025-11-19 22:13:07 +01:00
54b8404743
fix: Move incus template files into correct role
Moved from system role where they used to be required into the
(currently disabled) incus installation role.
2025-11-19 22:13:04 +01:00
779266684d
feat: Share nfs with netbird vpn clients 2025-10-24 10:51:36 +02:00
547ab91972
feat: Add nfs server to host machines 2025-10-20 23:54:02 +02:00
2b05fc7363
fix: Remove hardcoded arrstack dir in template 2025-10-20 23:54:01 +02:00
12e48b17b7
arr: Add quadnine DNS server check to vpn 2025-10-20 23:54:01 +02:00
30f068fd7a
arr: Add bazarr to stack 2025-10-20 23:54:00 +02:00
5d69d45b97
arr: Add tdarr service 2025-10-20 23:53:59 +02:00
38ca54a027
arr: Fix created torrent directory name 2025-10-20 23:53:59 +02:00
208cecd5ef
paperless: Change script scan output dir
Still a HACK should not be hard-coded but perhaps installed as a
runnable script on localhost for the role (e.g. `scan-paperless`)
which receives its scanner more dynamically.
2025-10-20 23:53:58 +02:00
8137b68676
arr: Automatically update vpn server list 2025-10-20 23:53:55 +02:00
03316733f5
paperless: Fix compose missing quote 2025-07-21 22:19:59 +02:00
c96833988a
roles: Change main service name to app 2025-07-21 22:19:58 +02:00
4a5a0beca1
restic: Fix backup container conditionals
Change the inclusion of backup containers so they actually work. They
check that restic is enabled globally, and that restic is enabled for
the individual stack they belong to. If either of the conditions is not
met they do not deploy.

This way we can simply enable restic globally with `restic_enable` and
by default all stacks will be backed up. But if we want to exclude
specific stacks from backups we can do so with the individual
`<role>_restic_enable = False` variable.

Finally found a good version of doing so with the help of the following
medium article: https://medium.com/opsops/is-defined-in-ansible-d490945611ae
which basically makes use of default fallbacks instead.
2025-07-19 10:23:23 +02:00
84d7319465
roles: Set caddy and docker dependency chain
Each role (with outward-facing ingress needs) depends on caddy since
they depend on the availability of the 'caddy' network which is set in
that role.

Caddy in turn depends on docker.
2025-07-19 10:23:22 +02:00
6b26ba444b
restic: Only set backup hostname if we have ansible fact
For all backup containers.
2025-07-19 10:23:21 +02:00
dc9ee09360
arr: Fix homarr volume mounts 2025-07-19 10:23:17 +02:00
9a8c4ae81f
repo: Rename compose templates to compose.yaml.jinja
It is a short, concicse name for the compose (and one of the ways that
docker officially recommends to name the files), and jinja is the
careful recommendation of the jinja docs.

https://jinja.palletsprojects.com/en/stable/templates/#template-file-extension
2025-07-18 21:49:32 +02:00
968d2f9ca9
caddy: Remove whoami test container 2025-07-18 21:49:31 +02:00
9cf2ee10a0
restic: Skip repo init on backup containers
Only the initial 'main' prune container will init the repository, the
others will not attempt even if they don't find a repository.
2025-07-18 21:49:30 +02:00
412054e3cd
restic: Fix extensions to yaml 2025-07-18 21:37:12 +02:00
64b85c0c40
arr: Add restic backup 2025-07-18 21:37:10 +02:00
363ce9ae6f
arr: Remove leftover arr.yml file 2025-07-18 21:37:10 +02:00
1fd72a05a6
restic: Fix backup container local repo mounting
If our chosen backup repo is a local one, each restic container needs to
mount the local path as a volume, otherwise the data is stuck in the
container itself.
2025-07-18 21:37:09 +02:00
f1be696479
grocy: Add docker hostname to backup container 2025-07-18 21:37:08 +02:00
9cf1a5e571
grocy: Add restic backup 2025-07-18 21:37:08 +02:00
af5b647daf
grocy: Fix container service name 2025-07-18 21:37:07 +02:00
cd842ea4b5
Add hostname to restic containers
Will pass through the hostname to any snapshots set up.
The hostname is _not_ derived from the random docker container string
but instead takes the name of the _host_ on which docker is running
(from ansible facts).

The hostname in combination with the tag should point to the correct
host -> stack which is being backed up.
2025-07-18 21:37:07 +02:00
b81328d400
paperless: Add restic backups 2025-07-18 21:37:06 +02:00
e13d85990c
restic: Fix template env vars 2025-07-18 21:37:06 +02:00
fab6f5ff7c
restic: Add notification
Notifies double for each prune/check run which may need to be fixed.
Also custom notification contents cannot currently be passed.

Lastly, we should put identifying information into the notification body
(such as the hostname/container name for which the notification is
relevant).
2025-07-18 21:37:05 +02:00
003cf64a77
restic: Update docs 2025-07-18 21:37:04 +02:00
86d49a756b
restic: Add stack
Adapted from cloudserve-infrastructure, implements a backup stack using
restic. The actual backups have to be implemented by individual other
roles but this sets up initialization, pruning and checking of a repository.
2025-07-18 21:37:03 +02:00
93876315ca
repo: Rename all yml extensions to yaml 2025-07-18 21:37:03 +02:00
06940925a9
arr: Use gluetun port forward feature
Explanation here:
https://github.com/qdm12/gluetun-wiki/blob/main/setup/advanced/vpn-port-forwarding.md

Whenever we receive a new forwarded port (around once a month?) we pass
it to qbit through its API. May require the setting no auth for local
connections in qbit.

Allows to remove the complete port-manager docker container which did
not work very well.
2025-07-17 18:40:17 +02:00
2eab9d35d3
roles: Add inherited protocol for subdomains
Can be set globally ('protocol: http://') or per stack.
Defaults to empty which caddy treats as https.
2025-07-17 18:08:57 +02:00
0ce9d700b2
roles: Fix umask to be string type
Should not be integer which it will be cast to if given without quotes.
2025-07-17 18:08:56 +02:00
cd43b25553
arr: Fix remaining arrstack_data_dir variable 2025-07-17 18:08:56 +02:00