22 Commits
Author SHA1 Message Date
Kris 1a600b60d3 feat: make the server config file mode configurable (#561)
* feat: make the server config file mode configurable

/etc/rancher/k3s/config.yaml holds the cluster token. The server and
upgrade roles write it at 0644, so every local account on a server node
can read the credential that joins a node to the cluster.

k3s_server_config_mode sets the mode of that file in both roles. It
defaults to 0644, so behaviour is unchanged unless it is set.

Signed-off-by: Kristofer <kristofer@atlascloud.is>

* docs: describe the server config file contents accurately

/etc/rancher/k3s/config.yaml does not always carry the cluster token. A
first server that lets K3s generate one writes the file without it, so the
file can contain the token rather than always holding it. Correct that
claim in the README, the inventory sample and the role default, and use
the US spelling of "honors".

Signed-off-by: Kristofer <kristofer@atlascloud.is>

* Name the floor the config file mode can be narrowed to

Saying any mode root can read works leaves the reader to work out what
that means in practice. The file is read only by k3s, running as root, so
0600 is the tightest mode that still works.

Signed-off-by: Kristofer <kristofer@atlascloud.is>

* Run the basic integration job with a non-default config file mode

The templated mode was only ever rendered with its default in CI, which
is the one value that cannot tell a working template from a broken one.
The basic inventory sets 0640 and the job reads the mode back off the
installed file.

Signed-off-by: Kristofer <kristofer@atlascloud.is>

---------

Signed-off-by: Kristofer <kristofer@atlascloud.is>
2026-09-16 11:55:02 -07:00
Stéphane Este-Gracias 445cecb423 Wrap api_endpoint with ansible.utils.ipwrap for IPv6 compatibility (#550)
* Add IPv6 support for api_endpoint

Signed-off-by: Stéphane Este-Gracias <sestegra@gmail.com>
Signed-off-by: Derek Nola <derek.nola@suse.com>

* Add ansible.utils requirement

Signed-off-by: Stéphane Este-Gracias <sestegra@gmail.com>
Signed-off-by: Derek Nola <derek.nola@suse.com>

* Add netaddr dependency

Signed-off-by: Stéphane Este-Gracias <sestegra@gmail.com>
Signed-off-by: Derek Nola <derek.nola@suse.com>

---------

Signed-off-by: Stéphane Este-Gracias <sestegra@gmail.com>
Signed-off-by: Derek Nola <derek.nola@suse.com>
Signed-off-by: Stéphane Este-Gracias <sestegra@gmail.com>
2026-08-13 12:11:08 -07:00
Archy 9cdd1dd47c fix: read hostname from ansible_facts in the TLS SAN condition (#548)
Signed-off-by: Artem Muterko <artem@sopho.tech>
2026-08-10 14:53:20 -07:00
Derek Nola de7c3ed894 Fix missing extra_server_args on k3s_upgrade
Signed-off-by: Derek Nola <derek.nola@suse.com>
2026-02-28 10:34:04 -08:00
Derek Nola 65a3b5f6ac Remove service template from k3s_upgrade role (#519)
Signed-off-by: Derek Nola <derek.nola@suse.com>
2026-02-27 15:35:12 -08:00
Derek Nola 1eca3a1ab8 Remove server role template, utilize config.yaml to configure k3s
Signed-off-by: Derek Nola <derek.nola@suse.com>
2026-02-27 11:52:47 -08:00
Pavlo 9650436585 fix: use correct variable for k3s old token for agents in upgrade.yml playbook (#513)
Signed-off-by: paulkarabilo <582643+paulkarabilo@users.noreply.github.com>
2026-02-26 12:04:16 -08:00
laszlojau 77b49f76ce Fix the 'Save the existing K3s token if needed' task (#503)
Signed-off-by: laszlojau <49835454+laszlojau@users.noreply.github.com>
2026-02-05 11:23:26 -08:00
Derek Nola f6491bb524 Support openrc systems on agent nodes, added openrc test matrix (#489)
Signed-off-by: Derek Nola <derek.nola@suse.com>
2026-01-20 09:29:40 -08:00
Derek Nola 67ca2bfd1c Ensure agents are upgraded correctly, pass token (#484)
Signed-off-by: Derek Nola <derek.nola@suse.com>
2026-01-13 09:41:29 -08:00
Derek Nola e4f8d8d737 k3s-upgrade lint naming
Signed-off-by: Derek Nola <derek.nola@suse.com>
2026-01-12 13:32:23 -08:00
Aleksei SviridkinandClaude 49b810c948 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>
2025-12-11 10:54:58 -08:00
fch-aaandfch-aa 3b34d679e5 fix(upgrade): Implement airgap support for the upgrade flow. (#465)
Signed-off-by: fch-aa <21101725+fch-aa@users.noreply.github.com>

---------

Signed-off-by: fch-aa <21101725+fch-aa@users.noreply.github.com>
Co-authored-by: fch-aa <21101725+fch-aa@users.noreply.github.com>
2025-12-04 10:29:28 -08:00
Derek Nola b77e0049c8 Fix linting to bring back 'production' status for all non-server k3s roles
Signed-off-by: Derek Nola <derek.nola@suse.com>
2025-09-15 12:46:37 -07:00
David Barnett fad5c05cb4 fix k3s_upgrade error (#439)
Signed-off-by: David Barnett <davidb@rnett.nz>
2025-09-04 15:01:05 -07:00
Derek Nola cd543a660d Inject installation envs for install script (#433)
Signed-off-by: Derek Nola <derek.nola@suse.com>
2025-08-26 09:57:53 -07:00
mbathe19 6809dc8913 feat: add check_mode false to run upgrade tests (#402)
Signed-off-by: Michel Bathe <michel.bathe.1996@googlemail.com>
2025-04-18 09:07:05 -07:00
Meagan HarrisandDerek Nola 006653f3ff Make agent and server groups configurable (#331)
* Make agent and server groups configurable

Signed-off-by: Meagan Harris <thewitch@siliconsorceress.com>

* Fix typo in upgrade role

Co-authored-by: Derek Nola <derek.nola@suse.com>
Signed-off-by: Meagan Harris <47128741+simagick@users.noreply.github.com>

---------

Signed-off-by: Meagan Harris <thewitch@siliconsorceress.com>
Signed-off-by: Meagan Harris <47128741+simagick@users.noreply.github.com>
Co-authored-by: Derek Nola <derek.nola@suse.com>
2024-06-04 10:06:14 -07:00
Derek Nola ddc664a7f6 Apply noqa and fix line lenght limit. ansible-lint production profile (#326)
Signed-off-by: Derek Nola <derek.nola@suse.com>
2024-05-03 09:38:01 -07:00
laszlojau 7ec16a8d53 Keep service backups under /etc/systemd/system (#324)
Signed-off-by: laszlojau <49835454+laszlojau@users.noreply.github.com>
2024-04-05 13:54:57 -07:00
LawiK974 a2916230ba Check K3s installed version before download tasks (#297)
- [Agent : Download artefact only if needed](roles/k3s_agent/tasks/main.yml#L13)
- [Server : Download artefact only if needed](roles/k3s_server/tasks/main.yml#L13)
- [Upgrade : Upgrade node only if needed](roles/k3s_upgrade/tasks/main.yml#L14)

Linked issue #264 k3s_server and k3s_agent tasks are not idempotent

Signed-off-by: Loïc Dubard <loic97429@gmail.com>
2024-03-07 16:05:07 -08:00
Derek Nola 1e633c5ad1 Rework Role Structure (#254)
* Add more defaults
* Rename roles, covert download to airgap role
* Remove unnecessary gather_facts

Signed-off-by: Derek Nola <derek.nola@suse.com>
2023-11-16 12:03:07 -08:00