FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: 'ansible.vars.hostvars.HostVarsVars object' has no attribute 'ansible_host'"}

See original GitHub issue

Describe the bug A clear and concise description of what the bug is.

Error when running final step of installation.

FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: 'ansible.vars.hostvars.HostVarsVars object' has no attribute 'ansible_host'"}

To Reproduce Steps to reproduce the behavior:

  1. Install on a fresh Raspian or Rocky linux system using these instructions: https://github.com/Kubeinit/kubeinit#directly-executing-the-deployment-playbook
  2. See this error output: full-error-output.txt

Expected behavior

A complete installation.

Screenshots If applicable, add screenshots to help explain your problem.

Infrastructure

  • Hypervisors OS: Raspian or Rocky Linux
  • Version: Raspbian GNU/Linux 11 (bullseye) & Rocky Linux release 8.5 (Green Obsidian)

Deployment command

Followed instructions.

Inventory file diff

Run the following command:

diff \
    <(curl https://raw.githubusercontent.com/Kubeinit/kubeinit/main/kubeinit/hosts/k8s/inventory) \
    <(curl https://raw.githubusercontent.com/Kubeinit/kubeinit/main/kubeinit/hosts/okd/inventory)

And paste the output:

$ diff \
    <(curl https://raw.githubusercontent.com/Kubeinit/kubeinit/main/kubeinit/hosts/k8s/inventory) \
    <(curl https://raw.githubusercontent.com/Kubeinit/kubeinit/main/kubeinit/hosts/okd/inventory)
   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                     % Total    % Received % Xferd  Average Speed   Time    Time        T i         Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 e  Curr--:--:-- --:--:-- --:--:--     0ent
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- 100    14  100    14    0     0     59      0 --:--:-- --:--:-- --:--:--    60
100    14  100    14    0     0     56      0 --:--:-- --:--:-- --:--:--    56

Additional context Add any other context about the problem here.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
ccamachocommented, Nov 27, 2022

I didnt see this again @jeffabailey I built all the packages for aarch64 but there are some changes needed in the guest vm images to have it running in ARM. (Rocky should work ootb I dont think this will ever work on a raspberry)

0reactions
SupremeGitcommented, Nov 28, 2022

Ok, if inventory is calculated dynamically, and you dont expect anyone to use it, then why do instructions say:

Adjust the inventory file to suit your needs.
By default the first hypervisor node is called nyctea (defined in the inventory). Replace it with the hostname you specified if you changed it. You can also use the names in the inventory as aliases for your own hostnames using 

It is no wonder people are struggling with this, when the instructions are misleading.

Further, the contents of the inventory file give this as an example of setting the ansible extravars:

# -e hypervisor_hosts_spec='[{"host":"hypervisor-01","ansible_host":"nyctea","ssh_hostname":"server1.example.com"}]'

But ccamacho on Jun 27 suggested Jeff use:

#-e hypervisor_hosts_spec='[[ansible_host=nyctea],[ansible_host=tyto]]'

That’s a completely different format for the var. So what is going on with that?

It would be helpful to clarify the syntax for this extra var - both, in the inventory file, and, in the main instructions!

Read more comments on GitHub >

github_iconTop Results From Across the Web

'ansible.vars.hostvars.HostVarsVars object' has no attribute ...
I had the same problem when I used -l 'server1.example.com' but when i changed -l 'all' it worked. The template has for host...
Read more >
'ansible.vars.hostvars.HostVarsVars object' has no attribute ...
This error happened when using raft as storage backend. TASK [ansible-community.ansible-vault : Vault main configuration] ...
Read more >
'ansible.vars.hostvars.HostVarsVars object' has no attribute ...
Hi all,. Below is my playbook. ... When I run the playbook, I get the below error message. ... Could someone help if...
Read more >
Create hosts files on remote host with j2 template : r/ansible
{"changed": false, "msg": "AnsibleUndefinedVariable: 'ansible.vars.hostvars.HostVarsVars object' has no attribute 'ansible_default_ipv4'"} ...
Read more >
Ceph ansible-playbook fails with 'ansible.vars.hostvars ...
msg : |- The task includes an option with an undefined variable. The error was: 'ansible.vars.hostvars.HostVarsVars object' has no attribute ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found