From 33565f377476ccd92643f6f32be814a00efb340d Mon Sep 17 00:00:00 2001 From: Sloane Hertel <19572925+s-hertel@users.noreply.github.com> Date: Tue, 23 Jul 2024 17:56:15 -0400 Subject: [PATCH] increase timeout downloading galaxy role URLs (#83562) * Update the timeout to download role archive to 60 seconds to match collections TODO: in future make a configurable 'artifact download timeout' --- .../fragments/ansible-galaxy-install-archive-url-timeout.yml | 4 ++++ lib/ansible/galaxy/role.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/ansible-galaxy-install-archive-url-timeout.yml diff --git a/changelogs/fragments/ansible-galaxy-install-archive-url-timeout.yml b/changelogs/fragments/ansible-galaxy-install-archive-url-timeout.yml new file mode 100644 index 00000000000..bf87d435409 --- /dev/null +++ b/changelogs/fragments/ansible-galaxy-install-archive-url-timeout.yml @@ -0,0 +1,4 @@ +bugfixes: +- >- + ``ansible-galaxy role install`` - update the default timeout to download + archive URLs from 20 seconds to 60 (https://github.com/ansible/ansible/issues/83521). diff --git a/lib/ansible/galaxy/role.py b/lib/ansible/galaxy/role.py index d00b8a69980..806a9996ad4 100644 --- a/lib/ansible/galaxy/role.py +++ b/lib/ansible/galaxy/role.py @@ -256,7 +256,7 @@ class GalaxyRole(object): display.display("- downloading role from %s" % archive_url) try: - url_file = open_url(archive_url, validate_certs=self._validate_certs, http_agent=user_agent()) + url_file = open_url(archive_url, validate_certs=self._validate_certs, http_agent=user_agent(), timeout=60) temp_file = tempfile.NamedTemporaryFile(delete=False) data = url_file.read() while data: