Change more repo url to infra mirror

Change-Id: I7e9fd2760ae3202f3a84833bb65edfdcffa67fe4
This commit is contained in:
Jeffrey Zhang 2017-11-23 02:09:21 +08:00
parent 2a58003253
commit 5feb113033
4 changed files with 46 additions and 41 deletions

View File

@ -1,6 +1,14 @@
- hosts: all
vars:
kolla_inventory_path: "{{ zuul.project.src_dir }}/inventory"
nodepool_rdo_proxy: "{{ zuul_site_mirror_fqdn }}:8080/rdo"
nodepool_pypi_mirror: "http://{{ zuul_site_mirror_fqdn }}:8080/pypi/simple"
nodepool_mirror_host: "{{ zuul_site_mirror_fqdn }}"
nodepool_npmjs_proxy: "http://{{ zuul_site_mirror_fqdn }}:8080/registry.npmjs/"
nodepool_elastic_proxy: "http://{{ zuul_site_mirror_fqdn }}:8080/elastic/"
nodepool_grafana_proxy: "http://{{ zuul_site_mirror_fqdn }}:8080/grafana/"
nodepool_opendaylight_proxy: "http://{{ zuul_site_mirror_fqdn }}:8080/opendaylight/"
nodepool_oraclelinux_proxy: "http://{{ zuul_site_mirror_fqdn }}:8080/oraclelinux/"
tasks:
- name: generate kolla inventory file
copy:
@ -35,12 +43,6 @@
mode: 666
become: true
- name: Prepare mirror configuration
set_fact:
nodepool_rdo_proxy: "{{ zuul_site_mirror_fqdn }}:8080/rdo"
nodepool_pypi_mirror: "{{ zuul_site_mirror_fqdn }}:8080/pypi/simple"
nodepool_mirror_host: "{{ zuul_site_mirror_fqdn }}"
- name: Ensure /etc/kolla exists
file:
path: /etc/kolla
@ -53,24 +55,10 @@
src: "{{ zuul.executor.work_root }}/{{ zuul.project.src_dir }}/tests/templates/kolla-build.conf.j2"
dest: /etc/kolla/kolla-build.conf
- set_fact:
template_override_path: zuul.executor.work_root + '/' + zuul.project.src_dir '/tests/templates/pip.conf.j2'
- name: Prepare pip.conf
template:
src: "{{ zuul.executor.work_root }}/{{ zuul.project.src_dir }}/tests/templates/pip.conf.j2"
dest: /etc/kolla/pip.conf
- name: Read contents of pip.conf
command: "cat /etc/kolla/pip.conf"
register: pip_conf_file
- name: Template override
template:
src: "{{ zuul.executor.work_root }}/{{ zuul.project.src_dir }}/tests/templates/template_overrides.j2"
dest: /etc/kolla/template_overrides.j2
vars:
pip_conf: "{{ pip_conf_file.stdout | b64encode }}"
- shell:
cmd: |

View File

@ -7,3 +7,6 @@ tag = {{ zuul.branch | basename }}
push = false
logs_dir = /tmp/logs/build
template_override = /etc/kolla/template_overrides.j2
[opendaylight]
location = {{ nodepool_opendaylight_proxy}}/content/repositories/opendaylight.release/org/opendaylight/integration/distribution-karaf/0.6.2-Carbon/distribution-karaf-0.6.2-Carbon.tar.gz

View File

@ -1,4 +0,0 @@
[global]
timeout = 60
index-url = {{ nodepool_pypi_mirror }}
trusted-host = {{ nodepool_mirror_host }}

View File

@ -4,13 +4,32 @@
{% block base_header %}
{% endraw %}
RUN echo $(base64 -w0 "{{ pip_conf }}") | base64 -d > /etc/pip.conf
ENV PIP_INDEX_URL {{ nodepool_pypi_mirror }}
ENV PIP_TRUSTED_HOST {{ nodepool_mirror_host }}
RUN echo registry={{ nodepool_npmjs_proxy }} > /etc/npmrc \
&& mkdir -p /usr/etc \
&& ln -s /etc/npmrc /usr/etc/npmrc
{% raw %}
{% if base_distro == 'ubuntu' %}
RUN echo 'APT::Get::AllowUnauthenticated "true";' > /etc/apt/apt.conf.d/99allow-unauthenticated
{% elif base_distro == 'centos' %}
{% endraw %}
RUN sed -i -e "/^mirrorlist/d" \
-e "s|^#baseurl=http://mirror.centos.org|baseurl=http://{{ nodepool_mirror_host }}|" \
/etc/yum.repos.d/CentOS-Base.repo
{% raw %}
{% elif base_distro == 'oraclelinux' %}
{% endraw %}
RUN sed -i -e "s|^baseurl=http://yum.oracle.com/repo/OracleLinux|baseurl={{ nodepool_oraclelinux_proxy }}|" \
/etc/yum.repos.d/public-yum-ol7.repo
{% raw %}
{% endif %}
{% endblock %}
@ -18,28 +37,27 @@ RUN echo 'APT::Get::AllowUnauthenticated "true";' > /etc/apt/apt.conf.d/99allow-
{% if base_distro == "centos" %}
{% endraw %}
RUN sed -i -e "/^mirrorlist/d" \
-e "s|^#baseurl=http://mirror.centos.org|baseurl=http://{{ nodepool_mirror_host }}|" \
/etc/yum.repos.d/CentOS-Base.repo \
&& sed -i -e "/^mirrorlist/d" \
-e "s|^#baseurl=http://download.fedoraproject.org/pub|baseurl=http://{{ nodepool_mirror_host }}|" \
/etc/yum.repos.d/epel.repo \
&& sed -i -e "s|^baseurl=http://mirror.centos.org|baseurl=http://{{ nodepool_mirror_host }}|" \
/etc/yum.repos.d/CentOS-Ceph-Jewel.repo \
&& sed -i -e "s|^baseurl=https://trunk.rdoproject.org|baseurl=http://{{ nodepool_rdo_proxy }}|" \
/etc/yum.repos.d/delorean.repo
RUN sed -i -e "/^mirrorlist/d" \
-e "s|^#baseurl=http://download.fedoraproject.org/pub|baseurl=http://{{ nodepool_mirror_host }}|g" \
-e "s|^baseurl=http://mirror.centos.org|baseurl=http://{{ nodepool_mirror_host }}|g" \
-e "s|^baseurl=https://packages.elastic.co|baseurl={{ nodepool_elastic_proxy }}|g" \
-e "s|^baseurl=https://packagecloud.io/grafana|baseurl={{ nodepool_grafana_proxy }}|g" \
-e "s|^baseurl=https://trunk.rdoproject.org|baseurl=http://{{ nodepool_rdo_proxy }}|g" \
/etc/yum.repos.d/*.repo
{% raw %}
{% elif base_distro == "oraclelinux" %}
{% endraw %}
RUN sed -i -e "/^mirrorlist/d" \
-e "s|^#baseurl=http://download.fedoraproject.org/pub|baseurl=http://{{ nodepool_mirror_host }}|" \
/etc/yum.repos.d/epel.repo \
&& sed -i -e "s|^baseurl=http://mirror.centos.org|baseurl=http://{{ nodepool_mirror_host }}|" \
/etc/yum.repos.d/CentOS-Ceph-Jewel.repo \
&& sed -i -e "s|^baseurl=https://trunk.rdoproject.org|baseurl=http://{{ nodepool_rdo_proxy }}|" \
/etc/yum.repos.d/delorean.repo
-e "/^metalink/d" \
-e "s|^#baseurl=http://mirror.centos.org|baseurl=http://{{ nodepool_mirror_host }}|g" \
-e "s|^#baseurl=http://download.fedoraproject.org/pub|baseurl=http://{{ nodepool_mirror_host }}|g" \
-e "s|^baseurl=http://mirror.centos.org|baseurl=http://{{ nodepool_mirror_host }}|g" \
-e "s|^baseurl=https://packages.elastic.co|baseurl={{ nodepool_elastic_proxy }}|g" \
-e "s|^baseurl=https://packagecloud.io/grafana|baseurl={{ nodepool_grafana_proxy }}|g" \
-e "s|^baseurl=https://trunk.rdoproject.org|baseurl=http://{{ nodepool_rdo_proxy }}|g" \
/etc/yum.repos.d/*.repo
{% raw %}
{% elif base_distro == "ubuntu" %}