From e3d25ebff4a6be6b6c7abc42db7c877cfc088146 Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Mon, 25 Sep 2017 14:45:42 +0100 Subject: [PATCH] SUSE: Fix repo setup on container cache We need to delete all repos which do not match the expected ones so we need an 'AND' conditional instead of 'OR'. Moreoever, all containers are expected to have the cloud repository present. This is normally being installed in the pip_install role but if the host has it already then preserve that as well. Change-Id: I44bdc79a07afa315e3d037ff05a06f5c79e1f738 --- vars/suse-42.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vars/suse-42.yml b/vars/suse-42.yml index a3b05c61..d1c53b28 100644 --- a/vars/suse-42.yml +++ b/vars/suse-42.yml @@ -57,7 +57,7 @@ lxc_cache_map: 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 + find /etc/zypp/repos.d/*.repo -type f ! -name "repo-oss.repo" -a ! -name "repo-update.repo" -a ! -name "OBS:Cloud:OpenStack:Pike.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