Closed Griffin-Sullivan closed 1 month ago
Well, our modules already do wait for task completion if there is a "direct" task: https://github.com/theforeman/foreman-ansible-modules/blob/a7077cc1cf6fc2d6ac907072b82462b1368d3a95/plugins/module_utils/foreman_helper.py#L1193-L1196
So whatever does the generation is not properly reported as part of the task (maybe intentionally?)
I also see no task-related info in https://github.com/theforeman/foreman-ansible-modules/blob/develop/tests/test_playbooks/fixtures/repository-0.yml, so I'd just assume this is how it is today and merge your "sleep 2".
Surely there's a better way to do this, but to summarize here's the issue:
Is there a more synchronous way to do this? Maybe wait for the task? I'm not sure if the metadata task is reported back when the repository create task is finished.