With version 9.1.1, I created a scm git project dedicated for inventory.
Then I created an inventory with this project as source and checked OVERWRITE, OVERWRITE VARIABLES, UPDATE ON LAUNCH.
When this git repo got new commit and I launched the job with this inventory, the scm update job run with task [update project using git] ok
and keep previous commit version.
Is it normal the behavior? Because I remember with version 9.0.0 the scm update updated to last commit version
That is expected, because there is an important distinction between updating the inventory and updating the revision of the project.
In some cases, inventory is dynamic. Say you have an inventory script, and every time you run it, it can give a different output.
In other cases, inventory is static, and an update will give the same every time, like the traditional ini kind of Ansible inventory format. The update to “update on project change” is intended specifically for SCM static inventory, because it will update every time the project updates revision, and no other times.
Say that you have an inventory source, stored in SCM, which is dynamic, and you are pushing changes to it frequently. In that case, maybe you want both - to re-run the inventory script before every job run, and to update the project source before every time the inventory script is re-ran. Best advice is to have a workflow. I’m hesitant to try and refine this to a feature request, because it’s complex, hard to explain, and may not be what users actually want. It might be that you just want to update the project while manually clicking the inventory sync button, in which case some kind of UI shortcut might be more appropriate and transparent about its function.
Isn’t it better if I use webhook on scm side? So it update only when there is a push on the repository.
I never use webhook and trigger a project sync.
I did run job template with REST API.