From 2fa0318c73e4fae6b0cd89939ef93f1b6d6765df Mon Sep 17 00:00:00 2001 From: Jonathan Rosser Date: Wed, 20 Apr 2022 08:58:51 +0100 Subject: [PATCH] Prevent ceph packages installing from ubuntu-cloud-archive This patch adds a new variable `openstack_hosts_apt_pinned_packages` which defaults to pinning ceph packages from the UCA repository to a lower priority than the equivalent packages from the main ubuntu repository. Without this change, installing lxc-templates will pull packages from the Quincy release of Ceph via Yoga UCA, and this is ahead of the Pacific version expected by the ceph_client and ceph-ansible code. This change improves consistency of the ceph packages installed across the deployment and does not allow very new packages in UCA to later cause a package downgrade failure when the ceph_client/ceph-ansible attempts to install the well-defined version of ceph required by openstack-ansible. Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/838762 Change-Id: Ia19ba6bae3e95ceb2e517039fbbfb9346e014961 --- defaults/main.yml | 7 +++++++ meta/main.yml | 2 ++ .../global-apt-pins-a0d6785a8fd662df.yaml | 20 +++++++++++++++++++ 3 files changed, 29 insertions(+) create mode 100644 releasenotes/notes/global-apt-pins-a0d6785a8fd662df.yaml diff --git a/defaults/main.yml b/defaults/main.yml index 267e6768..c91c9e6f 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -179,3 +179,10 @@ openstack_ca_bundle_path: "{{ _openstack_ca_bundle_path }}" # extra configuration for OS package manager openstack_hosts_package_manager_extra_conf: '' + +# apt pins to apply to all hosts in the deployment +# the default is to make ceph packages from UCA lower priority than those from the ubuntu distro repo +openstack_hosts_apt_pinned_packages: + - package: "src:ceph" + origin: "ubuntu-cloud.archive.canonical.com" + priority: 400 \ No newline at end of file diff --git a/meta/main.yml b/meta/main.yml index d63a0062..8570a602 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -37,5 +37,7 @@ galaxy_info: - openstack dependencies: - role: apt_package_pinning + apt_pinned_packages: "{{ openstack_hosts_apt_pinned_packages }}" + apt_package_pinning_file_name: "openstack_hosts_pin.pref" when: - ansible_facts['pkg_mgr'] == 'apt' diff --git a/releasenotes/notes/global-apt-pins-a0d6785a8fd662df.yaml b/releasenotes/notes/global-apt-pins-a0d6785a8fd662df.yaml new file mode 100644 index 00000000..f79dfce0 --- /dev/null +++ b/releasenotes/notes/global-apt-pins-a0d6785a8fd662df.yaml @@ -0,0 +1,20 @@ +--- +features: + - | + A new variable `openstack_hosts_apt_pinned_packages` is added which allows + deployment wide apt pins to be defined in user_variables. The variable defaults + to pinning the UCA repository to a priority lower than the Ubuntu repositories for + any binary packages generated from the ceph source package. The intention is to + ensure that Ceph packages are always installed from the Ubuntu repositories, or + alternatively the official ceph repositories if the ceph_client role is run later + against a host. The ceph packages for a particular openstack release may not be the + same version as those expected by the rest of openstack-ansible so this change ensures + consistency in the deployed ceph version. +upgrade: + - | + The new variable `openstack_hosts_apt_pinned_packages` is added to the openstack_hosts + ansible role and sets the value of `apt_pinned_packages` for the apt_package_pinning + role run as a dependancy of the openstack_hosts role. Existing use of the + `apt_pinned_packages` variable by deployers in user_variables should be reviewed + to ensure that those pins are applied by the intended ansible roles, and swapped + to this new variable if necessary.