# AWX Inventory Source Update scm\_revisioin

**URL:** <https://forum.ansible.com/t/awx-inventory-source-update-scm-revisioin/42690>\
**Category:** Get Help\
**Tags:** awx, inventory\
**Created:** [May 15, 2025, 8:26pm UTC](https://forum.ansible.com/t/awx-inventory-source-update-scm-revisioin/42690 "2025-05-15T20:26:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dpowell](https://avatars.discourse-cdn.com/v4/letter/d/e95f7d/32.png) [@dpowell](https://forum.ansible.com/u/dpowell)\
**Post date:** [May 15, 2025, 8:26pm UTC](https://forum.ansible.com/t/awx-inventory-source-update-scm-revisioin/42690/1 "2025-05-15T20:26:16Z")

</div>

Does anyone know how AWX determines the scm\_revision at the following endpoint? `api/v2/inventory_sources/970/inventory_updates/`

I have 800+ inventories sourced from SCM Project. I’m working on a role that will only trigger the `inventory_source_update` as needed, ideally only if the source file was changed. However the `git` commands I’m using to try and get the individual files revision doesn’t seem to line up with what AWX is getting. I’m been trying to track the code down on where that is determined but haven’t been able to find it.

---

<div class="post-metadata">

**Author:** ![dpowell](https://avatars.discourse-cdn.com/v4/letter/d/e95f7d/32.png) [@dpowell](https://forum.ansible.com/u/dpowell)\
**Post date:** [May 15, 2025, 9:07pm UTC](https://forum.ansible.com/t/awx-inventory-source-update-scm-revisioin/42690/2 "2025-05-15T21:07:57Z")

</div>

The more I dig, I think the issue is this. On the inventory\_source\_update the scm\_revision is that of the Project/remote repo. I was expecting and hoping it would be of the actual source file from the remote repo so I can compare the current value to the new value and determine if I needed to trigger an inventory sync. If its the Project scm\_revision that doesn’t really help in what I’m trying to do.

---

<div class="post-metadata">

**Author:** ![tanganellilore](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/tanganellilore/32/178_2.png) [@tanganellilore](https://forum.ansible.com/u/tanganellilore)\
**Post date:** [May 16, 2025, 5:43am UTC](https://forum.ansible.com/t/awx-inventory-source-update-scm-revisioin/42690/3 "2025-05-16T05:43:58Z")

</div>

Yes,  
This is the revisione present on git.

You can compare it with the head of the repo and check if sync is required.

---

<div class="post-metadata">

**Author:** ![dpowell](https://avatars.discourse-cdn.com/v4/letter/d/e95f7d/32.png) [@dpowell](https://forum.ansible.com/u/dpowell)\
**Post date:** [May 16, 2025, 1:26pm UTC](https://forum.ansible.com/t/awx-inventory-source-update-scm-revisioin/42690/4 "2025-05-16T13:26:41Z")

</div>

The down side is that just because the head changed doesn’t mean inventory source’s changed and with as many as we have, triggering a sync on 800+ drastically slows down the UI. Even if batched the UI isn’t slow but it takes forever for the sync’s to finish. I’m trying to work around it. Since we have the current scm\_revision I can do the follow to get a list of inventory files that changed and work from there.

This will list something like the below

```auto
git diff --name-only curent_revision_value HEAD~1

README.md
inventories/my_inv_file.yml

```

At that point I can find the inventory\_source for `inventoires/my_inv_file.yml` and only sync it.

Isn’t perfect but is better than syncing all of them when not needed. We can also set the `Update on Launch` but we’re also trying to make the customer happy who wants to be able to view the hosts/groups etc without having to do anything!

---

<div class="post-metadata">

**Author:** ![utoddl](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/utoddl/32/249_2.png) [@utoddl](https://forum.ansible.com/u/utoddl)\
**Post date:** [May 16, 2025, 2:32pm UTC](https://forum.ansible.com/t/awx-inventory-source-update-scm-revisioin/42690/5 "2025-05-16T14:32:33Z")

</div>

I’m trying to imagine 800+ inventories… It’s so far beyond my experience, I can’t even think about it.

Anyway, perhaps you could spread the inventories among several different git repos to lessen the impact of scm updates.
