Fix tag repo existence checks by switching to ansible.builtin.uri

The current implementation is over-complicated and clearly flawed. The full output of the curl command before grep is applied has several unpredictable digit strings, most notably:

X-Varnish: 248056622 246047235

If 200, 403 or 404 happen to appear in one of these digit strings we will decide the repo does not exist (because the stdout of the curl | grep command will not be exactly "200") and refuse to add it.

If we drop 403 and 404 from the grep (as we could, since we do nothing with them), we solve the problem of false failing if '403' or '404' appears in a digit string, but add a possibility of false succeeding if the status code is 403 or 404, but 200 appears (once) in a digit string.

We can skip curl entirely here and use ansible's builtin uri module, which is designed for this sort of thing.

Signed-off-by: Adam Williamson awilliam@redhat.com

Merge request reports

Loading