Maybe it's not the most clean approach, but you can check if the
command returned an error message including "Could not get lock"
substring.
You can repeat this command with some delay in between and with a
limit of repeating cycles, waiting for the automatic update to finish.
Once the command ends with no error (or with a different error), then
you can continue.
> --
> You received this message because you are subscribed to the Google Groups "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
ansible-proje...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/c5695c69-cf48-4960-aa64-71d0a0def4e8n%40googlegroups.com.
--
Roberto Paz