0

I had a problem when installing a kubernetes cluster of 3 masters and 6 workers and 1 ingress, I did not find that someone would have a similar problem. "TASK [kubespray-defaults : create fallback_ips_base] ***** fatal: [k8s-worker1]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'None' has no attribute 'get'\n\nThe error appears to be in '/kubespray/roles/kubespray-defaults/tasks/fallback_ips.yml': line 15, 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: create fallback_ips_base\n ^ here\n"}"

Command output printf "$(uname -srm)\n$(cat /etc/os-release)\n"
Linux 3.10.0-1160.62.1.el7.x86_64 x86_64
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

ansible --version
ansible 2.10.11
  config file = /kubespray/ansible.cfg
  configured module search path = ['/kubespray/library']
  ansible python module location = /usr/local/lib/python3.6/site-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 3.6.8 (default, Nov 16 2020, 16:55:22) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)]

Version of Python (python --version):
Python 2.7.5

Network plugin used:
flannel

nodes:
k8s-master1 ansible_host=172.16.18.141 ip=172.16.18.141
k8s-master2 ansible_host=172.16.18.133 ip=172.16.18.133
k8s-master3 ansible_host=172.16.18.134 ip=172.16.18.134
k8s-worker1 ansible_host=172.16.18.135 ip=172.16.18.135
k8s-worker2 ansible_host=172.16.18.136 ip=172.16.18.136
k8s-worker3 ansible_host=172.16.18.137 ip=172.16.18.137
k8s-worker4 ansible_host=172.16.18.138 ip=172.16.18.138
k8s-worker5 ansible_host=172.16.18.140 ip=172.16.18.140
k8s-worker6 ansible_host=172.16.18.139 ip=172.16.18.139
k8s-ingress ansible_host=172.16.18.142 ip=172.16.18.142

[kube_control_plane]
k8s-master1
k8s-master2
k8s-master3


[etcd]
k8s-master2
k8s-master3
k8s-master1

[kube_node]
k8s-worker1
k8s-worker2
k8s-worker3
k8s-worker4
k8s-worker5
k8s-worker6
k8s-ingress

[kube_ingress]
k8s-ingress

[k8s_cluster:children]
kube_node
kube_control_plane

ansible -m setup:

