Azure inventory doesn’t not capture virtual machine in stopped state.
Disable host before syncing are override when a new sync trigger. How to prevent the overwrite. I did not tick the “Overwrite”. This behaviour doesn’t happen with AWS plugin. I assume its a Azure RM plugin issue.
Good morning, I use this for Azure:
Enabled Variable: provisioning_state
Enabled Value: succeeded
This enables also deallocated machines, as long as they have been imaged.
I do not manually disable or enable hosts. I think the whole idea of this variable is to have this detected automatically.
Instead I add a connection detection in front of every role together with end_host if not reachable for those.
Something like
- name: Check connection
ansible.builtin.ping:
register: _ping_result
- name: Remove unwanted hosts from play_hosts
ansible.builtin.meta: end_host
when: _ping_result.unreachable is defined