SUSE: Add ability to configure external mirror for openSUSE
Allow deployers to choose a specific mirror by setting the 'lxc_hosts_opensuse_mirror_url' variable Change-Id: If151501923c5308cfeaee6e33d12df3e7f6959d5
This commit is contained in:
parent
1d206a59f7
commit
1074bba56f
@ -177,3 +177,11 @@ lxc_cache_download_template_options: >-
|
||||
# provided in EPEL is much too old (1.x).
|
||||
lxc_centos_package_baseurl: https://copr-be.cloud.fedoraproject.org/results/thm/lxc2.0/epel-7-x86_64/
|
||||
lxc_centos_package_key: https://copr-be.cloud.fedoraproject.org/results/thm/lxc2.0/pubkey.gpg
|
||||
|
||||
## Set default mirror for openSUSE repositories
|
||||
# NOTE(hwoarang): Ensure that the full path to the 'opensuse' directory is used.
|
||||
# Additionally, set 'lxc_hosts_opensuse_mirror_obs_url' to a mirror which also mirrors
|
||||
# the OBS repositories. If you want to use the same mirror in both cases, then leave the
|
||||
# 'lxc_hosts_opensuse_mirror_obs_url' to its default value.
|
||||
lxc_hosts_opensuse_mirror_url: 'http://download.opensuse.org'
|
||||
lxc_hosts_opensuse_mirror_obs_url: "{{ lxc_hosts_opensuse_mirror_url }}"
|
||||
|
@ -0,0 +1,10 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
Deployers can set ``lxc_hosts_opensuse_mirror_url`` to use their
|
||||
preferred mirror for the openSUSE repositories. They can also set the
|
||||
``lxc_hosts_opensuse_mirror_obs_url`` if they want to set a different
|
||||
mirror for the OBS repositories. If they want to use the same mirror in
|
||||
both cases then they can leave the latter variable to its default value.
|
||||
The full list of mirrors and their capabilities can be obtained at
|
||||
http://mirrors.opensuse.org/
|
@ -16,7 +16,7 @@
|
||||
|
||||
lxc_hosts_external_repo:
|
||||
- name: "OBS:Virtualization:containers"
|
||||
uri: "http://download.opensuse.org/repositories/Virtualization:/containers/openSUSE_Leap_{{ ansible_distribution_version }}/"
|
||||
uri: "{{ lxc_hosts_opensuse_mirror_obs_url }}/repositories/Virtualization:/containers/openSUSE_Leap_{{ ansible_distribution_version }}/"
|
||||
|
||||
system_config_dir: "/etc/sysconfig"
|
||||
systemd_utils_prefix: "/usr/lib/systemd"
|
||||
@ -45,6 +45,8 @@ lxc_cache_map:
|
||||
copy_from_host:
|
||||
- /etc/environment
|
||||
- /etc/localtime
|
||||
- /etc/zypp/repos.d/repo-oss
|
||||
- /etc/zypp/repos.d/repo-update
|
||||
cache_prep_commands: |
|
||||
{{ lxc_cache_prep_pre_commands }}
|
||||
mkdir -p /etc/ansible/facts.d/
|
||||
@ -54,6 +56,11 @@ lxc_cache_map:
|
||||
{% for resolver in lxc_cache_prep_dns %}
|
||||
echo "nameserver {{ resolver }}" >> /etc/resolv.conf
|
||||
{% endfor %}
|
||||
# Wipe default repositories and recreate them
|
||||
find /etc/zypp/repos.d/*.repo -type f ! -name "repo-oss.repo"-o ! -name "repo-update.repo" -delete
|
||||
# In case the host didn't have any of these two repos then create it (althought that indicates that the host is not in a good state!)
|
||||
[[ ! -e /etc/zypp/repos.d/repo-oss.repo ]] && zypper --quiet ar {{ lxc_hosts_opensuse_mirror_url }}/distribution/leap/{{ ansible_distribution_version }}/repo/oss repo-oss
|
||||
[[ ! -e /etc/zypp/repos.d/repo-update.repo ]] && zypper --quiet ar {{ lxc_hosts_opensuse_mirror_url }}/update/leap/{{ ansible_distribution_version }}/oss/ repo-update
|
||||
# Do a complete refresh and fetch the keys without asking
|
||||
zypper --gpg-auto-import-keys -n ref -f
|
||||
# Disable recommended packages. Only update what's really needed
|
||||
|
Loading…
Reference in New Issue
Block a user