k8s-worker1 | SUCCESS => {
    "ansible_facts": {
        "ansible_apparmor": {
            "status": "disabled"
        },
        "ansible_architecture": "x86_64",
        "ansible_bios_date": "09/17/2015",
        "ansible_bios_vendor": "Phoenix Technologies LTD",
        "ansible_bios_version": "6.00",
        "ansible_board_asset_tag": "NA",
        "ansible_board_name": "440BX Desktop Reference Platform",
        "ansible_board_serial": "None",
        "ansible_board_vendor": "Intel Corporation",
        "ansible_board_version": "None",
        "ansible_chassis_asset_tag": "No Asset Tag",
        "ansible_chassis_serial": "None",
        "ansible_chassis_vendor": "No Enclosure",
        "ansible_chassis_version": "N/A",
        "ansible_cmdline": {
            "BOOT_IMAGE": "/vmlinuz-3.10.0-1160.62.1.el7.x86_64",
            "LANG": "en_US.UTF-8",
            "crashkernel": "auto",
            "quiet": true,
            "rd.lvm.lv": "centos/swap",
            "rhgb": true,
            "ro": true,
            "root": "/dev/mapper/centos-root"
        },
        "ansible_date_time": {
            "date": "2022-06-02",
            "day": "02",
            "epoch": "1654127793",
            "hour": "02",
            "iso8601": "2022-06-01T23:56:33Z",
            "iso8601_basic": "20220602T025633575892",
            "iso8601_basic_short": "20220602T025633",
            "iso8601_micro": "2022-06-01T23:56:33.575892Z",
            "minute": "56",
            "month": "06",
            "second": "33",
            "time": "02:56:33",
            "tz": "IDT",
            "tz_offset": "+0300",
            "weekday": "Thursday",
            "weekday_number": "4",
            "weeknumber": "22",
            "year": "2022"
        },
        "ansible_device_links": {
            "ids": {
                "dm-0": [
                    "dm-name-centos-root",
                    "dm-uuid-LVM-eq8RdwDh8UmVbxUDFSJojOlSDEbBTzsro1ok8rizmZLLezdQlepE8PQGLJUrOxrb"
                ],
                "dm-1": [
                    "dm-name-centos-swap",
                    "dm-uuid-LVM-eq8RdwDh8UmVbxUDFSJojOlSDEbBTzsrRm5FHwbU4faE1weTgRbY2xdwQJs5YPpJ"
                ],
                "dm-2": [
                    "dm-name-centos-home",
                    "dm-uuid-LVM-eq8RdwDh8UmVbxUDFSJojOlSDEbBTzsr0wXP3uZEc9Ld1tvj3Cx9dKlN4MhfsbBF"
                ],
                "sda2": [
                    "lvm-pv-uuid-J3cGFq-UpST-uNKu-8iTN-iWep-Kpxo-Sokz40"
                ],
                "sr0": [
                    "ata-VMware_Virtual_SATA_CDRW_Drive_00000000000000000001"
                ]
            },
            "labels": {},
            "masters": {
                "sda2": [
                    "dm-0",
                    "dm-1",
                    "dm-2"
                ]
            },
            "uuids": {
                "dm-0": [
                    "cdd909fe-d39a-4ea9-8959-fe1aca72a2e8"
                ],
                "dm-1": [
                    "52b08951-ea16-4abe-8315-35a4261eaef7"
                ],
                "dm-2": [
                    "18ecd858-0042-4e4d-8c9d-f15236a1c9c7"
                ],
                "sda1": [
                    "11285025-905b-4798-8560-d1d8900fc90c"
                ]
            }
        },
        "ansible_devices": {
            "dm-0": {
                "holders": [],
                "host": "",
                "links": {
                    "ids": [
                        "dm-name-centos-root",
                        "dm-uuid-LVM-eq8RdwDh8UmVbxUDFSJojOlSDEbBTzsro1ok8rizmZLLezdQlepE8PQGLJUrOxrb"
                    ],
                    "labels": [],
                    "masters": [],
                    "uuids": [
                        "cdd909fe-d39a-4ea9-8959-fe1aca72a2e8"
                    ]
                },
                "model": null,
                "partitions": {},
                "removable": "0",
                "rotational": "1",
                "sas_address": null,
                "sas_device_handle": null,
                "scheduler_mode": "",
                "sectors": "104857600",
                "sectorsize": "512",
                "size": "50.00 GB",
                "support_discard": "0",
                "vendor": null,
                "virtual": 1
            },
            "dm-1": {
                "holders": [],
                "host": "",
                "links": {
                    "ids": [
                        "dm-name-centos-swap",
                        "dm-uuid-LVM-eq8RdwDh8UmVbxUDFSJojOlSDEbBTzsrRm5FHwbU4faE1weTgRbY2xdwQJs5YPpJ"
                    ],
                    "labels": [],
                    "masters": [],
                    "uuids": [
                        "52b08951-ea16-4abe-8315-35a4261eaef7"
                    ]
                },
                "model": null,
                "partitions": {},
                "removable": "0",
                "rotational": "1",
                "sas_address": null,
                "sas_device_handle": null,
                "scheduler_mode": "",
                "sectors": "12320768",
                "sectorsize": "512",
                "size": "5.88 GB",
                "support_discard": "0",
                "vendor": null,
                "virtual": 1
            },
            "dm-2": {
                "holders": [],
                "host": "",
                "links": {
                    "ids": [
                        "dm-name-centos-home",
                        "dm-uuid-LVM-eq8RdwDh8UmVbxUDFSJojOlSDEbBTzsr0wXP3uZEc9Ld1tvj3Cx9dKlN4MhfsbBF"
                    ],
                    "labels": [],
                    "masters": [],
                    "uuids": [
                        "18ecd858-0042-4e4d-8c9d-f15236a1c9c7"
                    ]
                },
                "model": null,
                "partitions": {},
                "removable": "0",
                "rotational": "1",
                "sas_address": null,
                "sas_device_handle": null,
                "scheduler_mode": "",
                "sectors": "90423296",
                "sectorsize": "512",
                "size": "43.12 GB",
                "support_discard": "0",
                "vendor": null,
                "virtual": 1
            },
            "fd0": {
                "holders": [],
                "host": "",
                "links": {
                    "ids": [],
                    "labels": [],
                    "masters": [],
                    "uuids": []
                },
                "model": null,
                "partitions": {},
                "removable": "1",
                "rotational": "1",
                "sas_address": null,
                "sas_device_handle": null,
                "scheduler_mode": "deadline",
                "sectors": "8",
                "sectorsize": "512",
                "size": "4.00 KB",
                "support_discard": "0",
                "vendor": null,
                "virtual": 1
            },
            "sda": {
                "holders": [],
                "host": "",
                "links": {
                    "ids": [],
                    "labels": [],
                    "masters": [],
                    "uuids": []
                },
                "model": "Virtual disk",
                "partitions": {
                    "sda1": {
                        "holders": [],
                        "links": {
                            "ids": [],
                            "labels": [],
                            "masters": [],
                            "uuids": [
                                "11285025-905b-4798-8560-d1d8900fc90c"
                            ]
                        },
                        "sectors": "2097152",
                        "sectorsize": 512,
                        "size": "1.00 GB",
                        "start": "2048",
                        "uuid": "11285025-905b-4798-8560-d1d8900fc90c"
                    },
                    "sda2": {
                        "holders": [
                            "centos-root",
                            "centos-swap",
                            "centos-home"
                        ],
                        "links": {
                            "ids": [
                                "lvm-pv-uuid-J3cGFq-UpST-uNKu-8iTN-iWep-Kpxo-Sokz40"
                            ],
                            "labels": [],
                            "masters": [
                                "dm-0",
                                "dm-1",
                                "dm-2"
                            ],
                            "uuids": []
                        },
                        "sectors": "207616000",
                        "sectorsize": 512,
                        "size": "99.00 GB",
                        "start": "2099200",
                        "uuid": null
                    }
                },
                "removable": "0",
                "rotational": "1",
                "sas_address": null,
                "sas_device_handle": null,
                "scheduler_mode": "deadline",
                "sectors": "209715200",
                "sectorsize": "512",
                "size": "100.00 GB",
                "support_discard": "0",
                "vendor": "VMware",
                "virtual": 1
            },
            "sr0": {
                "holders": [],
                "host": "",
                "links": {
                    "ids": [
                        "ata-VMware_Virtual_SATA_CDRW_Drive_00000000000000000001"
                    ],
                    "labels": [],
                    "masters": [],
                    "uuids": []
                },
                "model": "VMware SATA CD00",
                "partitions": {},
                "removable": "1",
                "rotational": "1",
                "sas_address": null,
                "sas_device_handle": null,
                "scheduler_mode": "deadline",
                "sectors": "2097151",
                "sectorsize": "512",
                "size": "1024.00 MB",
                "support_discard": "0",
                "vendor": "NECVMWar",
                "virtual": 1
            }
        },
        "ansible_distribution": "CentOS",
        "ansible_distribution_file_parsed": true,
        "ansible_distribution_file_path": "/etc/redhat-release",
        "ansible_distribution_file_variety": "RedHat",
        "ansible_distribution_major_version": "7",
        "ansible_distribution_release": "Core",
        "ansible_distribution_version": "7.9",
        "ansible_dns": {
            "nameservers": [
                "172.16.1.1"
            ]
        },
        "ansible_domain": "s000.local",
        "ansible_effective_group_id": 0,
        "ansible_effective_user_id": 0,
        "ansible_env": {
            "HOME": "/root",
            "LANG": "C",
            "LC_ALL": "C",
            "LC_NUMERIC": "C",
            "LESSOPEN": "||/usr/bin/lesspipe.sh %s",
            "LOGNAME": "root",
            "MAIL": "/var/mail/root",
            "PATH": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin",
            "PWD": "/root",
            "SELINUX_LEVEL_REQUESTED": "",
            "SELINUX_ROLE_REQUESTED": "",
            "SELINUX_USE_CURRENT_RANGE": "",
            "SHELL": "/bin/bash",
            "SHLVL": "2",
            "SSH_CLIENT": "172.16.18.131 42184 22",
            "SSH_CONNECTION": "172.16.18.131 42184 172.16.18.135 22",
            "USER": "root",
            "XDG_RUNTIME_DIR": "/run/user/0",
            "XDG_SESSION_ID": "19",
            "_": "/usr/bin/python"
        },
        "ansible_fibre_channel_wwn": [],
        "ansible_fips": false,
        "ansible_form_factor": "Other",
        "ansible_fqdn": "k8s-worker1.s000.local",
        "ansible_hostname": "k8s-worker1",
        "ansible_hostnqn": "",
        "ansible_is_chroot": false,
        "ansible_iscsi_iqn": "",
        "ansible_kernel": "3.10.0-1160.62.1.el7.x86_64",
        "ansible_kernel_version": "#1 SMP Tue Apr 5 16:57:59 UTC 2022",
        "ansible_local": {},
        "ansible_lsb": {},
        "ansible_lvm": {
            "lvs": {
                "home": {
                    "size_g": "43.12",
                    "vg": "centos"
                },
                "root": {
                    "size_g": "50.00",
                    "vg": "centos"
                },
                "swap": {
                    "size_g": "5.88",
                    "vg": "centos"
                }
            },
            "pvs": {
                "/dev/sda2": {
                    "free_g": "0.00",
                    "size_g": "99.00",
                    "vg": "centos"
                }
            },
            "vgs": {
                "centos": {
                    "free_g": "0.00",
                    "num_lvs": "3",
                    "num_pvs": "1",
                    "size_g": "99.00"
                }
            }
        },
        "ansible_machine": "x86_64",
        "ansible_machine_id": "32496b187f444d3b95eeafeb0fce0cae",
        "ansible_memfree_mb": 5297,
        "ansible_memory_mb": {
            "nocache": {
                "free": 5508,
                "used": 297
            },
            "real": {
                "free": 5297,
                "total": 5805,
                "used": 508
            },
            "swap": {
                "cached": 0,
                "free": 0,
                "total": 0,
                "used": 0
            }
        },
        "ansible_memtotal_mb": 5805,
        "ansible_mounts": [
            {
                "block_available": 210041,
                "block_size": 4096,
                "block_total": 259584,
                "block_used": 49543,
                "device": "/dev/sda1",
                "fstype": "xfs",
                "inode_available": 523954,
                "inode_total": 524288,
                "inode_used": 334,
                "mount": "/boot",
                "options": "rw,seclabel,relatime,attr2,inode64,noquota",
                "size_available": 860327936,
                "size_total": 1063256064,
                "uuid": "11285025-905b-4798-8560-d1d8900fc90c"
            },
            {
                "block_available": 12278107,
                "block_size": 4096,
                "block_total": 13100800,
                "block_used": 822693,
                "device": "/dev/mapper/centos-root",
                "fstype": "xfs",
                "inode_available": 26161376,
                "inode_total": 26214400,
                "inode_used": 53024,
                "mount": "/",
                "options": "rw,seclabel,relatime,attr2,inode64,noquota",
                "size_available": 50291126272,
                "size_total": 53660876800,
                "uuid": "cdd909fe-d39a-4ea9-8959-fe1aca72a2e8"
            },
            {
                "block_available": 11289145,
                "block_size": 4096,
                "block_total": 11297393,
                "block_used": 8248,
                "device": "/dev/mapper/centos-home",
                "fstype": "xfs",
                "inode_available": 22605821,
                "inode_total": 22605824,
                "inode_used": 3,
                "mount": "/home",
                "options": "rw,seclabel,relatime,attr2,inode64,noquota",
                "size_available": 46240337920,
                "size_total": 46274121728,
                "uuid": "18ecd858-0042-4e4d-8c9d-f15236a1c9c7"
            }
        ],
        "ansible_nodename": "k8s-worker1",
        "ansible_os_family": "RedHat",
        "ansible_pkg_mgr": "yum",
        "ansible_proc_cmdline": {
            "BOOT_IMAGE": "/vmlinuz-3.10.0-1160.62.1.el7.x86_64",
            "LANG": "en_US.UTF-8",
            "crashkernel": "auto",
            "quiet": true,
            "rd.lvm.lv": [
                "centos/root",
                "centos/swap"
            ],
            "rhgb": true,
            "ro": true,
            "root": "/dev/mapper/centos-root"
        },
        "ansible_processor": [
            "0",
            "GenuineIntel",
            "Intel(R) Xeon(R) CPU E5-2650 v2 @ 2.60GHz",
            "1",
            "GenuineIntel",
            "Intel(R) Xeon(R) CPU E5-2650 v2 @ 2.60GHz",
            "2",
            "GenuineIntel",
            "Intel(R) Xeon(R) CPU E5-2650 v2 @ 2.60GHz",
            "3",
            "GenuineIntel",
            "Intel(R) Xeon(R) CPU E5-2650 v2 @ 2.60GHz"
        ],
        "ansible_processor_cores": 1,
        "ansible_processor_count": 4,
        "ansible_processor_nproc": 4,
        "ansible_processor_threads_per_core": 1,
        "ansible_processor_vcpus": 4,
        "ansible_product_name": "VMware Virtual Platform",
        "ansible_product_serial": "VMware-56 4d f7 52 8a 2f 19 11-ea 9d 2f c8 ed 50 ef 3e",
        "ansible_product_uuid": "564DF752-8A2F-1911-EA9D-2FC8ED50EF3E",
        "ansible_product_version": "None",
        "ansible_python": {
            "executable": "/usr/bin/python",
            "has_sslcontext": true,
            "type": "CPython",
            "version": {
                "major": 2,
                "micro": 5,
                "minor": 7,
                "releaselevel": "final",
                "serial": 0
            },
            "version_info": [
                2,
                7,
                5,
                "final",
                0
            ]
        },
        "ansible_python_version": "2.7.5",
        "ansible_real_group_id": 0,
        "ansible_real_user_id": 0,
        "ansible_selinux": {
            "config_mode": "permissive",
            "mode": "permissive",
            "policyvers": 31,
            "status": "enabled",
            "type": "targeted"
        },
        "ansible_selinux_python_present": true,
        "ansible_service_mgr": "systemd",
        "ansible_ssh_host_key_ecdsa_public": "AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBHqsSpmuUFd15ttkWjkpvPgflGaP1ESchUZA8MI0CTviJIHUCz2h3mH1PMTMZwqnaAkdOp1sJQjT09omvBBets0=",
        "ansible_ssh_host_key_ecdsa_public_keytype": "ecdsa-sha2-nistp256",
        "ansible_ssh_host_key_ed25519_public": "AAAAC3NzaC1lZDI1NTE5AAAAIEaCutePk/HnsQX6kFpBZxPqCIfF8i7kYnj5xRQjBI6A",
        "ansible_ssh_host_key_ed25519_public_keytype": "ssh-ed25519",
        "ansible_ssh_host_key_rsa_public": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDAzM6HtHaQKXZEZ127SSzfLkr4WEz2EGWdTRKZJCQWsxwJmMckWOP7gaC5jHEQ50pu03BH0JrSq9sH4mBuxkB7tudsEMruoSYmfODvrJ39aQDTtDCbrtCvXWLcFmtwfpawrN2FrsqMz7wrvcfSR/t8Nmx3eRtuSXhFTj30mQJ9bEUQHuL3+BGrjaJArzFVWvbkvuPFn1nvAYdoXwSGrBIFq6vVNyA+1IIt3bZH1ZRMwPxCqQ2xxZA8nRnxGSpaZaNN9DiM+64Z1goTzFAXZXRDpx2YqyDF7vImNRpuJFNTCHpCHTbFWVjBre51HAgJoTLen+LafiF52elaGTgS+H6l",
        "ansible_ssh_host_key_rsa_public_keytype": "ssh-rsa",
        "ansible_swapfree_mb": 0,
        "ansible_swaptotal_mb": 0,
        "ansible_system": "Linux",
        "ansible_system_capabilities": [
            "cap_chown",
            "cap_dac_override",
            "cap_dac_read_search",
            "cap_fowner",
            "cap_fsetid",
            "cap_kill",
            "cap_setgid",
            "cap_setuid",
            "cap_setpcap",
            "cap_linux_immutable",
            "cap_net_bind_service",
            "cap_net_broadcast",
            "cap_net_admin",
            "cap_net_raw",
            "cap_ipc_lock",
            "cap_ipc_owner",
            "cap_sys_module",
            "cap_sys_rawio",
            "cap_sys_chroot",
            "cap_sys_ptrace",
            "cap_sys_pacct",
            "cap_sys_admin",
            "cap_sys_boot",
            "cap_sys_nice",
            "cap_sys_resource",
            "cap_sys_time",
            "cap_sys_tty_config",
            "cap_mknod",
            "cap_lease",
            "cap_audit_write",
            "cap_audit_control",
            "cap_setfcap",
            "cap_mac_override",
            "cap_mac_admin",
            "cap_syslog",
            "35",
            "36+ep"
        ],
        "ansible_system_capabilities_enforced": "True",
        "ansible_system_vendor": "VMware, Inc.",
        "ansible_uptime_seconds": 56108,
        "ansible_user_dir": "/root",
        "ansible_user_gecos": "root",
        "ansible_user_gid": 0,
        "ansible_user_id": "root",
        "ansible_user_shell": "/bin/bash",
        "ansible_user_uid": 0,
        "ansible_userspace_architecture": "x86_64",
        "ansible_userspace_bits": "64",
        "ansible_virtualization_role": "guest",
        "ansible_virtualization_type": "VMware",
        "gather_subset": [
            "all"
        ],
        "module_setup": true
    },
    "changed": false
}
  • which branch/release of kubespray are you using? 2.17.1 or something? Could you share your inventory as well? Can we see the facts for one of those nodes (ansible -m setup some-node)? Cloud you share logs for the few tasks just before the one that failed ("Gather ansible_default_ipv4 from xxx")? – SYN Jun 01 '22 at 19:55
  • I used last release kubespray. – Игорь Админ Jun 01 '22 at 23:43
  • @SYN I'm sorry, i didn't understand question: "Cloud you share logs for the few tasks just before the one that failed ("Gather ansible_default_ipv4 from xxx")? " – Игорь Админ Jun 02 '22 at 00:07
  • Logs for the few tasks running before the "kubespray-defaults : create fallback_ips_base" failing in your playbook would have been interesting. But your "ansible -m setup" kind of answers it already. Not sure why or how: ansible doesn't set ANY fact related to networking?!! no ansible_default_ipv4, ansible_ens3 or ansible_eth0 or ansible_lo ... how could this be?! something's wrong with your ansible setup, or maybe some configuration preventing some facts from being collected? Is there anything special about your ansible node? – SYN Jun 03 '22 at 18:16

0 Answers0