From 6ca6255523e48f3a9bc40da07e30718f8a64f117 Mon Sep 17 00:00:00 2001 From: Anarion Date: Tue, 5 Mar 2024 13:04:39 +0100 Subject: [PATCH 1/5] :sparkles: Add Valheim server --- README.md | 1 + nas.yml | 4 + roles/valheim/defaults/main.yml | 54 +++++++++++++ roles/valheim/molecule/default/molecule.yml | 6 ++ .../valheim/molecule/default/side_effect.yml | 10 +++ roles/valheim/molecule/default/verify.yml | 18 +++++ .../molecule/default/verify_stopped.yml | 18 +++++ roles/valheim/tasks/main.yml | 80 +++++++++++++++++++ website/docs/applications/gaming/valheim.md | 15 ++++ 9 files changed, 206 insertions(+) create mode 100644 roles/valheim/defaults/main.yml create mode 100644 roles/valheim/molecule/default/molecule.yml create mode 100644 roles/valheim/molecule/default/side_effect.yml create mode 100644 roles/valheim/molecule/default/verify.yml create mode 100644 roles/valheim/molecule/default/verify_stopped.yml create mode 100644 roles/valheim/tasks/main.yml create mode 100644 website/docs/applications/gaming/valheim.md diff --git a/README.md b/README.md index a3a6e7e978..5175202ac4 100644 --- a/README.md +++ b/README.md @@ -107,6 +107,7 @@ If you have a spare domain name you can configure applications to be accessible * [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. * [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. diff --git a/nas.yml b/nas.yml index adb5b191d7..1f0afb5fa3 100644 --- a/nas.yml +++ b/nas.yml @@ -414,6 +414,10 @@ tags: - utorrent + - role: valheim + tags: + - valheim + - role: virtual_desktop tags: - virtual_desktop diff --git a/roles/valheim/defaults/main.yml b/roles/valheim/defaults/main.yml new file mode 100644 index 0000000000..39d70a8f87 --- /dev/null +++ b/roles/valheim/defaults/main.yml @@ -0,0 +1,54 @@ +--- +valheim_enabled: false +valheim_available_externally: false + +# directories +valheim_home: "{{ docker_home }}/valheim" +valheim_data_directory: "{{ valheim_home }}/valheim" + +# network +valheim_port_a: "2456" +valheim_port_b: "2457" +valheim_port_c: "2458" +valheim_hostname: "valheim" + +# docker +valheim_container_name: "valheim" +valheim_image_name: "mbround18/valheim" +valheim_image_version: "latest" + +# uid/gid +valheim_user_id: "1000" +valheim_group_id: "1000" + +# specs +valheim_memory: 1g + +# valheim +valheim_name: "Created With Valheim Docker" +valheim_world: "Dedicated" +valheim_password: "Strong! Password @ Here" +valheim_public: "1" +valheim_auto_update: "1" +valheim_auto_update_pause_with_players: "0" +valheim_auto_update_schedule: "0 1 * * *" +valheim_auto_backup: "1" +valheim_auto_backup_nice_level: "19" +valheim_auto_backup_schedule: "*/15 * * * *" +valheim_auto_backup_remove_old: "1" +valheim_auto_backup_days_to_live: "3" +valheim_auto_backup_on_update: "1" +valheim_auto_backup_on_shutdown: "1" +valheim_auto_backup_pause_with_no_players: "0" +valheim_webhook_url: "https://discord.com/api/webhooks/IM_A_SNOWFLAKE/AND_I_AM_A_SECRET" +valheim_webhook_include_public_ip: "1" +valheim_update_on_startup: "0" +valheim_enable_crossplay: "0" +valheim_type: "Vanilla" +valheim_preset: "" +valheim_modifiers: "" +valheim_set_key: "" +valheim_mods: "" +valheim_additional_steamcmd_args: "" +valheim_scheduled_restart: "0" +valheim_scheduled_restart_schedule: "0 2 * * *" diff --git a/roles/valheim/molecule/default/molecule.yml b/roles/valheim/molecule/default/molecule.yml new file mode 100644 index 0000000000..3b323c1904 --- /dev/null +++ b/roles/valheim/molecule/default/molecule.yml @@ -0,0 +1,6 @@ +--- +provisioner: + inventory: + group_vars: + all: + valheim_enabled: true diff --git a/roles/valheim/molecule/default/side_effect.yml b/roles/valheim/molecule/default/side_effect.yml new file mode 100644 index 0000000000..3ec7c8146c --- /dev/null +++ b/roles/valheim/molecule/default/side_effect.yml @@ -0,0 +1,10 @@ +--- +- name: Stop + hosts: all + become: true + tasks: + - name: "Include {{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }} role" + ansible.builtin.include_role: + name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}" + vars: + valheim_enabled: false diff --git a/roles/valheim/molecule/default/verify.yml b/roles/valheim/molecule/default/verify.yml new file mode 100644 index 0000000000..3ef8768b43 --- /dev/null +++ b/roles/valheim/molecule/default/verify.yml @@ -0,0 +1,18 @@ +--- +- name: Verify + hosts: all + gather_facts: false + tasks: + - ansible.builtin.include_vars: + file: ../../defaults/main.yml + + - name: Get valheim container state + community.docker.docker_container: + name: "{{ valheim_container_name }}" + register: result + + - name: Check if valheim containers are running + ansible.builtin.assert: + that: + - result.container['State']['Status'] == "running" + - result.container['State']['Restarting'] == false diff --git a/roles/valheim/molecule/default/verify_stopped.yml b/roles/valheim/molecule/default/verify_stopped.yml new file mode 100644 index 0000000000..ea0d863223 --- /dev/null +++ b/roles/valheim/molecule/default/verify_stopped.yml @@ -0,0 +1,18 @@ +--- +- name: Verify + hosts: all + gather_facts: false + tasks: + - ansible.builtin.include_vars: + file: ../../defaults/main.yml + + - name: Try and stop and remove valheim + community.docker.docker_container: + name: "{{ valheim_container_name }}" + state: absent + register: result + + - name: Check if joomla is stopped + ansible.builtin.assert: + that: + - not result.changed diff --git a/roles/valheim/tasks/main.yml b/roles/valheim/tasks/main.yml new file mode 100644 index 0000000000..00c18ce1e6 --- /dev/null +++ b/roles/valheim/tasks/main.yml @@ -0,0 +1,80 @@ +--- +- name: Start Valheim + block: + - name: Create Valheim Directories + ansible.builtin.file: + path: "{{ item }}" + state: directory + owner: "{{ valheim_user_id }}" + group: "{{ valheim_group_id }}" + with_items: + - "{{ valheim_data_directory }}/saves" + - "{{ valheim_data_directory }}/server" + - "{{ valheim_data_directory }}/backups" + + - name: Valheim Docker Container + community.docker.docker_container: + name: "{{ valheim_container_name }}" + image: "{{ valheim_image_name }}:{{ valheim_image_version }}" + pull: true + volumes: + - "{{ valheim_data_directory }}/saves:/home/steam/.config/unity3d/IronGate/Valheim" + - "{{ valheim_data_directory }}/server:/home/steam/valheim" + - "{{ valheim_data_directory }}/backups:/home/steam/backups" + ports: + - "{{ 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 }}" + 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.services.valheim.loadbalancer.server.port: "2456" + when: valheim_enabled is true + +- name: Stop Valheim + block: + - name: Stop Valheim + community.docker.docker_container: + name: "{{ valheim_container_name }}" + state: absent + + when: valheim_enabled is false diff --git a/website/docs/applications/gaming/valheim.md b/website/docs/applications/gaming/valheim.md new file mode 100644 index 0000000000..86e1f4c1f6 --- /dev/null +++ b/website/docs/applications/gaming/valheim.md @@ -0,0 +1,15 @@ +--- +title: "Valheim Server" +--- + +Homepage: [https://github.com/mbround18/valheim-docker](https://github.com/mbround18/valheim-docker) + +Valheim Docker powered by Odin. The Valheim dedicated gameserver manager which is designed with resiliency in mind by providing automatic updates, world backup support, and a user friendly cli interface. + +## Usage + +Set `valheim_enabled: true` in your `inventories//group_vars/nas.yml` file. + +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. From df5793a41c3ca04204df749b1a15ef0b476383b4 Mon Sep 17 00:00:00 2001 From: Anarion Date: Thu, 7 Mar 2024 09:40:14 +0100 Subject: [PATCH 2/5] Address most of review comments --- README.md | 2 +- roles/valheim/defaults/main.yml | 3 +-- roles/valheim/molecule/default/verify_stopped.yml | 2 +- roles/valheim/tasks/main.yml | 6 +++--- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 5175202ac4..7705da9635 100644 --- a/README.md +++ b/README.md @@ -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. +* [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. diff --git a/roles/valheim/defaults/main.yml b/roles/valheim/defaults/main.yml index 39d70a8f87..cb18793aaf 100644 --- a/roles/valheim/defaults/main.yml +++ b/roles/valheim/defaults/main.yml @@ -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" diff --git a/roles/valheim/molecule/default/verify_stopped.yml b/roles/valheim/molecule/default/verify_stopped.yml index ea0d863223..d91481d3f7 100644 --- a/roles/valheim/molecule/default/verify_stopped.yml +++ b/roles/valheim/molecule/default/verify_stopped.yml @@ -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 diff --git a/roles/valheim/tasks/main.yml b/roles/valheim/tasks/main.yml index 00c18ce1e6..4f3dd6eccf 100644 --- a/roles/valheim/tasks/main.yml +++ b/roles/valheim/tasks/main.yml @@ -64,9 +64,9 @@ 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 From e78f36ab76b95dc80425dadf32b0138de3b26d2e Mon Sep 17 00:00:00 2001 From: Anarion Date: Thu, 7 Mar 2024 10:03:10 +0100 Subject: [PATCH 3/5] Rest of review comments --- roles/valheim/defaults/main.yml | 35 +++++++++++++++++++++ roles/valheim/tasks/main.yml | 33 +------------------ website/docs/applications/gaming/valheim.md | 2 ++ 3 files changed, 38 insertions(+), 32 deletions(-) diff --git a/roles/valheim/defaults/main.yml b/roles/valheim/defaults/main.yml index cb18793aaf..89fe77c790 100644 --- a/roles/valheim/defaults/main.yml +++ b/roles/valheim/defaults/main.yml @@ -51,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: + # 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 }}" diff --git a/roles/valheim/tasks/main.yml b/roles/valheim/tasks/main.yml index 4f3dd6eccf..08a6a03dd0 100644 --- a/roles/valheim/tasks/main.yml +++ b/roles/valheim/tasks/main.yml @@ -25,38 +25,7 @@ - "{{ 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: diff --git a/website/docs/applications/gaming/valheim.md b/website/docs/applications/gaming/valheim.md index 86e1f4c1f6..25a7176c9e 100644 --- a/website/docs/applications/gaming/valheim.md +++ b/website/docs/applications/gaming/valheim.md @@ -10,6 +10,8 @@ Valheim Docker powered by Odin. The Valheim dedicated gameserver manager which i Set `valheim_enabled: true` in your `inventories//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. From bdcec2845491c01bb0853e5634e1a1c4fb59b04d Mon Sep 17 00:00:00 2001 From: Anarion Date: Thu, 7 Mar 2024 10:06:09 +0100 Subject: [PATCH 4/5] Fix lint --- roles/valheim/defaults/main.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/roles/valheim/defaults/main.yml b/roles/valheim/defaults/main.yml index 89fe77c790..e402d3e0a2 100644 --- a/roles/valheim/defaults/main.yml +++ b/roles/valheim/defaults/main.yml @@ -79,10 +79,10 @@ valheim_env: SCHEDULED_RESTART_SCHEDULE: "{{ valheim_scheduled_restart_schedule }}" # valheim_optional_env: - # 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 }}" +# 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 }}" From 77a7021f77bcb4bec8f35593f140a2d9c93adae5 Mon Sep 17 00:00:00 2001 From: Anarion Date: Mon, 18 Mar 2024 09:24:55 +0100 Subject: [PATCH 5/5] =?UTF-8?q?=F0=9F=9A=B8=20Simplified=20env=20vars?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- roles/valheim/defaults/main.yml | 16 +++++++--------- roles/valheim/tasks/main.yml | 2 +- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/roles/valheim/defaults/main.yml b/roles/valheim/defaults/main.yml index e402d3e0a2..c050e4fcc9 100644 --- a/roles/valheim/defaults/main.yml +++ b/roles/valheim/defaults/main.yml @@ -77,12 +77,10 @@ valheim_env: TYPE: "{{ valheim_type }}" SCHEDULED_RESTART: "{{ valheim_scheduled_restart }}" SCHEDULED_RESTART_SCHEDULE: "{{ valheim_scheduled_restart_schedule }}" - -# valheim_optional_env: -# 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 }}" + # 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 }}" diff --git a/roles/valheim/tasks/main.yml b/roles/valheim/tasks/main.yml index 08a6a03dd0..4252949599 100644 --- a/roles/valheim/tasks/main.yml +++ b/roles/valheim/tasks/main.yml @@ -25,7 +25,7 @@ - "{{ valheim_port_a }}:2456/udp" - "{{ valheim_port_b }}:2457/udp" - "{{ valheim_port_c }}:2458/udp" - env: "{{ valheim_optional_env | default({}) | combine(valheim_env) }}" + env: "{{ valheim_env }}" restart_policy: unless-stopped memory: "{{ valheim_memory }}" capabilities: