snowdrop / k8s-infra

Information to bootstrap vms using dedicated server, local machine and setup using Ansible Playbooks
Apache License 2.0
29 stars 14 forks source link

Error when creating a OpenStack VM without setting the default key #328

Closed jacobdotcosta closed 1 year ago

jacobdotcosta commented 1 year ago

Error when creating a OpenStack VM without setting the default key.

The command is:

ansible-playbook playbook/openstack/openstack_vm_create_passwordstore.yml -e k8s_type=masters -e k8s_version=123 -e '{"openstack": {"vm": {"network": "provider_net_shared","image": "Fedora-Cloud-Base-35", "flavor": "m1.medium"}}}' -e key_name=test-adm-key -e vm_name=${VM_NAME}

The error is:

TASK [openstack/vm : Create VM instance] *********************************************************************************************************************************************************************************************
Thursday 15 June 2023  10:06:52 +0200 (0:00:00.088)       0:00:37.426 ********* 
fatal: [localhost]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'dict object' has no attribute 'openstack_keypairs'. 'dict object' has no attribute 'openstack_keypairs'\n\nThe error appears to be in '/home/ajc102/docs/redhat/forks-github/k8s-infra/ansible/roles/openstack/vm/tasks/vm_create.yml': line 95, column 5, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n  - name: \"Create VM instance\"\n    ^ here\n"}
jacobdotcosta commented 1 year ago

The problem might be related with upgrading the openstacksdk version as some variable has changed name.