ngine-io / ansible-collection-cloudstack

CloudStack Ansible Collections
https://galaxy.ansible.com/ngine_io/cloudstack
GNU General Public License v3.0
21 stars 27 forks source link

Debug Instance Changes #112

Open rvalle opened 1 year ago

rvalle commented 1 year ago

I don't believe my playbook is attempting any changes on some instances: yet I get this message on some:

[WARNING]: Changes won't be applied to running instances. Use force=true to allow the instance XXX to be stopped/started.

Is there any way I can debug which changes is Ansible trying to apply?

resmo commented 1 year ago

have you tried --diff?

resmo commented 1 year ago

should be one or more of these https://github.com/ngine-io/ansible-collection-cloudstack/blob/master/plugins/modules/cs_instance.py#L856

rvalle commented 1 year ago

well... this is what happened.

I modified instances by hand.... When I got the warnings I modified the playbooks to match the UI changes, as I did not want to restart the instances, but the warning would persist in subsequent runts.

Now the warnings just vanished.

It feels like there is some kind of state kept somewhere.

I will try to watch closely next time this use case takes place.

resmo commented 1 year ago

did you use the dynamic inventory?

rvalle commented 1 year ago

Yes, I have dynamic inventory. The Plugin:

plugin: ngine_io.cloudstack.instance

how would this affect the issue?

somewhere there seems to be some state, or mark that the instance has changed, or pending changes to apply or something.

resmo commented 1 year ago

so, the only thing that can cache is the inventory, even though I think we don't implemented it https://github.com/ngine-io/ansible-collection-cloudstack/blob/master/plugins/inventory/instance.py#L246 you could check the output with with ansible-inventory

resmo commented 1 year ago

then there is facts caching but that should not be involved.

rvalle commented 1 year ago

Ok, I will review a bit more. Once I had troubles with fact caching.... but not sure what about. :)