Commit Graph

290 Commits

Author SHA1 Message Date
too-gee
d9e64c0511 Remove vars from task names
Signed-off-by: too-gee <116376+too-gee@users.noreply.github.com>
2025-10-06 10:00:05 -07:00
Derek Nola
39f3f562e1 Update CHANGELOG.md for tag 1.1.0 (#444)
Signed-off-by: Derek Nola <derek.nola@suse.com>
2025-09-16 08:39:36 -07:00
Derek Nola
08a147e6b9 Update default branch to main
Signed-off-by: Derek Nola <derek.nola@suse.com>
1.1.0
2025-09-15 14:47:29 -07:00
Derek Nola
8c38db014c Consolidate server templates into a single one (#443)
- Fix linting to achieve production level for k3s-server role

Signed-off-by: Derek Nola <derek.nola@suse.com>
2025-09-15 14:24:01 -07: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
Derek Nola
d397c5c3dd Remove agent jinja template
* Remove opt_tls_san for agents, it is not a valid agent argument
Signed-off-by: Derek Nola <derek.nola@suse.com>
2025-09-15 12:46:37 -07:00
Derek Nola
dccb5ed4ad Bump example versions
Signed-off-by: Derek Nola <derek.nola@suse.com>
2025-09-15 12:46:37 -07:00
Guillaume A
f2aed3ba47 Automatically inject tls-san when api_endpoint differs from hostname (#434)
* Auto-add --tls-san={{ api_endpoint }} when it differs from ansible_hostname
* Ensures first server generates certificate with all required SANs
* Add .ansible/ and PR_DESCRIPTION.md to gitignore

Signed-off-by: Guillaume Andre <mail@guillaumea.fr>
2025-09-15 11:21:20 -07:00
Vadim Radu
cb640b853f Fix ipv4 lookup for firewalld (#440)
Signed-off-by: Vadim Radu <vadim@printarescu.ro>
2025-09-08 09:52:26 -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
Felix Seifert
10b9f6634f docs: describe adding collection to requirements.yaml (#438)
Signed-off-by: Felix Seifert <mail@felix-seifert.com>
2025-09-02 16:49:27 -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
Artur Kamalov
5a194381b0 Bump version in galaxy.yml (#432)
Signed-off-by: Artur Kamalov <arttambel@gmail.com>
2025-08-22 10:06:48 -07:00
Derek Nola
8b3845f9a4 Add missing RHEL 10 kernel module (#431)
Signed-off-by: Derek Nola <derek.nola@suse.com>
2025-08-20 08:58:55 -07:00
Derek Nola
c239874136 Don't update_cache if airgapped (#430)
Signed-off-by: Derek Nola <derek.nola@suse.com>
2025-08-12 11:13:54 -07:00
Claiyc
e9dbf66cef Distribute multiple image archives (#428)
Signed-off-by: Claiyc <claiyc@outlook.com>
2025-08-12 11:13:02 -07:00
fch-aa
66385e35eb fix(agent): Use proper env file path during provisioning. (#421)
Signed-off-by: fch-aa <21101725+fch-aa@users.noreply.github.com>
Co-authored-by: fch-aa <21101725+fch-aa@users.noreply.github.com>
1.0.1
2025-07-10 09:35:25 -07:00
Zero King
1067f630f5 Add service environment variables to all hosts (#416)
Signed-off-by: Zero King <l2dy@icloud.com>
2025-06-04 08:54:25 -06:00
Al West
f1d53c65e0 Disable repo check when installing SELinux RPM in airgapped environment (#413)
Currently when installed SELinux RPM, DNF will update repos.

Signed-off-by: Al West <al@tsew.net>
2025-05-22 10:44:33 -07:00
Tryy3
808070d77e Added agent_config_yaml to inventory-sample documentation (#405)
Signed-off-by: Tryy3 <Dennistryy3@gmail.com>
2025-04-21 11:34:33 -07:00
Stefan Haun
e3fe7ec450 Fix condition evaluation on ansible_all_ipv6_addresses to have a Boolean result (#404)
The condition `when: ansible_all_ipv6_addresses` evaluates to a list, which in
term evaluates to True,  but it seems that more recent Ansible versions do not
accept that anymore:

```
Conditional result was "['fe80::...']" of type 'list', which evaluates to True. Conditionals must have a boolean result.
```

This commit adds a length check to create a real Boolean result.

Signed-off-by: Stefan Haun <mail@tuxathome.de>
2025-04-18 09:07:40 -07:00
Rafael Alexandre
f3d8cc0b18 fix: rewrite ufw exceptions condition (#403)
Signed-off-by: Rafael Alexandre <r.alexandre99@gmail.com>
2025-04-18 09:07:23 -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
Michal Stanke
078b031941 fix: make the roles work even when hosts are aliased in the inventory (#399)
Signed-off-by: Michal Stanke <michal@stanke.cz>
1.0.0
2025-03-27 09:28:16 -07:00
Derek Nola
c38327927b Only apply K3s autocomplete when ansible_user is defined (#398)
Signed-off-by: Derek Nola <derek.nola@suse.com>
2025-03-20 10:49:03 -07:00
hek2mgl
8f71b09a4c Add galaxy installation to the README (#392)
Signed-off-by: hek2mgl <hek2mgl@metashock.net>
Co-authored-by: hek2mgl <hek2mgl@metashock.net>
2025-02-21 09:54:08 -08:00
Derek Nola
2c3bc06537 Escape regex special characters in token value (#391)
Signed-off-by: Derek Nola <derek.nola@suse.com>
2025-02-13 09:07:24 -08:00
alankan-finocomp
978bc50b3e Fix kubeconfig merge with existing config (#351)
* Fix kubeconfig merge with existing config

Signed-off-by: alankan-finocomp <79436574+alankan-finocomp@users.noreply.github.com>
Signed-off-by: Derek Nola <derek.nola@suse.com>
Co-authored-by: Derek Nola <derek.nola@suse.com>
2025-02-06 09:06:04 -08:00
Will
c8527cc9ee improve check mode support, allow for agent config yaml, restart service if config changed (#388)
Signed-off-by: Will Brown <will@wbrwn.co>
Co-authored-by: Will Brown <will@wbrwn.co>
2025-01-28 09:15:09 -08:00
Floren Munteanu
b915574338 docs: update list of projects (#387)
* docs: update list of projects

Signed-off-by: Floren Munteanu <19806136+fmunteanu@users.noreply.github.com>

* Update link location

Signed-off-by: Floren Munteanu <19806136+fmunteanu@users.noreply.github.com>

---------

Signed-off-by: Floren Munteanu <19806136+fmunteanu@users.noreply.github.com>
Co-authored-by: Floren Munteanu <19806136+fmunteanu@users.noreply.github.com>
2025-01-15 11:36:12 -08:00
Saksham Garg
e3603884a7 fix: fixing k3s uninstallation failures when k3s is installed via airgap role (#384)
Signed-off-by: SakshamAbhi <saksham.garg.988@gmail.com>
Co-authored-by: sgarg <s.garg@f5.com>
2024-12-27 10:13:00 -08:00
Derek Nola
2a5a89a5ad Set default empty extra_server_args and extra_agent_args (#377)
Signed-off-by: Derek Nola <derek.nola@suse.com>
2024-11-12 09:11:34 -08:00
anon-software
c10b84f0f4 enable autogenerating token (#375)
* Generate token

If a token is not explicitly provided, let the first server generate a
random one. Such a token is saved on the first server and the playbook
can retrieve it from there and store it a a fact. All other servers and
agents can use that token later to join the cluster. It will be saved
into their environment file as usual.

Signed-off-by: Marko Vukovic <8951449+anon-software@users.noreply.github.com>

* Document that token is (mostly) optional now

The token is still required when using Vagrant.

Signed-off-by: Marko Vukovic <8951449+anon-software@users.noreply.github.com>
2024-11-11 13:07:31 -08:00
Derek Nola
9d7fd7a70b Remove irrelevant kubectl symlink (#376)
Signed-off-by: Derek Nola <derek.nola@suse.com>
2024-11-08 10:58:30 -08:00
Derek Nola
2d38507c70 Fix order of operations when install agent airgap (#373)
Signed-off-by: Derek Nola <derek.nola@suse.com>
2024-10-28 11:43:06 -07:00
Derek Nola
c82a2f9b8e Don't modify existing airgap k3s-install script (#372)
* Check for existing k3s install script during airgap deployment

Signed-off-by: Derek Nola <derek.nola@suse.com>

* Update vagrant file to newer OS

Signed-off-by: Derek Nola <derek.nola@suse.com>

---------

Signed-off-by: Derek Nola <derek.nola@suse.com>
2024-10-18 09:33:01 -07:00
Derek Nola
99fa632acb Fix failure when not using airgap (#370)
* Fix failure when not using airgap

Signed-off-by: Derek Nola <derek.nola@suse.com>
2024-10-08 14:57:08 -07:00
Derek Nola
1cfe59728a Handle multiple architectures when distributing airgap binary (#367)
* Handle multiple architectures when distributing airgap binary

Signed-off-by: Derek Nola <derek.nola@suse.com>

* yamllint fix

Signed-off-by: Derek Nola <derek.nola@suse.com>

* ansiblelint fix

Signed-off-by: Derek Nola <derek.nola@suse.com>

---------

Signed-off-by: Derek Nola <derek.nola@suse.com>
2024-10-08 14:10:05 -07:00
anon-software
040d37878b Prevent multiple tokens in k3s.service.env (#364)
* Prevent multiple tokens in k3s.service.env

If site.yml playbook is executed multiple times with different tokens,
they will all accumulate in k3s.service.env. They won't do any harm
because the last one wins, however it is a matter of good housekeeping
to delete the old before inserting a new one.

Signed-off-by: Marko Vukovic <8951449+anon-software@users.noreply.github.com>

* Selectively remove existing token from the environment file

If the existing token in the environment file is the same as the token
used for the playbook run, leave it in the file to avoid false changed
status from the task.

Signed-off-by: Marko Vukovic <8951449+anon-software@users.noreply.github.com>

---------

Signed-off-by: Marko Vukovic <8951449+anon-software@users.noreply.github.com>
2024-10-07 09:44:28 -07:00
Derek Nola
19f99f71ed Don't require a bogus k3s_version for airgap installs (#363)
Signed-off-by: Derek Nola <derek.nola@suse.com>
2024-09-16 09:15:05 -07:00
Derek Nola
848e22cb72 Handle both new and old cmdline.txt locations in Raspbian (#362)
Signed-off-by: Derek Nola <derek.nola@suse.com>
2024-09-13 10:49:53 -07:00
james-otten
bc03d1c0d0 Fix adding token to existing cluster (#360)
Signed-off-by: James Otten <jamesotten1@gmail.com>
2024-09-12 09:54:11 -07:00
anon-software
2d98982809 Security exposure related to the token (#356)
* Security exposure related to the token

The installation playbook saves the token into the systemd unit
configuration file /etc/systemd/system/k3s.service. The problem is that
according to K3s' documentation "the server token should be guarded
carefully" (https://docs.k3s.io/cli/token), yet the configuration file
is readable by anybody. A better solution is to save the token into its
corresponding environment file /etc/systemd/system/k3s.service.env which
is readable by the super user only. This is what the standard K3s'
installation script (https://get.k3s.io) does.

Signed-off-by: Marko Vukovic <8951449+anon-software@users.noreply.github.com>

* Restore the server URL into systemd configuration file

There aren't any security implications in keeping it there.

Signed-off-by: Marko Vukovic <8951449+anon-software@users.noreply.github.com>

---------

Signed-off-by: Marko Vukovic <8951449+anon-software@users.noreply.github.com>
2024-09-04 14:02:52 -07:00
anon-software
3e0c982a95 Better cleanup with reset playbook (#353)
* Better cleanup with reset playbook

The install playbook adds some convenience commands into the user's
.bashrc. If K3s is uninstalled, these commands produce errors. Since
they are eaily identifiable, it is trivial to remove them to improve
the user's experience.

Signed-off-by: Marko Vukovic <8951449+anon-software@users.noreply.github.com>
2024-08-22 14:13:28 -07:00
Lihai Tu
61ba8b57a3 Cleanup redundant conditions (#355)
Signed-off-by: tu1h <lihai.tu@daocloud.io>
2024-08-22 14:13:06 -07:00
anon-software
04c8ae9a57 More flexible cgroup settings (#352)
* More flexible cgroup settings

If there are already required cgroup boot parameters present but in a
different order than specified, the script will add them again. It is
better to test for the individual parameter in a loop and selectively
add them as necessary.

Signed-off-by: Marko Vukovic <anonsoftware@gmail.com>

Signed-off-by: Marko Vukovic <anonsoftware@gmail.com>
Signed-off-by: Marko Vukovic <8951449+anon-software@users.noreply.github.com>
2024-08-15 10:32:22 -07:00
Peter Klijn
b6e4c8b31e Update K3s to latest 1.30 (#348)
Signed-off-by: Peter Klijn <pjmklijn@gmail.com>
2024-07-22 09:33:09 -07:00
Peter Klijn
e53d895428 Introduce copy of k3s.yaml file to detect changes and skip control node changes (#347)
Signed-off-by: Peter Klijn <pjmklijn@gmail.com>
2024-07-15 13:55:31 -07:00
Peter Klijn
4f769544b3 Add a handler to restart the K3s Server when the service file changes (#344)
* Add a handler to restart the K3s Server when the service file changes

Signed-off-by: Peter Klijn <pjmklijn@gmail.com>
2024-07-15 10:00:25 -07:00
haseHH
71d6ba0580 Don't install linux-modules-extra-raspi on Ubuntu 24.04 and up (#346)
The extra modules were merged into the normal modules packet as of Kernel 6.8/Ubuntu 24.04

Signed-off-by: haseHH <christian@hase.hamburg>
2024-07-11 10:18:06 -07:00