Kubeinit / kubeinit

Ansible automation to have a KUBErnetes cluster INITialized as soon as possible...

Home Page:https://www.kubeinit.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Uninstall fails due to no ansible_default_ipv4_address attribute

nadenf opened this issue · comments

Describe the bug
Uninstall fails due to no ansible_default_ipv4_address attribute

To Reproduce
Steps to reproduce the behavior:

Run the uninstall script here except using EKS as inventory type:
https://docs.kubeinit.com/usage.html

Infrastructure

  • Hypervisors OS: Ubuntu 21.04

Deployment command

ansible-playbook \
    --user root \
    -v -i ./hosts/eks/inventory \
    --become \
    --become-user root \
    ./playbooks/clean.yml

Error message

TASK [../../roles/kubeinit_prepare : Define additional host, node and services facts] ******
fatal: [hypervisor-01]: FAILED! => {
	"msg": "The task includes an option with an undefined variable. The error was: 'ansible.vars.hostvars.HostVarsVars object' has no attribute 'ansible_default_ipv4_address'\n\nThe error appears to be in '/opt/kubeinit/kubeinit/roles/kubeinit_prepare/tasks/main.yml': line 87, 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: Define additional host, node and services facts\n  ^ here\n"
}

Inventory file diff

< hypervisor-01 ansible_host=harana
---
> hypervisor-01 ansible_host=nyctea

@nadenf can you check if this is still an issue? the latest code has some new support builtin for stop after the cleanup tasks so instead of creating a clean.yml you should be able to use the same command you used to deploy the cluster and just add this additional command line argument: -e kubeinit_stop_after_task=task-cleanup-hypervisors

I'm working on additional changes that should allow greater control over which tasks in the playbook you can start and/or stop on, but I think the cleanup task should work already with the latest update.