Move UCA enable and repo URL var to role defaults

In order to expose the var in role documentation and to allow the use
of dynamically set facts to override the value in CI environments the
variables are moved from the role vars to the role defaults.

The test preparation implements an override of the URL for OpenStack-CI
to make use of the local mirrors.

Change-Id: Iffa32adb971f281e7e274209ee500b1756fbf0a1
This commit is contained in:
Jesse Pretorius 2016-07-16 20:47:20 +01:00 committed by Jesse Pretorius (odyssey4me)
parent 2bdff13b29
commit 92aecc57bc
5 changed files with 41 additions and 6 deletions

View File

@ -303,10 +303,17 @@ nova_scheduler_program_name: nova-scheduler
# If you want to regenerate the nova users SSH keys, on each run, set this var to True
# Otherwise keys will be generated on the first run and not regenerated each run.
nova_recreate_keys: False
# Toggle the use of Ubuntu Cloud Archive
nova_uca_enable: True
# Ubuntu Cloud Archive mirror URL
uca_apt_repo_url: "http://ubuntu-cloud.archive.canonical.com/ubuntu"
# Nova Ceph rbd
# Enble and define nova_libvirt_images_rbd_pool to use rbd as nova backend
#nova_libvirt_images_rbd_pool: vms
nova_ceph_client: '{{ cinder_ceph_client }}'
# TODO(odyssey4me) - the uuid should be removed, there should be no defaults for secrets
nova_ceph_client_uuid: 517a4663-3927-44bc-9ea7-4a90e1cd4c66
## General Nova configuration

View File

@ -97,6 +97,21 @@
- "%"
delegate_to: "10.100.102.101"
when: inventory_hostname == groups['neutron_all'][0]
- name: Check if this is an OpenStack-CI nodepool instance
stat:
path: /etc/nodepool/provider
register: nodepool
delegate_to: localhost
- name: Determine the existing Ubuntu repo URL (only on OpenStack-CI)
shell: 'awk "/^deb .*ubuntu\/? {{ ansible_distribution_release }} main/ {print \$2; exit}" /etc/apt/sources.list'
register: ubuntu_repo_url
changed_when: false
when: nodepool.stat.exists | bool
delegate_to: localhost
- name: Set Ubuntu Cloud Archive repo URL based on discovered information
set_fact:
uca_apt_repo_url: "{{ ubuntu_repo_url.stdout | netorigin }}/ubuntu-cloud-archive"
when: nodepool.stat.exists | bool
roles:
- role: "os_neutron"
vars_files:

View File

@ -93,6 +93,21 @@
- "localhost"
- "%"
when: inventory_hostname == groups['nova_all'][0]
- name: Check if this is an OpenStack-CI nodepool instance
stat:
path: /etc/nodepool/provider
register: nodepool
delegate_to: localhost
- name: Determine the existing Ubuntu repo URL (only on OpenStack-CI)
shell: 'awk "/^deb .*ubuntu\/? {{ ansible_distribution_release }} main/ {print \$2; exit}" /etc/apt/sources.list'
register: ubuntu_repo_url
changed_when: false
when: nodepool.stat.exists | bool
delegate_to: localhost
- name: Set Ubuntu Cloud Archive repo URL based on discovered information
set_fact:
uca_apt_repo_url: "{{ ubuntu_repo_url.stdout | netorigin }}/ubuntu-cloud-archive"
when: nodepool.stat.exists | bool
roles:
- role: "{{ rolename | basename }}"
vars_files:

View File

@ -53,11 +53,11 @@ nova_compute_kvm_packages:
- multipath-tools
# Ubuntu Cloud Archive variables
nova_uca_enable: True
# There are no UCA packages for Trusty beyond Mitaka, so the selected
# release here has to remain at Mitaka.
uca_openstack_release: mitaka
uca_repo_url: "http://ubuntu-cloud.archive.canonical.com/ubuntu"
uca_repo_dist: "{{ ansible_lsb.codename }}-updates/{{ uca_openstack_release }}"
uca_repo: "deb {{ uca_repo_url }} {{ uca_repo_dist }} main"
uca_repo: "deb {{ uca_apt_repo_url }} {{ uca_repo_dist }} main"
# nova powervm virt driver
nova_compute_powervm_packages:

View File

@ -53,11 +53,9 @@ nova_compute_kvm_packages:
- multipath-tools
# Ubuntu Cloud Archive variables
nova_uca_enable: True
uca_openstack_release: newton
uca_repo_url: "http://ubuntu-cloud.archive.canonical.com/ubuntu"
uca_repo_dist: "{{ ansible_lsb.codename }}-updates/{{ uca_openstack_release }}"
uca_repo: "deb {{ uca_repo_url }} {{ uca_repo_dist }} main"
uca_repo: "deb {{ uca_apt_repo_url }} {{ uca_repo_dist }} main"
# nova powervm virt driver
nova_compute_powervm_packages: