stale tags/groups after changing tag values (dynamic inventory)

,

Hi Folks,

Dynamic inventory initially works great and creates host groups based on the AWS tags assigned to the ec2 hosts in y AWS account. However, if I then make a change to the tag value in AWS e.g. change from DEV to PROD and then re-run source sync in AWX, i find that it pulls in the new tag/group but does not remove the original tag/group assigned to the very same host.

This means i have stale tags associated with my hosts. I now have a group called DEV and PROD associated to the same host which is not in sync with my AWS tagging.

Is this there a workaround for this? otherwise this makes dynamic inventory not quite great.

Thanks,

Deleting all groups/hosts and then re-syncing is not an option because we pass variables at the inventory group level. This would mean we need to re-insert the variable for all groups each time we make changes/add new tags to our AWS inventory.

you can see the yml file being used for dynamic inventories below.

Managed to resolve this issue by checking the “overwrite” button in the > inventories > sources (tab). See screenshot below: