Commit Graph

272 Commits

Author SHA1 Message Date
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
Derek Nola
a4b5363318 Don't enable K3s service during airgap install (#345)
Signed-off-by: Derek Nola <derek.nola@suse.com>
2024-07-08 10:58:08 -07:00
Peter Klijn
31b8b1edcf POC: Supporting k3s-ansible with external database (#339)
* POC: Supporting k3s-ansible with external database

Signed-off-by: Peter Klijn <pjmklijn@gmail.com>
2024-07-02 13:34:34 -07:00
Derek Nola
91ee70ee17 Fixed playbooks path in Vagrant and Readme (#341)
* fixed path to playbooks/site.yml

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

* Update readme with playbooks

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

---------

Signed-off-by: Derek Nola <derek.nola@suse.com>
Co-authored-by: Ethan Locke <13014836-Zie0@users.noreply.gitlab.com>
2024-06-20 10:26:01 -07:00
Derek Nola
5d047cbf33 Update required ansible to >=2.15 (oldest supported version) (#338)
Signed-off-by: Derek Nola <derek.nola@suse.com>
2024-06-20 10:20:48 -07:00
laszlojau
1907e6fb79 Add group variables to the prereq role (#334)
Signed-off-by: laszlojau <49835454+laszlojau@users.noreply.github.com>
2024-06-10 09:58:06 -07:00
Derek Nola
5a12415b3c Rename playbook to playbooks for ansible collection support (#333)
Signed-off-by: Derek Nola <derek.nola@suse.com>
2024-06-04 10:36:35 -07:00
Meagan Harris
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
af29159231 Implement compatible yamllint, make octals explicit (#332)
* Implement compatible yamllint, make octals explicit

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

* Replace yum with dnf, yum is deprecated

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

---------

Signed-off-by: Derek Nola <derek.nola@suse.com>
2024-06-04 09:56:07 -07:00
laszlojau
8120b7c0d1 Update firewall rules (#329)
Signed-off-by: laszlojau <49835454+laszlojau@users.noreply.github.com>
2024-05-30 10:05:43 -07:00
Frank Villaro-Dixon
64e38ee702 token: explain how to generate it (#328)
Signed-off-by: Frank Villaro-Dixon <frank@villaro-dixon.eu>
2024-05-17 09:58:57 -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
dreamingdeer
33c15e7c2f feat add custom registries_config_yaml for private-registry (#319)
* feat add custom registries_config_yaml for private-registry

Signed-off-by: dreamingdeer <dreamingdeer@yandex.ru>
Co-authored-by: dreamingdeer <dreamingdeer@yandex.ru>
2024-04-02 12:24:23 -07:00
dreamingdeer
485ee0f285 fix keep extension on uploaded file on airgap install (#311)
* fix keep extension on uploaded file on airgap install
* fix other tasks distribute K3s images

Signed-off-by: dreamingdeer <dreamingdeer@yandex.ru>
Co-authored-by: dreamingdeer <dreamingdeer@yandex.ru>
2024-04-01 11:31:44 -07:00
Mykyta Orlov
5dd8c3f5a3 Fix typo in main.yml (#317)
Signed-off-by: Mykyta Orlov <orlovmyk@gmail.com>
2024-04-01 11:15:20 -07:00
Jose Luis Pedrosa
91405dc517 fix: skip cgroups when cmdline.txt is not present (#320)
Signed-off-by: Jose Luis Pedrosa <jlpedrosa@gmail.com>
2024-04-01 11:08:05 -07:00
Vivek Sarin
c84c1ce5b1 Added custom context name (#315)
* Added custom context name

Signed-off-by: Vivek Sarin <vivek@sarin.info>
Signed-off-by: Derek Nola <derek.nola@suse.com>
Co-authored-by: Vivek Sarin <vivek@sarin.info>
Co-authored-by: Derek Nola <derek.nola@suse.com>
2024-04-01 09:35:55 -07:00
Derek Nola
6c14e5d923 Add a minimum ansible core check (#308)
Signed-off-by: Derek Nola <derek.nola@suse.com>
2024-03-19 10:05:10 -07:00