Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove node (remove-node.yml) not working in kubespray 2.11 #5160

Closed
mjlshen opened this issue Sep 10, 2019 · 3 comments
Closed

Remove node (remove-node.yml) not working in kubespray 2.11 #5160

mjlshen opened this issue Sep 10, 2019 · 3 comments
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@mjlshen
Copy link
Contributor

mjlshen commented Sep 10, 2019

Environment:

  • Cloud provider or hardware configuration:
    Bare-metal VMs

  • OS:
    Linux 3.10.0-957.21.3.el7.x86_64 x86_64
    NAME="Red Hat Enterprise Linux Server"
    VERSION="7.6 (Maipo)"
    ID="rhel"
    ID_LIKE="fedora"
    VARIANT="Server"
    VARIANT_ID="server"
    VERSION_ID="7.6"
    PRETTY_NAME="Red Hat Enterprise Linux"
    ANSI_COLOR="0;31"
    CPE_NAME="cpe:/o:redhat:enterprise_linux:7.6:GA:server"
    HOME_URL="https://www.redhat.com/"
    BUG_REPORT_URL="https://bugzilla.redhat.com/"
    REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 7"
    REDHAT_BUGZILLA_PRODUCT_VERSION=7.6
    REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
    REDHAT_SUPPORT_PRODUCT_VERSION="7.6"

  • Version of Ansible:
    Ansible 2.7.10

Kubespray version (commit) (git rev-parse --short HEAD):
2.11 (86cc703)

Network plugin used:
Calico

Command used to invoke ansible:
Recommended command in README, but with relevant changes in inventory file/ssh key/nodes to remove

ansible-playbook -i inventory/mycluster/hosts.yml remove-node.yml -b -v \
  --private-key=~/.ssh/private_key \
  --extra-vars "node=nodename,nodename2"

Output of ansible run:

"The conditional check 'ansible_os_family not in
["CoreOS", "Container Linux by CoreOS"]' failed.
The error was: error while evaluating conditional
(ansible_os_family not in ["CoreOS", "Container Linux by CoreOS"]):
'ansible_os_family' is undefined

The error appears to have been in '/var/lib/awx/projects/_9__kubespray_211/roles/reset/tasks/main.yml': line 289, column 3,
but may be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be: 

- name: reset | Restart network
^ here"
@mjlshen mjlshen added the kind/bug Categorizes issue or PR as related to a bug. label Sep 10, 2019
@mjlshen
Copy link
Contributor Author

mjlshen commented Sep 10, 2019

Is it possible that this should be gather_facts: true? If so, I'm happy to submit a pull request.

remove-node.yml

- hosts: "{{ node | default('kube-node') }}"
  gather_facts: no
  roles:
    - { role: kubespray-defaults }
    - { role: reset, tags: reset, when: reset_nodes|default(True) }

@holmesb
Copy link
Contributor

holmesb commented Sep 13, 2019

Yes I'm seeing this too. Changing to gather_facts: yes fixes for me.

- hosts: "{{ node | default('kube-node') }}"
  gather_facts: yes

Not tested, but fair to assume the same will occur when trying to remove a master.

k8s-ci-robot pushed a commit that referenced this issue Sep 17, 2019
erulabs added a commit to kubesail/kubespray that referenced this issue Sep 18, 2019
* 'master' of https://github.com/kubernetes-sigs/kubespray:
  Add support for k8s v1.14.6 (kubernetes-sigs#5182)
  Parameterize gcr, quay, and docker image repo defines (kubernetes-sigs#5146)
  use hyperkubeimage to run controlplane containers (kubernetes-sigs#5178)
  Update main.yml (kubernetes-sigs#5166)
  Fixes issue kubernetes-sigs#5160 (kubernetes-sigs#5171)
  Use more native way to update kubeconfigs using kubeadm (kubernetes-sigs#5165)
  Fix macro on local_volume_provisioner (kubernetes-sigs#5168)
  Move cri_socket var to kubespray-defaults (kubernetes-sigs#5149)
  Add support for k8s v1.16.0-beta.2 (kubernetes-sigs#5148)
  Fix ansible task titles (kubernetes-sigs#5154)
  Adjust endpoints for kube-proxy,controller,scheduler to proper ip (kubernetes-sigs#5150)
  Documenting Terraform variable `az_list` explicitly (kubernetes-sigs#5132)
  Make haproxy/nginx client timeout configurable (kubernetes-sigs#5140)
  print hostnames (kubernetes-sigs#5110)
  Cleanup: fix typo in doc (kubernetes-sigs#5105)
  Use python3-libselinux on RHEL8/Centos8 (kubernetes-sigs#5127)
@mjlshen
Copy link
Contributor Author

mjlshen commented Sep 30, 2019

Seems fixed to me, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants