ansible-collection-cloudstack icon indicating copy to clipboard operation
ansible-collection-cloudstack copied to clipboard

Debug Instance Changes

Open rvalle opened this issue 3 years ago • 8 comments

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?

rvalle avatar Sep 09 '22 13:09 rvalle

have you tried --diff?

resmo avatar Sep 09 '22 13:09 resmo

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

resmo avatar Sep 09 '22 13:09 resmo

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.

rvalle avatar Sep 23 '22 06:09 rvalle

did you use the dynamic inventory?

resmo avatar Sep 23 '22 06:09 resmo

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.

rvalle avatar Sep 23 '22 08:09 rvalle

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 avatar Sep 23 '22 09:09 resmo

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

resmo avatar Sep 23 '22 09:09 resmo

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

rvalle avatar Sep 23 '22 10:09 rvalle