diff --git a/defaults/main.yml b/defaults/main.yml index 88489a1b..d4a7e380 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -403,3 +403,11 @@ nova_nova_conf_overrides: {} nova_rootwrap_conf_overrides: {} nova_api_paste_ini_overrides: {} nova_policy_overrides: {} + +# Ubuntu Cloud Archive variables +nova_uca_enable: True +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" + diff --git a/releasenotes/notes/nova-uca-support-409b2e6afbce47b1.yaml b/releasenotes/notes/nova-uca-support-409b2e6afbce47b1.yaml new file mode 100644 index 00000000..d59a0ef2 --- /dev/null +++ b/releasenotes/notes/nova-uca-support-409b2e6afbce47b1.yaml @@ -0,0 +1,10 @@ +--- +features: + - Nova UCA repository support is implemented by default. + This will allow the users to benefit from the updated + packages for KVM. + + The ``nova_uca_enable`` variable controls the install + source for the KVM packages. By default this value is set + to ``True`` to make use of UCA repository. User can set to + ``False`` to disable. diff --git a/tasks/nova_compute_kvm_install.yml b/tasks/nova_compute_kvm_install.yml index b751580b..e72f2bcb 100644 --- a/tasks/nova_compute_kvm_install.yml +++ b/tasks/nova_compute_kvm_install.yml @@ -13,6 +13,26 @@ # See the License for the specific language governing permissions and # limitations under the License. +- name: Add ubuntu cloud archive key package + apt: + pkg: ubuntu-cloud-keyring + when: nova_uca_enable + register: add_keys + tags: + - add-apt-keys + +- name: Add UCA repo(s) + apt_repository: + repo: "{{ uca_repo }}" + state: present + register: add_repo + when: nova_uca_enable + until: add_repo|success + retries: 5 + delay: 2 + tags: + - add-uca-repo + #TODO(evrardjp): Replace the next 2 tasks by a standard apt with cache #when https://github.com/ansible/ansible-modules-core/pull/1517 is merged #in 1.9.x or we move to 2.0 (if tested working) @@ -27,7 +47,8 @@ - name: Update apt if needed apt: update_cache: yes - when: "ansible_date_time.epoch|float - apt_cache_stat.stat.mtime > {{cache_timeout}}" + when: ("ansible_date_time.epoch|float - apt_cache_stat.stat.mtime > {{cache_timeout}}" or + add_keys|changed or add_repo|changed) tags: - nova-apt-packages - nova-compute-kvm-apt-packages