feat(k3s_upgrade): regenerate service files from templates instead of restoring backups (#474)

* feat(k3s_upgrade): regenerate service files from templates instead of restoring backups

The k3s_upgrade role previously restored backup service files after binary
upgrade, which meant any changes to extra_server_args or extra_agent_args
would not be applied during upgrades.

This change:
- Replaces backup restoration with template-based service file regeneration
- Reuses templates from k3s_server role via symlink
- Adds necessary defaults for template variables

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
This commit is contained in:
Aleksei Sviridkin
2025-12-11 21:54:58 +03:00
committed by GitHub
parent 53c35bac5f
commit 49b810c948
3 changed files with 87 additions and 33 deletions

View File

@@ -3,3 +3,9 @@ systemd_dir: /etc/systemd/system # noqa var-naming[no-role-prefix]
server_group: server # noqa var-naming[no-role-prefix]
agent_group: agent # noqa var-naming[no-role-prefix]
extra_install_envs: {} # noqa var-naming[no-role-prefix]
k3s_server_location: /var/lib/rancher/k3s # noqa var-naming[no-role-prefix]
api_port: 6443 # noqa var-naming[no-role-prefix]
extra_server_args: "" # noqa var-naming[no-role-prefix]
extra_agent_args: "" # noqa var-naming[no-role-prefix]
use_external_database: false # noqa var-naming[no-role-prefix]
# api_endpoint must be provided by inventory for agent nodes