diff --git a/tests/foreman/api/test_ansible.py b/tests/foreman/api/test_ansible.py index 276c2bce242..c657c0c4319 100644 --- a/tests/foreman/api/test_ansible.py +++ b/tests/foreman/api/test_ansible.py @@ -80,9 +80,17 @@ def test_fetch_and_sync_ansible_playbooks(self, target_sat): :customerscenario: true """ - target_sat.execute( - "ansible-galaxy collection install -p /usr/share/ansible/collections " - "xprazak2.forklift_collection" + http_proxy = ( + f'HTTPS_PROXY={settings.http_proxy.HTTP_PROXY_IPv6_URL} ' + if settings.server.is_ipv6 + else '' + ) + assert ( + target_sat.execute( + f'{http_proxy}ansible-galaxy collection install -p /usr/share/ansible/collections ' + 'xprazak2.forklift_collection' + ).status + == 0 ) proxy_id = target_sat.nailgun_smart_proxy.id playbook_fetch = target_sat.api.AnsiblePlaybooks().fetch(data={'proxy_id': proxy_id}) diff --git a/tests/foreman/cli/test_ansible.py b/tests/foreman/cli/test_ansible.py index 78a39627867..cde6705907f 100644 --- a/tests/foreman/cli/test_ansible.py +++ b/tests/foreman/cli/test_ansible.py @@ -234,7 +234,17 @@ def _finalize(): proxy_id = target_sat.nailgun_smart_proxy.id for path in ['/etc/ansible/collections', '/usr/share/ansible/collections']: - target_sat.execute(f'ansible-galaxy collection install -p {path} {SELECTED_COLLECTION}') + http_proxy = ( + f'HTTPS_PROXY={settings.http_proxy.HTTP_PROXY_IPv6_URL} ' + if settings.server.is_ipv6 + else '' + ) + assert ( + target_sat.execute( + f'{http_proxy}ansible-galaxy collection install -p {path} {SELECTED_COLLECTION}' + ).status + == 0 + ) target_sat.cli.Ansible.roles_sync({'role-names': SELECTED_ROLE, 'proxy-id': proxy_id}) result = target_sat.cli.Host.ansible_roles_assign( {'id': target_host.id, 'ansible-roles': f'{SELECTED_ROLE}'}