Commit Graph

84 Commits

Author SHA1 Message Date
Richard Holmboe
b077a49e1f
Change to FQCN with ansible-lint fixer (#553)
* Change to FQCN with ansible-lint fixer

Since ansible-base 2.10 (later ansible-core), FQCN is the new way to go.

Updated .ansible-lint with a production profile and removed fqcn in skip_list.
Updated .yamllint with rules needed.

Ran ansible-lint --fix=all, then manually applied some minor changes.

* Changed octal value in molecule/ipv6/prepare.yml
2024-08-12 22:59:59 -05:00
Christian Berendt
d0537736de
k3s_server: add missing parameter descriptions (#559)
The commit 3a20500f9c has introduced
argument specs in the role meta information. These two parameters
were still missing there.

Realted to 2d0596209e

Signed-off-by: Christian Berendt <berendt@osism.tech>
Co-authored-by: Techno Tim <timothystewart6@gmail.com>
2024-08-07 16:10:16 +00:00
Christian Berendt
2149827800
k3s_server: add kube-vip BGP support (#554)
With the kube_vip_bgp parameter it is possible to enable the kube-vip
BGP support (https://kube-vip.io/docs/modes/bgp/).

The configuration is possible with the following new parameters:

* kube_vip_bgp_routerid
* kube_vip_bgp_as
* kube_vip_bgp_peeraddress
* kube_vip_bgp_peeras

Signed-off-by: Christian Berendt <berendt@osism.tech>
2024-08-07 09:36:05 -05:00
Christian Berendt
2d0596209e
Make it possible to disable the creation of the kubectl/crictl symlinks (#558)
If k3s_create_kubectl_symlink is set to false the kubectl symlink will
not be created.

If k3s_create_crictl_symlink is set to false the crictl symlink will not
be created.

By default the symlinks will be created. The default behavior is not
changed.

Signed-off-by: Christian Berendt <berendt@osism.tech>
Co-authored-by: Techno Tim <timothystewart6@gmail.com>
2024-08-05 21:19:57 -05:00
Dov Benyomin Sohacheski
3a20500f9c
Add default values to roles (#509)
*  Add default values to roles

* 🚚 Move to use meta files for roles

* 🛠 Fix descriptions

*  Add meta for server

* 🚧 WIP

* 🌟 Complete

* 🧹 Ran and fix lint errors

* 🔨 Fix required and default conflict

---------

Co-authored-by: Techno Tim <timothystewart6@gmail.com>
2024-08-05 17:00:24 -05:00
Christian Berendt
668d7fb896
k3s_server: add kube_vip_arp parameter (#550)
With the kube_vip_arp parameter it is possible to set or unset the
vip_arp environment variable of the kube-vip-ds daemonset. The value of
the kube_vip_arp is true by default to not change the existing default.

Signed-off-by: Christian Berendt <berendt@osism.tech>
Co-authored-by: Techno Tim <timothystewart6@gmail.com>
2024-07-29 16:05:30 -05:00
Techno Tim
e8cd10d49b
chore(deps): Updated all k8s components (#532)
* chore(deps): Updated all k8s components

* Metallb 0.14.4 support (#533)

* Added support for metallb >= 0.14.4

* update gpg

* Added support for metallb >= 0.14.4

* remove extra file

---------

Co-authored-by: Konstantin Kornienko <k.kornienko@postgrespro.ru>
Co-authored-by: Konstantin Kornienko <konstantin.kornienko@gmail.com>

* chore(deps): Updated actions

* chore(dependencies): Roll back ansible-core

* chore(deps): Updated kube-vip

* chore(deps): Updated dependencies

* chore(deps): Updated dependencies

* fix(cilium): fixing logic

* fix(cilium): fixing logic

---------

Co-authored-by: Konstantin Kornienko <k.kornienko@postgrespro.ru>
Co-authored-by: Konstantin Kornienko <konstantin.kornienko@gmail.com>
2024-07-28 14:29:32 -05:00
Rina Y
072f1a321d
fixed broken when statement for Deploy metallb manifest task (#513)
Co-authored-by: Techno Tim <timothystewart6@gmail.com>
2024-06-03 23:39:54 +00:00
Dov Benyomin Sohacheski
d6597150c7
Allow IP range for cilium_bgp_lb_cidr (#507)
Co-authored-by: Techno Tim <timothystewart6@gmail.com>
2024-05-10 21:45:29 -05:00
Techno Tim
a46d97a28d
chore(deps): Updated cilium to v1.15.2 (#484)
* chore(deps): Updated cilium to v1.15.2

* fix(molecule): increase timeout for slow CI
2024-03-22 14:16:31 -05:00
Phil Bolduc
f81ec04ba2
Support defining a custom reboot command (#467)
Co-authored-by: Techno Tim <timothystewart6@gmail.com>
2024-03-06 03:52:24 +00:00
Techno Tim
8432d3bc66
chore(deps): Updated (#469)
* chore(deps): Updated

* fix(kube-vipe): changed rbac location
2024-03-05 04:18:23 +00:00
Phil Bolduc
14ae9df1bc
Change path for KUBECONFIG (#465) 2024-03-04 16:58:52 -06:00
Daniel SP
955c6f6b4a
Fix cgroups cmdline path (#456)
* Fix cgroups cmdline path

* Add check and variable so that we write to the correct file

* Add LSB release checks. This is untested atm.

* Break test into multiple lines so that we can pass lint checks

* Flip logic on its head and check for existence only rather than content per contributor suggestion

---------

Co-authored-by: Techno Tim <timothystewart6@gmail.com>
2024-03-02 15:14:41 -06:00
Jayson Grace
e4146b4ca9
Add PXE boot support to k3s_agent role (#409)
* Add conditional snapshotter for PXE-booted systems

**Added:**

- PXE Boot Check - Introduced tasks to check if the system is PXE-booted by
  analyzing `/proc/cmdline` in `roles/k3s_agent/tasks/main.yml`.
- Conditional Snapshotter in Template - Added logic in `k3s.service.j2` template
  to conditionally set `--snapshotter native` for PXE-booted systems.

**Changed:**

- `k3s.service.j2` Template Update - Modified the `ExecStart` line to include a
  conditional check for `is_pxe_booted` fact, dynamically setting the
  `--snapshotter` option for NFS-mounted systems.
- `main.yml` Task Modification - Added tasks to set `is_pxe_booted` fact based
  on the presence of `root=/dev/nfs` in the system's boot command line.

This update allows k3s agents on PXE-booted systems to use the native snapshotter
when running on NFS, addressing compatibility issues with OverlayFS.

* Introduce idiomatic practices for affected areas from previous commits

**Added:**

- Structured HTTP Proxy Configuration Block - Added a structured block in
  `http_proxy.yml` for managing HTTP proxy settings, aligning with Ansible's
  recommended practices. This includes creating directories and deploying
  configuration files in a clear, modular fashion.
- Conditional Execution for Proxy Setup - Implemented conditional execution
  for the proxy setup in `http_proxy.yml`, utilizing `proxy_env` to adhere
  to Ansible's best practices for conditional tasks.
- Improved PXE-Boot System Check Block - Introduced a more structured approach
  in `main.yml` for checking PXE-booted systems, enhancing readability and
  maintainability.

**Changed:**

- Adopted Ansible Builtin Modules - Transitioned existing tasks to use
  `ansible.builtin` modules, ensuring compatibility and future-proofing the
  role.
- Refined Task Grouping - Reorganized tasks into logical blocks, improving
  the overall structure and readability, and showcasing Ansible's capabilities
  for efficient task management.
- Updated K3s Service Configuration - Modified the K3s service configuration
  task in `main.yml` for a more streamlined approach using Ansible's template
  module, reflecting community-driven best practices.

**Removed:**

- Streamlined Task Definitions - Optimized task definitions to reduce
  redundancy, focusing on clarity and adherence to the evolving Ansible
  community standards.

* Added missing checks causing failures for agents
2024-02-06 14:24:31 -06:00
Devin Buhl
1fb10faf7f
fix(cilium): k3s has an API server proxy at 127.0.0.1:6444 (#442)
There is no need to use kube-vip LB
2024-02-05 04:35:51 +00:00
sholdee
6ffc25dfe5
Add Cilium CNI option (#435)
* Add Cilium CNI option

* Tweak version checks and add BGP resource verify

* Update metallb detection for kube-vip feat compat
2024-01-29 19:29:13 -06:00
Gereon Vey
bcd37a6904
add kube-vip as a service load balancer (#432)
* add kube-vip as a service load balancer

* add molecule scenario kube-vip

---------

Co-authored-by: Techno Tim <timothystewart6@gmail.com>
2024-01-29 09:13:13 -06:00
egandro
3aeb7d69ea
added fix for metallb version upgrades (#394)
* added fix for metallb version upgrades

* use bash to allow pipefail

---------

Co-authored-by: Harald Fielker <harald.fielker@gmail.com>
Co-authored-by: Techno Tim <timothystewart6@gmail.com>
2024-01-28 00:50:13 +00:00
sholdee
0f23e7e258
Add Calico CNI option (#414)
* Add Tigera Operator/Calico CNI option

Small tweak to reduce delta from head

Set calico option to be disabled by default

Add rescue blocks in case updating existing

Refactor items and update comments

Refactor and consolidate calico.yml into block

Refactor to use template for Calico CRs

Revert use_calico to false

Template blockSize

Align default cidr in template with all.yml sample

Apply upstream version tags

Revert to current ver tags. Upstream's don't work.

Update template address detection

Add Tigera Operator/Calico CNI option

* Add calico-apiserver check

* Add eBPF dataplane option

* Add kube svc endpoint configmap when ebpf enabled

* Add /etc/cni/net.d to reset task

* Refactor based on comments

* Add molecule scenario

* Fix lint

---------

Co-authored-by: Techno Tim <timothystewart6@gmail.com>
2024-01-26 18:53:27 -06:00
João Gonçalves
db53f595fd
feat(k3s): added support for latest raspberrypi os (debian 12 bookworm) (#404)
* feat(k3s): added support for latest raspberrypi os (debian 12 bookworm)

* Update test.yml

* Revert test workflow

---------

Co-authored-by: Techno Tim <timothystewart6@gmail.com>
2024-01-26 22:20:06 +00:00
sholdee
511c410451
Add Debian Bookworm support and refactor Pi OS detection (#415)
* Refactor Pi OS detection and add Debian Bookworm support

* Add bullseye back

---------

Co-authored-by: Techno Tim <timothystewart6@gmail.com>
2024-01-25 19:20:02 +00:00
Balázs Hasprai
df9c6f3014
Fix http_proxy service dir in k3s_agent role (#400)
* Fix http_proxy service dir in k3s_agent role

* Fix http_proxy reset: rm conf files before dirs

* Fix http_proxy reset rm order

---------

Co-authored-by: Techno Tim <timothystewart6@gmail.com>
2024-01-25 11:34:46 -06:00
Techno Tim
e2e9881f0f
Fix CI (#389)
did all the things to make it work
2024-01-24 22:26:38 -06:00
egandro
edf0c9eebd
fix for recreating new control planes (2nd run) (#393)
Co-authored-by: Harald Fielker <harald.fielker@gmail.com>
Co-authored-by: Techno Tim <timothystewart6@gmail.com>
2024-01-19 08:37:14 -06:00
Balázs Hasprai
cddbfc8e40
Update truthy values to true/false only, #204 (#387)
Co-authored-by: Techno Tim <timothystewart6@gmail.com>
2024-01-15 12:43:44 -06:00
Balázs Hasprai
e880f08d26
Add option for install behind http_proxy (#384)
* Add option for install behind http_proxy

* Tidy up http_proxy usage
2023-10-21 00:18:36 +00:00
Balázs Hasprai
95b2836dfc
Add option to disable MetalLB, for use w/ ext LBs (#383)
* Add option to disable MetalLB, for use w/ ext LBs

* Add option to disable MetalLB, for use w/ ext LBs - add defaults

* Skip MetalLB with tags instead of flag
2023-10-18 22:07:07 +00:00
balazshasprai
505c2eeff2
Add option for custom registries / mirrors (#382) 2023-10-18 03:33:30 +00:00
balazshasprai
9b6d551dd6
Expand secure_path with support for Suse (#381) 2023-10-13 04:14:47 +00:00
johnnyrun
38e773315b
sysctl tags (#373)
* sysctl tags

* lost tag

---------

Co-authored-by: Gianni <gianni@chainlabo.com>
Co-authored-by: Gianni Carabelli <gianni.carabelli@skytv.it>
2023-10-09 10:00:31 -05:00
Marek Pilch
a9904d1562
fixes: ERROR! The requested handler <'Reboot containers' / 'Reboot se… (#348)
* fixes: ERROR! The requested handler <'Reboot containers' / 'Reboot server' / 'Reboot>' was not found in either the main handlers list nor in the listening handlers list

* Update main.yml
2023-08-14 17:37:20 -05:00
Christian Berendt
215690b55b
Replace hardcoded 'master' group name with 'group_name_master' variable (#337)
For improved flexibility and maintainability.

* Update tasks in node role to use 'group_name_master' variable instead
  of hardcoded 'master' group name
* Update tasks in master role to use 'group_name_master' variable instead
  of hardcoded 'master' group name
* Update tasks in post role to use 'group_name_master' variable instead of
  hardcoded 'master' group name

Signed-off-by: Christian Berendt <berendt@23technologies.cloud>
2023-07-21 16:37:57 -05:00
Simon Leiner
33ae0d4970
Fix CI (#332)
* Update pre-commit actions

This was done by running "pre-commit autoupdate --freeze".

* Remove pre-commit only dependencies from requirements.in

Including them in the file would create the illusion that those were the
versions actually used in CI, but they are not. The exact versions are
determined by the pre-commit hooks which are pinned in
.pre-commit-config.yaml.

* Ansible Lint: Fix role-name[path]

* Ansible Lint: Fix name[play]

* Ansible Lint: Fix key-order[task]

* Ansible Lint: Fix jinja[spacing]

* Ansible Lint: Fix no-free-form

* Ansible Lint: Fix var-naming[no-reserved]

* Ansible Lint: Fix yaml[comments]

* Ansible Lint: Fix yaml[line-length]

* Ansible Lint: Fix name[casing]

* Ansible Lint: Fix no-changed-when

* Ansible Lint: Fix fqcn[action]

* Ansible Lint: Fix args[module]

* Improve task naming
2023-07-20 10:50:02 -05:00
ThePCGeek
49f0a2ce6b
(fix): correct var (#262)
var registered for rc.local check is rcfile but under when it said rclocal which was undefined. changed to rcfile to correct.
2023-03-25 20:41:04 -05:00
Noms
3a1a7a19aa
Fix LXC container implementations (#231)
* Need to become to reboot

* Fix rc.local insertion of script

* Fix syntax

Add new line to lxc.yml

* Remove need to set fact

* Add reset for LXC container config

* Fix syntax

Its always the newlines..

* remove fact setting from reset task

We should mirror the deployment task

* Proxmox LXC reset functions

* Handle if rc.local already has data

* Dont compare literal

* Cleanup Erroneous newline

* Handle rc.local not present on a hybrid cluster

* Update roles/reset/tasks/main.yml

Co-authored-by: Simon Leiner <simon@leiner.me>

* Update roles/lxc/tasks/main.yml

Co-authored-by: Simon Leiner <simon@leiner.me>

---------

Co-authored-by: Techno Tim <timothystewart6@gmail.com>
Co-authored-by: Simon Leiner <simon@leiner.me>
2023-03-03 11:28:14 -06:00
Simon Leiner
6448948e9f
Fix dual-stack clusters with multiple master nodes (#237)
* Test IPv6 scenario with two master nodes

* Fix IPv6 multimaster setup

---------

Co-authored-by: Techno Tim <timothystewart6@gmail.com>
2023-02-20 05:24:19 +00:00
Simon Leiner
7bc198ab26
Pick kube-vip interface automatically by default (#238)
* Pick kube-vip interface automatically by default

* molecule: Fix ipv6 scenario

* Choose a more restrictive molecule timeout in CI
2023-02-20 04:08:36 +00:00
Simon Leiner
65bbc8e2ac
Simplify download and patching of MetalLB manifests (#239)
This removes duplicated code and cleans up Ansible log lines a bit.
2023-02-19 21:34:22 -06:00
Mike Thomas
dc2976e7f6
Metallb BGP support (#212)
* Add metallb frr and bgp support

* Set metallb mode to layer2 as default in sample

* Add BGP resource check

* Add automatic downloading of metallb-frr

* Remove frr manifest
2023-02-09 23:58:58 -06:00
Simon Leiner
10c6ef1d57
Download MetalLB CRDs for respective versions (#225)
* Download MetalLB CRDs for respective versions

This ensures that the CRDs match the actual MetalLB controller version,
as given by the user.

* Download VIP RBAC definitions for respective version
2023-02-06 22:24:02 -06:00
acdoussan
511ec493d6
add support for proxmox lxc containers (#209)
Co-authored-by: Adam Doussan <acdoussan@Adams-MacBook-Pro.local>
2023-01-29 21:23:31 -06:00
Simon Leiner
be3e72e173
Do not rely on ansible_user (#214)
* Apply "become" on roles instead of plays

This leads to facts being gathered for the "regular" login user, instead
of root.

* Do not rely on ansible_user

Instead of reading ansible_user (which may or may not be defined), this
patch lets the roles rely on Ansible facts [1].

[1]: https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_vars_facts.html
2023-01-29 21:20:25 -06:00
Techno Tim
b86384c439
fix(raspberrypi): Fix handler name (#200) 2023-01-10 21:26:27 -06:00
irish1986
e98e3ee77c
Split manifest into separate task for ease of use (#191) 2023-01-01 23:04:22 -06:00
Sherif Metwally
2604caa483
"command" module no longer supports "warn" argument (#169)
* "command" module no longer supports "warn" argument

* correct indetation lint errors
2022-11-29 20:26:01 -06:00
Techno Tim
17a74b66c8
Pre commit fixes (#167)
* chore(dependencies): updated kube-vip to 0.5.6

* fix(pre-commit): pin to hash

* fix(pre-commit): added more hooks and fixed lint

* fix(pre-commit): added pre-commit hook so we don't have to run it manually

* fix(pre-commit): Added docs to readme

* fix(pre-commit): added texthooks

* fix(pre-commit): pin to hash

* fix(pre-commit): added mor hooks and fixed lint

* fix(lint): Fixing quotes

* fix(ci): only run test if linting passes

* fix(ci): convert to reusable workflows

* fix(pr template): Reorder steps
2022-11-13 22:42:49 -06:00
Irakli Nadareishvili
590a8029fd
Removing accidental tear-down step that is clearly a typo (#117)
Co-authored-by: Techno Tim <timothystewart6@gmail.com>
2022-10-15 14:15:25 -05:00
Techno Tim
cb2fa7c441
k3s, metallb, kube-vip updates (#119)
* feat(k3s): Updated to v1.24.6+k3s1

* feat(kube-vip): Update to v0.5.5

* feat(metal-lb): Update to v0.13.6

* fix(pip): Freeze requirements

* fix(lint): Fixed ansible-lint
2022-10-15 12:23:50 -05:00
Ioannis Angelakopoulos
cd76fa05a7
fix master taint implementation - linting problems (#95)
* add virtual-ip to certificate SAN entries

Adds the kube-vip IP as a Subject Alternative Name in the TLS cert. It is needed otherwise you cannot access the cluster.

* fixes bug with master taints (#1)

- improves taint logic

* fixes typo

* fixes formatting

* fixes undefined group['node'] if missing from hosts.ini (#2)

* fixes undefined group['node'] if missing from hosts.ini

- improves application of master taint by centralizing code

* improves molecule testing, fixes linting

* hacking at linter problems, small tweaks

- increases the metallb timeout error due to intermittent testing errors in GitHub actions

* improves context by renaming taint variable

- makes variable boolean

* fix bug

* removes linting hacks

Co-authored-by: Ioannis Angelakopoulos <ioangel@gmail.com>
2022-09-24 20:12:24 -05:00