Move UCA 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.

The variable to enable/disable the use of UCA has been standardised
to the same as the os_nova role.

Change-Id: I442f6dca8345f78848536f2fc923b72be8a6d092
This commit is contained in:
Jesse Pretorius 2016-07-16 20:55:20 +01:00
parent 30899b8368
commit 1240dd0cf0
6 changed files with 27 additions and 11 deletions

View File

@ -38,8 +38,6 @@ neutron_developer_constraints:
- "git+{{ neutron_lbaas_git_repo }}@{{ neutron_lbaas_git_install_branch }}#egg=neutron-lbaas"
- "git+{{ neutron_vpnaas_git_repo }}@{{ neutron_vpnaas_git_install_branch }}#egg=neutron-vpnaas"
neutron_use_uca: True
# Name of the virtual env to deploy into
neutron_venv_tag: untagged
neutron_bin: "/openstack/venvs/neutron-{{ neutron_venv_tag }}/bin"
@ -384,6 +382,11 @@ neutron_service_in_ldap: false
# neutron_local_ip is used for the VXLAN local tunnel endpoint
neutron_local_ip: 127.0.0.1
# Toggle the use of Ubuntu Cloud Archive
neutron_uca_enable: True
# Ubuntu Cloud Archive mirror URL
uca_apt_repo_url: "http://ubuntu-cloud.archive.canonical.com/ubuntu"
# When running in an AIO, we need to implement an iptables rule in any
# neutron_agent containers to that ensure instances can communicate with
# the neutron metadata service. This is necessary because in an AIO

View File

@ -1,6 +1,4 @@
---
other:
- Neutron now makes use of ubuntu cloud archive by
default. This can be disabled by setting
``neutron_use_uca`` to ``False`` in your user
variables.
upgrade:
- Neutron now makes use of Ubuntu Cloud Archive by default. This can be
disabled by setting ``neutron_uca_enable`` to ``False``.

View File

@ -18,14 +18,14 @@
pkg: ubuntu-cloud-keyring
state: latest
register: add_uca_keys
when: neutron_use_uca | bool
when: neutron_uca_enable | bool
- name: Add Ubuntu Cloud Archive Repository
apt_repository:
repo: "{{ uca_repo }}"
state: present
register: add_uca_repo
when: neutron_use_uca | bool
when: neutron_uca_enable | bool
#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

View File

@ -91,6 +91,21 @@
when: inventory_hostname == groups['neutron_all'][0]
tags:
- mysql-db-setup
- 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 }}"
post_tasks:

View File

@ -13,10 +13,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# Ubuntu Cloud Archive variables
# 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"

View File

@ -13,8 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# Ubuntu Cloud Archive variables
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"