techno-tim / k3s-ansible

The easiest way to bootstrap a self-hosted High Availability Kubernetes cluster. A fully automated HA k3s etcd install with kube-vip, MetalLB, and more. Build. Destroy. Repeat.

Home Page:https://technotim.live/posts/k3s-etcd-ansible/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ansible error using almost default values and metallb service LB

sharifm-informatica opened this issue · comments

Expected Behavior

playbook would run and install

Current Behavior

FATAL: FAILED! => {"msg": "The conditional check 'kube_vip_lb_ip_range is not defined and (not cilium_bgp or cilium_iface is not defined)' failed. The error was: error while evaluating conditional (kube_vip_lb_ip_range is not defined and (not cilium_bgp or cilium_iface is not defined)): 'cilium_bgp' is undefined. 'cilium_bgp' is undefined\n\nThe error appears to be in '/playbook/roles/k3s_server/tasks/main.yml': line 29, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Deploy metallb manifest\n ^ here\n"}

Steps to Reproduce

  1. keep almost all groupvars at the default as per latest release
  2. run the playbook
  3. cilium_bgp is undefined as per old vars

if cilium_bgp is defined the error does not occur. Possible breaking change for older configs

Possible Solution

1- change line 32 in /roles/k3s_server/tasks/main.yml to when: kube_vip_lb_ip_range is not defined and (not cilium_bgp is not defined or cilium_iface is not defined)

2- change line 15 in /roles/k3s_server_post/tasks/main.yml to when: kube_vip_lb_ip_range is not defined and (not cilium_bgp is not defined or cilium_iface is not defined)

This may require another case for when it is defined and false.

can you please attach your groupvars?