From 2d845b9a3b5f2bd2981ded9c24f8e445d899d051 Mon Sep 17 00:00:00 2001 From: Tobias Urdin Date: Mon, 20 Aug 2018 15:25:13 +0200 Subject: [PATCH] Pick proper mirror for ceph apt::pin When running in CI the ceph packages are mirrored and the official download.ceph.com is not used. This changes so we apt::pin the proper mirror that the ceph packages come from, otherwise the ubuntu cloud-archive ceph packages will be installed instead of the official ceph ones. Change-Id: Ica5e74bc67663541f8564a8920db5567f6c85197 --- configure_facts.sh | 2 ++ manifests/repos.pp | 19 +++++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/configure_facts.sh b/configure_facts.sh index 31911da25..2bb3e8e71 100644 --- a/configure_facts.sh +++ b/configure_facts.sh @@ -70,6 +70,7 @@ if [[ -z "$rdo_dlrn" ]]; then fi RDO_MIRROR_HOST=${rdo_dlrn/https:\/\/trunk.rdoproject.org/$NODEPOOL_RDO_PROXY} +export FACTER_nodepool_mirror_host=$NODEPOOL_MIRROR_HOST export FACTER_centos_mirror_host=$CENTOS_MIRROR_HOST export FACTER_uca_mirror_host=$NODEPOOL_UCA_MIRROR export FACTER_deps_mirror_host=$DEPS_MIRROR_HOST @@ -78,6 +79,7 @@ export FACTER_rdo_mirror_host=$RDO_MIRROR_HOST export FACTER_ceph_version=$CEPH_VERSION MIRROR_FACTS="\ +nodepool_mirror_host=${FACTER_nodepool_mirror_host} centos_mirror_host=${FACTER_centos_mirror_host} uca_mirror_host=${FACTER_uca_mirror_host} deps_mirror_host=${FACTER_deps_mirror_host} diff --git a/manifests/repos.pp b/manifests/repos.pp index 97484e94d..e70cca602 100644 --- a/manifests/repos.pp +++ b/manifests/repos.pp @@ -28,12 +28,19 @@ class openstack_integration::repos { fail("Unsupported package type (${::os_package_type})") } } - # Ceph is both packaged on UCA & ceph.com - # Official packages are on ceph.com so we want to make sure - # Ceph will be installed from there. - apt::pin { 'ceph': - priority => 1001, - origin => 'download.ceph.com', + # Ceph is both packaged on UCA and official download.ceph.com packages + # which we mirror. We want to use the official packages or our mirror. + if $::nodepool_mirror_host != '' { + $ceph_version_cap = capitalize($ceph_version_real) + apt::pin { 'ceph': + priority => 1001, + originator => "Ceph ${ceph_version_cap}", + } + } else { + apt::pin { 'ceph': + priority => 1001, + origin => 'download.ceph.com', + } } $enable_sig = false $enable_epel = false