0

I'm trying to run Ansible playbook remove-node.yml from Kubespray repository. But when I run a job I get an error:

TASK [check confirmation] ******************************************************
fatal: [node61]: FAILED! => {"changed": false, "msg": "Delete nodes confirmation failed"}

I'm doing it through GitLabCI and here is my .gitlab-ci.yml:

stages:
  - deploy

image: ***/releases/kubespray:v2.12.5

variables:
  ANSIBLE_HOST_KEY_CHECKING: "False"

before_script:
    - mkdir -p ~/.ssh
    - echo "$id_rsa" | base64 -d > ~/.ssh/id_rsa
    - chmod -R 700 ~/.ssh

delete_node:
  stage: deploy
  when: manual
  script:
    - ansible-playbook -v -u root --key-file=~/.ssh/id_rsa --extra-vars skip_confirmation=yes -i inventory/hosts.ini /kubespray/remove-node.yml -e "node=node61"  

I've tried check_confirmation, skip_confirmation=true, True or 'true' and other variations, but none of them works

2 Answers2

1

The required variable is delete_nodes_confirmation not skip_confirmation.
So the answer is delete_nodes_confirmation=yes.

β.εηοιτ.βε
  • 33,893
  • 13
  • 69
  • 83
RedBluff
  • 43
  • 1
  • 7
0

Can you run your script like this?

ansible-playbook -v -u root --key-file=~/.ssh/id_rsa -i inventory/hosts.ini /kubespray/remove-node.yml --extra-var "node=node61 skip_confirmation=true"
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Oct 13 '21 at 13:23