Description
What happened?
When I ran the command “ansible-playbook -i inventory/kylin/inventory.ini cluster.yml -t bootstrap_os”, I encountered the following error
"msg": "The conditional check 'systemd_resolved_enabled.rc != 0' failed. The error was: error while evaluating conditional (systemd_resolved_enabled.rc != 0): 'systemd_resolved_enabled' is undefined. 'systemd_resolved_enabled' is undefined\n\nThe error appears to be in '/kubespray/roles/kubernetes/preinstall/tasks/0060-resolvconf.yml': line 2, 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: Test systemd_resolved_enabled\n ^ here\n"
The systemd_resolved_enabled.rc variable is defined in the file roles/kubernetes/preinstall/tasks/0020-set_facts.yml, but the task importing this file does not have a tag for bootstrap_os
cat ./roles/kubernetes/preinstall/tasks/main.yml
……
- name: Set facts
import_tasks: 0020-set_facts.yml
tags:
- resolvconf
- facts
……
What did you expect to happen?
For tasks " Set facts" add tag "bootstrap_os"
How can we reproduce it (as minimally and precisely as possible)?
Run "ansible-playbook -i inventory/kylin/inventory.ini cluster.yml -t bootstrap_os"
OS
RHEL 8
Version of Ansible
2.16.14
Version of Python
Python 3.10.12
Version of Kubespray (commit)
v2.28.0
Network plugin used
calico
Full inventory with variables
[all]
master1 ansible_host=10.42.39.205 ansible_user=root
node1 ansible_host=10.42.39.206 ansible_user=root
[kube_control_plane]
master1 ansible_host=10.42.39.205 ansible_user=root
node1 ansible_host=95.54.0.12 # ip=10.3.0.1 etcd_member_name=etcd1
node2 ansible_host=95.54.0.13 # ip=10.3.0.2 etcd_member_name=etcd2
node3 ansible_host=95.54.0.14 # ip=10.3.0.3 etcd_member_name=etcd3
[etcd:children]
kube_control_plane
[kube_node]
node1 ansible_host=10.42.39.206 ansible_user=root
Command used to invoke ansible
ansible-playbook -i inventory/kylin/inventory.ini cluster.yml -t bootstrap_os
Output of ansible run
"msg": "The conditional check 'systemd_resolved_enabled.rc != 0' failed. The error was: error while evaluating conditional (systemd_resolved_enabled.rc != 0): 'systemd_resolved_enabled' is undefined. 'systemd_resolved_enabled' is undefined\n\nThe error appears to be in '/kubespray/roles/kubernetes/preinstall/tasks/0060-resolvconf.yml': line 2, 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: Test systemd_resolved_enabled\n ^ here\n"
Anything else we need to know
No response