Skip to content

Commit

Permalink
Merge pull request #284 from mother-of-all-self-hosting/notfellchen_c…
Browse files Browse the repository at this point in the history
…elery

Add celery to notfellchen, bump role version
  • Loading branch information
moan0s authored Oct 10, 2024
2 parents bc4f9eb + e061f4f commit 5a7cc0a
Show file tree
Hide file tree
Showing 3 changed files with 144 additions and 1 deletion.
139 changes: 139 additions & 0 deletions docs/services/notfellchen.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,145 @@ notfellchen_hostname: notfellchen.example.com
########################################################################
```

### KeyDB

As described on the [KeyDB](keydb.md) documentation page, if you're hosting additional services which require KeyDB on the same server, you'd better go for installing a separate KeyDB instance for each service. See [Creating a KeyDB instance dedicated to notfellchen](#creating-a-keydb-instance-dedicated-to-notfellchen).

If you're only running notfellchen on this server and don't need to use KeyDB for anything else, you can [use a single KeyDB instance](#using-the-shared-keydb-instance-for-notfellchen).

#### Using the shared KeyDB instance for notfellchen

To install a single (non-dedicated) KeyDB instance (`mash-keydb`) and hook notfellchen to it, add the following **additional** configuration:

```yaml
########################################################################
# #
# keydb #
# #
########################################################################

keydb_enabled: true

########################################################################
# #
# /keydb #
# #
########################################################################


########################################################################
# #
# notfellchen #
# #
########################################################################

# Base configuration as shown above

# Point notfellchen to the shared KeyDB instance
notfellchen_config_redis_hostname: "{{ keydb_identifier }}"

# Make sure the notfellchen API service (mash-notfellchen.service) starts after the shared KeyDB service
notfellchen_api_systemd_required_services_list_custom:
- "{{ keydb_identifier }}.service"

# Make sure the notfellchen API service (mash-notfellchen.service) is connected to the container network of the shared KeyDB service
notfellchen_container_additional_networks_custom:
- "{{ keydb_container_network }}"

########################################################################
# #
# /notfellchen #
# #
########################################################################
```

This will create a `mash-keydb` KeyDB instance on this host.

This is only recommended if you won't be installing other services which require KeyDB. Alternatively, go for [Creating a KeyDB instance dedicated to notfellchen](#creating-a-keydb-instance-dedicated-to-notfellchen).


#### Creating a KeyDB instance dedicated to notfellchen

The following instructions are based on the [Running multiple instances of the same service on the same host](../running-multiple-instances.md) documentation.

Adjust your `inventory/hosts` file as described in [Re-do your inventory to add supplementary hosts](../running-multiple-instances.md#re-do-your-inventory-to-add-supplementary-hosts), adding a new supplementary host (e.g. if `notfellchen.example.com` is your main one, create `notfellchen.example.com-deps`).

Then, create a new `vars.yml` file for the

`inventory/host_vars/notfellchen.example.com-deps/vars.yml`:

```yaml
---

########################################################################
# #
# Playbook #
# #
########################################################################

# Put a strong secret below, generated with `pwgen -s 64 1` or in another way
# Various other secrets will be derived from this secret automatically.
mash_playbook_generic_secret_key: ''

# Override service names and directory path prefixes
mash_playbook_service_identifier_prefix: 'mash-notfellchen-'
mash_playbook_service_base_directory_name_prefix: 'notfellchen-'

########################################################################
# #
# /Playbook #
# #
########################################################################


########################################################################
# #
# keydb #
# #
########################################################################

keydb_enabled: true

########################################################################
# #
# /keydb #
# #
########################################################################
```

This will create a `mash-notfellchen-keydb` instance on this host with its data in `/mash/notfellchen-keydb`.

Then, adjust your main inventory host's variables file (`inventory/host_vars/notfellchen.example.com/vars.yml`) like this:

```yaml
########################################################################
# #
# notfellchen #
# #
########################################################################

# Base configuration as shown above

# Point notfellchen to its dedicated KeyDB instance
notfellchen_config_redis_hostname: mash-notfellchen-keydb

# Make sure the notfellchen ervice (mash-notfellchen.service) starts after its dedicated KeyDB service
notfellchen_systemd_required_services_list_custom:
- "mash-notfellchen-keydb.service"

# Make sure the notfellchen service (mash-notfellchen.service) is connected to the container network of its dedicated KeyDB service
notfellchen_api_container_additional_networks_custom:
- "mash-notfellchen-keydb"

########################################################################
# #
# /notfellchen #
# #
########################################################################
```



## Setting up the first user

You need to create a first user (unless you import an existing database).
Expand Down
4 changes: 4 additions & 0 deletions templates/group_vars_mash_servers
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,10 @@ mash_playbook_devture_systemd_service_manager_services_list_auto_itemized:
{{ ({'name': (notfellchen_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'notfellchen']} if notfellchen_enabled else omit) }}
- |-
{{ ({'name': (notfellchen_sws_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'notfellchen', 'notfellchen-sws']} if notfellchen_enabled else omit) }}
- |-
{{ ({'name': (notfellchen_celery_beat_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'notfellchen']} if notfellchen_enabled else omit) }}
- |-
{{ ({'name': (notfellchen_celery_worker_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'notfellchen']} if notfellchen_enabled else omit) }}
# /role-specific:notfellchen

# role-specific:mariadb
Expand Down
2 changes: 1 addition & 1 deletion templates/requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@
name: nextcloud
activation_prefix: nextcloud_
- src: git+https://codeberg.org/moanos/ansible-role-notfellchen.git
version: v0.1.0-3
version: v0.3.0-1
name: notfellchen
activation_prefix: notfellchen_
- src: git+https://github.com/mother-of-all-self-hosting/ansible-role-oauth2-proxy.git
Expand Down

0 comments on commit 5a7cc0a

Please sign in to comment.