diff --git a/defaults/main.yml b/defaults/main.yml index 52dbf280..9f9792c5 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -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 diff --git a/releasenotes/notes/use-uca-by-default-070751b0b388fcbe.yaml b/releasenotes/notes/use-uca-by-default-070751b0b388fcbe.yaml index f96b65e2..e473f280 100644 --- a/releasenotes/notes/use-uca-by-default-070751b0b388fcbe.yaml +++ b/releasenotes/notes/use-uca-by-default-070751b0b388fcbe.yaml @@ -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``. diff --git a/tasks/neutron_install-apt.yml b/tasks/neutron_install-apt.yml index 08c69ecb..5d4bda73 100644 --- a/tasks/neutron_install-apt.yml +++ b/tasks/neutron_install-apt.yml @@ -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 diff --git a/tests/test-install-neutron.yml b/tests/test-install-neutron.yml index 1c140c8d..202083dd 100644 --- a/tests/test-install-neutron.yml +++ b/tests/test-install-neutron.yml @@ -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: diff --git a/vars/ubuntu-14.04.yml b/vars/ubuntu-14.04.yml index c20b8cef..bcf88281 100644 --- a/vars/ubuntu-14.04.yml +++ b/vars/ubuntu-14.04.yml @@ -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" diff --git a/vars/ubuntu-16.04.yml b/vars/ubuntu-16.04.yml index a6e8b50d..62cda1e6 100644 --- a/vars/ubuntu-16.04.yml +++ b/vars/ubuntu-16.04.yml @@ -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"