Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Add Valheim server #697

Merged
merged 5 commits into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ If you have a spare domain name you can configure applications to be accessible
* [Transmission](https://transmissionbt.com/) - BitTorrent client (with OpenVPN if you have a supported VPN provider)
* [Ubooquity](http://vaemendis.net/ubooquity/) - Book and comic server
* [uTorrent](https://www.utorrent.com/) - The best torrent downloading app for beginners
* [Virtual Desktop](https://github.com/RattyDAVE/docker-ubuntu-xrdp-mate-custom) - A virtual desktop running on your NAS.
* [Valheim Server](https://github.com/mbround18/valheim-docker) - Valheim dedicated gameserver manager.
anarion80 marked this conversation as resolved.
Show resolved Hide resolved
* [Virtual Desktop](https://github.com/RattyDAVE/docker-ubuntu-xrdp-mate-custom) - A virtual desktop running on your NAS.
* [Wallabag](https://wallabag.org/) - Save and classify articles. Read them later.
* [Watchtower](https://github.com/v2tec/watchtower) - Monitor your Docker containers and update them if a new version is available
* [Wireshark](https://www.wireshark.org/) - the world’s foremost and widely-used network protocol analyzer.
Expand Down
38 changes: 36 additions & 2 deletions roles/valheim/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ valheim_enabled: false
valheim_available_externally: false

# directories
valheim_home: "{{ docker_home }}/valheim"
valheim_data_directory: "{{ valheim_home }}/valheim"
valheim_data_directory: "{{ docker_home }}/valheim"

# network
valheim_port_a: "2456"
Expand Down Expand Up @@ -52,3 +51,38 @@ valheim_mods: ""
valheim_additional_steamcmd_args: ""
valheim_scheduled_restart: "0"
valheim_scheduled_restart_schedule: "0 2 * * *"

valheim_env:
PUID: "{{ valheim_user_id }}"
PGID: "{{ valheim_group_id }}"
PORT: "{{ valheim_port_a }}"
NAME: "{{ valheim_name }}"
WORLD: "{{ valheim_world }}"
PASSWORD: "{{ valheim_password }}"
TZ: "{{ ansible_nas_timezone }}"
PUBLIC: "{{ valheim_public }}"
AUTO_UPDATE: "{{ valheim_auto_update }}"
AUTO_UPDATE_PAUSE_WITH_PLAYERS: "{{ valheim_auto_update_pause_with_players }}"
AUTO_UPDATE_SCHEDULE: "{{ valheim_auto_update_schedule }}"
AUTO_BACKUP: "{{ valheim_auto_backup }}"
AUTO_BACKUP_SCHEDULE: "{{ valheim_auto_backup_schedule }}"
AUTO_BACKUP_NICE_LEVEL: "{{ valheim_auto_backup_nice_level }}"
AUTO_BACKUP_REMOVE_OLD: "{{ valheim_auto_backup_remove_old }}"
AUTO_BACKUP_DAYS_TO_LIVE: "{{ valheim_auto_backup_days_to_live }}"
AUTO_BACKUP_ON_UPDATE: "{{ valheim_auto_backup_on_update }}"
AUTO_BACKUP_ON_SHUTDOWN: "{{ valheim_auto_backup_on_shutdown }}"
AUTO_BACKUP_PAUSE_WITH_NO_PLAYERS: "{{ valheim_auto_backup_pause_with_no_players }}"
UPDATE_ON_STARTUP: "{{ valheim_update_on_startup }}"
ENABLE_CROSSPLAY: "{{ valheim_enable_crossplay }}"
TYPE: "{{ valheim_type }}"
SCHEDULED_RESTART: "{{ valheim_scheduled_restart }}"
SCHEDULED_RESTART_SCHEDULE: "{{ valheim_scheduled_restart_schedule }}"

# valheim_optional_env:
anarion80 marked this conversation as resolved.
Show resolved Hide resolved
# WEBHOOK_URL: "{{ valheim_webhook_url }}"
# WEBHOOK_INCLUDE_PUBLIC_IP: "{{ valheim_webhook_include_public_ip }}"
# PRESET: "{{ valheim_preset }}"
# MODIFIERS: "{{ valheim_modifiers }}"
# SET_KEY: "{{ valheim_set_key }}"
# MODS: "{{ valheim_mods }}"
# ADDITIONAL_STEAMCMD_ARGS: "{{ valheim_additional_steamcmd_args }}"
2 changes: 1 addition & 1 deletion roles/valheim/molecule/default/verify_stopped.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
state: absent
register: result

- name: Check if joomla is stopped
- name: Check if Valheim is stopped
ansible.builtin.assert:
that:
- not result.changed
39 changes: 4 additions & 35 deletions roles/valheim/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,48 +25,17 @@
- "{{ valheim_port_a }}:2456/udp"
- "{{ valheim_port_b }}:2457/udp"
- "{{ valheim_port_c }}:2458/udp"
env:
PUID: "{{ valheim_user_id }}"
PGID: "{{ valheim_group_id }}"
PORT: "{{ valheim_port_a }}"
NAME: "{{ valheim_name }}"
WORLD: "{{ valheim_world }}"
PASSWORD: "{{ valheim_password }}"
TZ: "{{ ansible_nas_timezone }}"
PUBLIC: "{{ valheim_public }}"
AUTO_UPDATE: "{{ valheim_auto_update }}"
AUTO_UPDATE_PAUSE_WITH_PLAYERS: "{{ valheim_auto_update_pause_with_players }}"
AUTO_UPDATE_SCHEDULE: "{{ valheim_auto_update_schedule }}"
AUTO_BACKUP: "{{ valheim_auto_backup }}"
AUTO_BACKUP_SCHEDULE: "{{ valheim_auto_backup_schedule }}"
AUTO_BACKUP_NICE_LEVEL: "{{ valheim_auto_backup_nice_level }}"
AUTO_BACKUP_REMOVE_OLD: "{{ valheim_auto_backup_remove_old }}"
AUTO_BACKUP_DAYS_TO_LIVE: "{{ valheim_auto_backup_days_to_live }}"
AUTO_BACKUP_ON_UPDATE: "{{ valheim_auto_backup_on_update }}"
AUTO_BACKUP_ON_SHUTDOWN: "{{ valheim_auto_backup_on_shutdown }}"
AUTO_BACKUP_PAUSE_WITH_NO_PLAYERS: "{{ valheim_auto_backup_pause_with_no_players }}"
# WEBHOOK_URL: "{{ valheim_webhook_url }}"
WEBHOOK_INCLUDE_PUBLIC_IP: "{{ valheim_webhook_include_public_ip }}"
UPDATE_ON_STARTUP: "{{ valheim_update_on_startup }}"
ENABLE_CROSSPLAY: "{{ valheim_enable_crossplay }}"
TYPE: "{{ valheim_type }}"
# PRESET: "{{ valheim_preset }}"
# MODIFIERS: "{{ valheim_modifiers }}"
# SET_KEY: "{{ valheim_set_key }}"
# MODS: "{{ valheim_mods }}"
# ADDITIONAL_STEAMCMD_ARGS: "{{ valheim_additional_steamcmd_args }}"
SCHEDULED_RESTART: "{{ valheim_scheduled_restart }}"
SCHEDULED_RESTART_SCHEDULE: "{{ valheim_scheduled_restart_schedule }}"
env: "{{ valheim_optional_env | default({}) | combine(valheim_env) }}"
restart_policy: unless-stopped
memory: "{{ valheim_memory }}"
capabilities:
- SYS_NICE
labels:
traefik.enable: "{{ valheim_available_externally | string }}"
traefik.http.routers.valheim.rule: "Host(`{{ valheim_hostname }}.{{ ansible_nas_domain }}`)"
# traefik.http.routers.valheim.tls.certresolver: "letsencrypt"
# traefik.http.routers.valheim.tls.domains[0].main: "{{ ansible_nas_domain }}"
# traefik.http.routers.valheim.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
traefik.http.routers.valheim.tls.certresolver: "letsencrypt"
traefik.http.routers.valheim.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.valheim.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
traefik.http.services.valheim.loadbalancer.server.port: "2456"
when: valheim_enabled is true

Expand Down
2 changes: 2 additions & 0 deletions website/docs/applications/gaming/valheim.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Valheim Docker powered by Odin. The Valheim dedicated gameserver manager which i

Set `valheim_enabled: true` in your `inventories/<your_inventory>/group_vars/nas.yml` file.

Set `valheim_optional_env` to a list of environment variables you need for the server. You can use many `valheim_*` variables alredy defined as defaults.

Valheim server will be available at [http://ansible_nas_host_or_ip:2456](http://ansible_nas_host_or_ip:2456) address.

Refer to [Valheim-docker documentation](https://github.com/mbround18/valheim-docker) for further details on how to manage the Valheim servers.
Loading