diff --git a/playbooks/unittests/pre.yaml b/playbooks/unittests/pre.yaml index 1cce23bbb..435e765e6 100644 --- a/playbooks/unittests/pre.yaml +++ b/playbooks/unittests/pre.yaml @@ -2,7 +2,7 @@ roles: - role: configure-mirrors # TODO(mordred) When we have site-local variables, these should go there - mirror_host: "mirror.{{ nodepool.region | lower }}.{{ nodepool.provider | lower }}.openstack.org" + mirror_fqdn: "mirror.{{ nodepool.region | lower }}.{{ nodepool.provider | lower }}.openstack.org" - role: bindep bindep_profile: test bindep_dir: "{{ zuul_work_dir }}" diff --git a/roles/configure-mirrors/README.rst b/roles/configure-mirrors/README.rst index e4d70f8f4..b7c1fe93a 100644 --- a/roles/configure-mirrors/README.rst +++ b/roles/configure-mirrors/README.rst @@ -2,8 +2,8 @@ An ansible role to configure services to use mirrors. Role Variables -mirror_host +mirror_fqdn The base host for mirror servers pypi_mirror - URL to override the generated pypi mirror url based on mirror_host + URL to override the generated pypi mirror url based on mirror_fqdn diff --git a/roles/configure-mirrors/defaults/main.yaml b/roles/configure-mirrors/defaults/main.yaml index 9594be66d..710a2ce23 100644 --- a/roles/configure-mirrors/defaults/main.yaml +++ b/roles/configure-mirrors/defaults/main.yaml @@ -1 +1 @@ -pypi_mirror: "http://{{ mirror_host }}/pypi/simple" +pypi_mirror: "http://{{ mirror_fqdn }}/pypi/simple" diff --git a/roles/configure-mirrors/tasks/main.yaml b/roles/configure-mirrors/tasks/main.yaml index 2d9f1f79e..bba1f37b3 100644 --- a/roles/configure-mirrors/tasks/main.yaml +++ b/roles/configure-mirrors/tasks/main.yaml @@ -1,2 +1,2 @@ - include: mirror.yaml - when: mirror_host is defined + when: mirror_fqdn is defined diff --git a/roles/configure-mirrors/templates/.pydistutils.cfg.j2 b/roles/configure-mirrors/templates/.pydistutils.cfg.j2 index 9f18c250a..082ac448d 100644 --- a/roles/configure-mirrors/templates/.pydistutils.cfg.j2 +++ b/roles/configure-mirrors/templates/.pydistutils.cfg.j2 @@ -1,4 +1,4 @@ # {{ ansible_managed }} [easy_install] index_url = {{ pypi_mirror }} -allow_hosts = {{ mirror_host }} +allow_hosts = {{ mirror_fqdn }} diff --git a/roles/configure-mirrors/templates/etc/pip.conf.j2 b/roles/configure-mirrors/templates/etc/pip.conf.j2 index dcce39e39..cd47f2810 100644 --- a/roles/configure-mirrors/templates/etc/pip.conf.j2 +++ b/roles/configure-mirrors/templates/etc/pip.conf.j2 @@ -2,5 +2,5 @@ [global] timeout = 60 index-url = {{ pypi_mirror }} -trusted-host = {{ mirror_host }} +trusted-host = {{ mirror_fqdn }} extra-index-url = {{ wheel_mirror }} diff --git a/roles/configure-mirrors/vars/ubuntu.yaml b/roles/configure-mirrors/vars/ubuntu.yaml index f9f204bff..3c59450ed 100644 --- a/roles/configure-mirrors/vars/ubuntu.yaml +++ b/roles/configure-mirrors/vars/ubuntu.yaml @@ -1,2 +1,2 @@ -wheel_mirror: "http://{{ mirror_host }}/wheel/{{ ansible_distribution | lower }}-{{ ansible_distribution_version }}-{{ ansible_architecture | lower }}" -package_mirror: "http://{{ mirror_host }}/ubuntu" +wheel_mirror: "http://{{ mirror_fqdn }}/wheel/{{ ansible_distribution | lower }}-{{ ansible_distribution_version }}-{{ ansible_architecture | lower }}" +package_mirror: "http://{{ mirror_fqdn }}/ubuntu"