From 1f29cdcf2be7b36b7cd22d3a65b97da402e3156f Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Fri, 1 Jul 2016 13:12:45 +0100 Subject: [PATCH] Implement standardised Ubuntu Cloud Archive repo vars This patch implemented the vars for UCA which are present in the os_nova and ceph_client roles in order to improve consistency and easier overriding of any of the chosen parts. The tasks implementing the UCA configuration are also slightly adjusted to be a little more robust and complete. Change-Id: I5ab9238245932de7f3ffc07ffe52725616f4f637 --- tasks/ovs_install-apt.yml | 15 +++++++++------ vars/ubuntu-14.04.yml | 7 ++++++- vars/ubuntu-16.04.yml | 7 ++++--- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/tasks/ovs_install-apt.yml b/tasks/ovs_install-apt.yml index ba0bb612..5b5d4f15 100644 --- a/tasks/ovs_install-apt.yml +++ b/tasks/ovs_install-apt.yml @@ -13,20 +13,23 @@ # See the License for the specific language governing permissions and # limitations under the License. -- name: Add Ubuntu Cloud Archive Keyring package +- name: Add Ubuntu Cloud Archive keyring apt: pkg: ubuntu-cloud-keyring - register: add_keys + state: latest + register: add_uca_keys -- name: Enable OVS repo +- name: Add Ubuntu Cloud Archive Repository apt_repository: - repo: "{{ ovs_apt_repo }}" + repo: "{{ uca_repo }}" state: present + register: add_uca_repo -- name: Update apt after OVS repo +- name: Update apt cache after repo addition apt: update_cache: yes - when: add_keys.changed + when: add_uca_keys | changed or + add_uca_repo | changed - name: Install apt packages apt: diff --git a/vars/ubuntu-14.04.yml b/vars/ubuntu-14.04.yml index 07a247ce..8f725921 100644 --- a/vars/ubuntu-14.04.yml +++ b/vars/ubuntu-14.04.yml @@ -13,7 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -ovs_apt_repo: 'deb http://ubuntu-cloud.archive.canonical.com/ubuntu trusty-updates/mitaka main' +# There are no UCA packages for Trusty beyond Mitaka, so the selected +# release here has to remain at Mitaka. +uca_openstack_release: mitaka +uca_apt_repo_url: "http://ubuntu-cloud.archive.canonical.com/ubuntu" +uca_repo_dist: "{{ ansible_lsb.codename }}-updates/{{ uca_openstack_release }}" +uca_repo: "deb {{ uca_apt_repo_url }} {{ uca_repo_dist }} main" ovs_apt_packages: - openvswitch-common diff --git a/vars/ubuntu-16.04.yml b/vars/ubuntu-16.04.yml index b56df980..6bf120c9 100644 --- a/vars/ubuntu-16.04.yml +++ b/vars/ubuntu-16.04.yml @@ -13,9 +13,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -# This has to be reworked because openvswitch packages are not part of the UCA now -# current version is included in mainstream xenial. -ovs_apt_repo: 'deb http://ubuntu-cloud.archive.canonical.com/ubuntu xenial-updates/newton main' +uca_openstack_release: newton +uca_apt_repo_url: "http://ubuntu-cloud.archive.canonical.com/ubuntu" +uca_repo_dist: "{{ ansible_lsb.codename }}-updates/{{ uca_openstack_release }}" +uca_repo: "deb {{ uca_apt_repo_url }} {{ uca_repo_dist }} main" ovs_apt_packages: - openvswitch-common