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

Error at task "Add new hosts to the dynamic inventory" #2

Open
hubitor opened this issue Jan 9, 2020 · 3 comments
Open

Error at task "Add new hosts to the dynamic inventory" #2

hubitor opened this issue Jan 9, 2020 · 3 comments

Comments

@hubitor
Copy link

hubitor commented Jan 9, 2020

I'm getting the following error when I run the playbook:

TASK [siw36.ansible_hcloud_vm : Add new hosts to the dynamic inventory] ***************************************
fatal: [localhost]: FAILED! => {"msg": "Invalid data passed to 'loop', it requires a list, got this instead: [{'server': AnsibleUndefined, 'ipv4': AnsibleUndefined, 'ipv6': AnsibleUndefined}]. Hint: If you passed a list/dict of just one element, try adding wantlist=True to your lookup invocation or use q/query instead of lookup."}
@siw36
Copy link
Owner

siw36 commented Jan 9, 2020

Seems like the return variables of the hcloud_server module were empty. Did the deployment of the VM succeed?

@hubitor
Copy link
Author

hubitor commented Jan 9, 2020

Did the deployment of the VM succeed?

Nope.

EDIT

In the previous step I get this:

TASK [siw36.ansible_hcloud_vm : Create server inventory] *********************************************
ok: [localhost] => (item={'changed': False, 'hcloud_server': None, 'invocation': {'module_args': {'api_token': 'VALUE_SPECIFIED_IN_NO_LOG_PARAMETER', 'name': 'test0.nodes.replicas.io', 'server_type': 'cx11', 'image': 'centos-7', 'location': 'hel1', 'backups': False, 'ssh_keys': ['root'], 'state': 'absent', 'labels': {'project': 'project-test-07', 'stage': 'prod', 'location': 'helsinki'}, 'upgrade_disk': False, 'force_upgrade': False, 'endpoint': 'https://api.hetzner.cloud/v1', 'id': None, 'datacenter': None, 'user_data': None, 'volumes': None, 'rescue_mode': None}}, 'failed': False, 'item': {'name': 'test0.nodes.replicas.io', 'state': 'absent', 'size': 'cx11', 'location': 'hel1', 'image': 'centos-7', 'backup': False, 'sshKeys': ['siw'], 'labels': {'project': 'project-test-07', 'stage': 'prod', 'location': 'helsinki'}, 'volumes': [{'name': 'test0.nodes.replicas.io-data0', 'state': 'absent', 'size': 10, 'automount': True, 'format': 'xfs'}]}, 'ansible_loop_var': 'item'})

So, if the error stems from 'hcloud_server': None how can fix it?

@siw36
Copy link
Owner

siw36 commented Jan 13, 2020

It seems like you have not replaced all example variables like 'sshKeys': ['siw']

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

No branches or pull requests

2 participants