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

Ansible playbook 'reboot' task should use Ansible's reboot module #1732

Closed
geerlingguy opened this issue May 2, 2020 · 2 comments
Closed

Comments

@geerlingguy
Copy link
Contributor

Version:

N/A

K3s arguments:

N/A

Describe the bug

After applying the fix in #1730, to make the 'reboot on raspbian' task actually work (without a fatal error), I realized that this causes another problem: when the ARM servers reboot mid-playbook, the playbook fails. Even if only the master node fails, everything else will fail at the Copy the K3s service file task with the message:

AnsibleUndefinedVariable: 'ansible.vars.hostvars.HostVarsVars object' has no attribute 'token'

To Reproduce

Run the Ansible playbook on ARM servers.

Expected behavior

The playbook completes successfully, and reboots the ARM servers as required in the Rebooting on Raspbian task.

Actual behavior

TASK [raspbian : Rebooting on Raspbian] ********************************************************************************
Saturday 02 May 2020  11:36:06 -0500 (0:00:02.881)       0:00:38.813 ********** 
skipping: [worker-01]
skipping: [worker-02]
skipping: [worker-03]
skipping: [worker-04]
skipping: [worker-05]
skipping: [worker-06]
fatal: [turing-master]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: Shared connection to turing-master closed.", "unreachable": true}

Which, in turn, causes all the other hosts to fail:

TASK [k3s/node : Copy K3s service file] ********************************************************************************
Saturday 02 May 2020  11:36:14 -0500 (0:00:06.435)       0:00:46.844 ********** 
fatal: [worker-01]: FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: 'ansible.vars.hostvars.HostVarsVars object' has no attribute 'token'"}
fatal: [worker-02]: FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: 'ansible.vars.hostvars.HostVarsVars object' has no attribute 'token'"}
fatal: [worker-03]: FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: 'ansible.vars.hostvars.HostVarsVars object' has no attribute 'token'"}
fatal: [worker-05]: FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: 'ansible.vars.hostvars.HostVarsVars object' has no attribute 'token'"}
fatal: [worker-04]: FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: 'ansible.vars.hostvars.HostVarsVars object' has no attribute 'token'"}
fatal: [worker-06]: FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: 'ansible.vars.hostvars.HostVarsVars object' has no attribute 'token'"}

Additional context / logs

N/A

@geerlingguy
Copy link
Contributor Author

Opened PR: #1733

@geerlingguy
Copy link
Contributor Author

Moved to k3s-ansible repo here: k3s-io/k3s-ansible#5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant