Merge "Create configure-mirrors role"

This commit is contained in:
Jenkins 2017-07-12 18:01:30 +00:00 committed by Gerrit Code Review
commit 0f25a81735
11 changed files with 82 additions and 0 deletions

View File

@ -6,6 +6,10 @@
gather_subset:
- "!all"
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_domain: openstack.org
- role: validate-host
# TODO(mordred) When we have site-local variables, these should go there
zuul_traceroute_host: git.openstack.org

View File

@ -0,0 +1 @@
An ansible role to configure mirrors for common services

View File

@ -0,0 +1,2 @@
mirror_host: mirror.example.org
pypi_mirror: "http://{{ mirror_host }}/pypi/simple"

View File

@ -0,0 +1,4 @@
# This file is generated by Ansible
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
#
APT::Get::AllowUnauthenticated "true";

View File

@ -0,0 +1,2 @@
- include: mirror.yaml
when: mirror_host is defined

View File

@ -0,0 +1,27 @@
- name: Include OS-specific variables
include_vars: "{{ ansible_distribution | lower }}.yaml"
- name: Install /etc/pip.conf configuration
become: yes
template:
dest: /etc/pip.conf
group: root
mode: 0644
owner: root
src: etc/pip.conf.j2
- name: Install .pydistutils.cfg configuration in homedir
template:
dest: ~/.pydistutils.cfg
mode: 0644
src: .pydistutils.cfg.j2
- name: Setup distro specific packaging mirrors.
include: "packages/{{ ansible_distribution | lower }}.yaml"
# Make sure OS does not have a stale package cache.
- name: Update apt cache
become: yes
apt:
update_cache: yes
when: ansible_os_family == 'Debian'

View File

@ -0,0 +1,17 @@
- name: Install /etc/apt/sources.list
become: yes
template:
dest: /etc/apt/sources.list
group: root
mode: 0644
owner: root
src: etc/apt/sources.list.j2
- name: Install /etc/apt/apt.conf.d/99unauthenticated
become: yes
copy:
dest: /etc/apt/apt.conf.d/99unauthenticated
group: root
mode: 0644
owner: root
src: etc/apt/apt.conf.d/99unauthenticated

View File

@ -0,0 +1,8 @@
# This file is generated by Ansible
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
#
[easy_install]
index_url = {{ pypi_mirror }}
{% if mirror_domain is defined %}
allow_hosts = *.{{ mirror_domain }}
{% endif %}

View File

@ -0,0 +1,7 @@
# This file is generated by Ansible
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
#
deb {{ package_mirror }} {{ ansible_distribution_release }} main universe
deb {{ package_mirror }} {{ ansible_distribution_release }}-updates main universe
deb {{ package_mirror }} {{ ansible_distribution_release }}-backports main universe
deb {{ package_mirror }} {{ ansible_distribution_release }}-security main universe

View File

@ -0,0 +1,8 @@
# This file is generated by Ansible
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
#
[global]
timeout = 60
index-url = {{ pypi_mirror }}
trusted-host = {{ mirror_host }}
extra-index-url = {{ wheel_mirror }}

View File

@ -0,0 +1,2 @@
wheel_mirror: "http://{{ mirror_host }}/wheel/{{ ansible_distribution | lower }}-{{ ansible_distribution_version }}-{{ ansible_architecture | lower }}"
package_mirror: "http://{{ mirror_host }}/ubuntu"