Hello,
I'm new in this Openstack world and I love Ansible. I'm trying to use
the openstack.cloud Ansible collection to manage virtual machines.
There is no problems in adding or deleting a virtual machine (vm). The
openstack.cloud.server module works very well.
I'm in trouble if I want to update a vm. The server module has only the
"present" state: the resource is not updated after the creation if I
change something in the module parameters.
So, I can't use openstack.cloud.server module in order to change the
flavor or security group of an already existing vm.
The "server_action" module is not useful because it has not update
actions about sg or flavor.
I tried the CRUD "resource" module in some way such as
---
- name: Change resources
hosts: localhost
tasks:
- name: Change flavor to vm
openstack.cloud.resource:
cloud: myStack
service: compute
type: server
attributes:
name: vm-name
flavor_id: 22b4d2c2-0fff-437b-a67c-009244f89403
state: present
wait: true
but the play fails with
fatal: [localhost]: FAILED! => {"changed": false, "extra_data": {"data":
null, "details": "Invalid input for field/attribute server. Value:
{'flavorRef': '22b4d2c2-0fd8-437b-a67c-009244f89403'}. Additional
properties are not allowed ('flavorRef' was unexpected)"
If I try with "flavor" or "security_groups" attributes in place of
"flavor_id" the error doesn't change.
Could you help me?
My env is:
[root@cnt-ansible]/workdir/openstack# ansible-galaxy collection list |
grep openstack
openstack.cloud 2.5.0
[root@cnt-ansible]/workdir/openstack# pip3 list | grep openstack
openstacksdk 4.9.0
ansible [core 2.16.14]
Thank you very much
Kind Regards
Marco