Install packages in one step

This patch causes neutron's packages to be installed in one step. This
should save time during the CI jobs and it allows us to remove some
tasks.

Change-Id: I8372cb79c202ce7c84386e8b04608aa48f565a5f
This commit is contained in:
Major Hayden 2017-02-20 16:49:07 -05:00
parent fc90cd8833
commit 4871399bfd
3 changed files with 35 additions and 61 deletions

View File

@ -24,6 +24,11 @@
tags:
- always
- name: Gather variables that apply to all operating systems
include_vars: common.yml
tags:
- always
- name: Get CPU info content and store as var
command: cat /proc/cpuinfo
register: cpuinfo_contents

View File

@ -20,71 +20,14 @@
when:
- ansible_pkg_mgr == 'apt'
- name: Install neutron distro packages
- name: Install neutron role packages
package:
name: "{{ item }}"
state: "{{ neutron_package_state }}"
register: install_packages
until: install_packages|success
retries: 5
delay: 2
with_items: "{{ neutron_distro_packages }}"
- name: Install distro packages for LXB
package:
name: "{{ item }}"
state: "{{ neutron_package_state }}"
register: install_packages
until: install_packages|success
retries: 5
delay: 2
with_items: "{{ neutron_lxb_distro_packages }}"
with_items:
- "{{ neutron_packages_list | selectattr('enabled') | sum(attribute='packages', start=[]) }}"
when:
- neutron_services['neutron-linuxbridge-agent']['group'] in group_names
- neutron_services['neutron-linuxbridge-agent'].service_en | bool
- name: Install distro packages for OVS
package:
name: "{{ item }}"
state: "{{ neutron_package_state }}"
register: install_packages
until: install_packages|success
retries: 5
delay: 2
with_items: "{{ neutron_ovs_distro_packages }}"
when:
- (neutron_services['neutron-openvswitch-agent']['group'] in group_names and
neutron_services['neutron-openvswitch-agent'].service_en | bool) or
(neutron_services['dragonflow-controller-agent']['group'] in group_names and
neutron_services['dragonflow-controller-agent'].service_en | bool) or
(neutron_services['dragonflow-l3-agent']['group'] in group_names and
neutron_services['dragonflow-l3-agent'].service_en | bool)
- name: Install distro packages for LBaaS
package:
name: "{{ item }}"
state: "{{ neutron_package_state }}"
register: install_packages
until: install_packages|success
retries: 5
delay: 2
with_items: "{{ neutron_lbaas_distro_packages }}"
when:
- neutron_services['neutron-lbaasv2-agent']['group'] in group_names
- neutron_lbaasv2 | bool
- name: Install distro packages for VPNaaS
package:
name: "{{ item }}"
state: "{{ neutron_package_state }}"
register: install_packages
until: install_packages|success
retries: 5
delay: 2
with_items: "{{ neutron_vpnaas_distro_packages }}"
when:
- neutron_services['neutron-vpnaas-agent']['group'] in group_names
- neutron_vpnaas | bool
- item != ''
- name: Remove known problem packages
package:

26
vars/common.yml Normal file
View File

@ -0,0 +1,26 @@
---
# Copyright 2017, Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
neutron_packages_list:
- packages: "{{ neutron_distro_packages }}"
enabled: yes
- packages: "{{ neutron_ovs_distro_packages }}"
enabled: "{{ (neutron_services['neutron-openvswitch-agent']['group'] in group_names and neutron_services['neutron-openvswitch-agent'].service_en | bool) or (neutron_services['dragonflow-controller-agent']['group'] in group_names and neutron_services['dragonflow-controller-agent'].service_en | bool) or (neutron_services['dragonflow-l3-agent']['group'] in group_names and neutron_services['dragonflow-l3-agent'].service_en | bool) }}"
- packages: "{{ neutron_lxb_distro_packages }}"
enabled: "{{ neutron_services['neutron-linuxbridge-agent']['group'] in group_names and neutron_services['neutron-linuxbridge-agent'].service_en | bool }}"
- packages: "{{ neutron_lbaas_distro_packages }}"
enabled: "{{ neutron_services['neutron-lbaasv2-agent']['group'] in group_names and neutron_lbaasv2 | bool }}"
- packages: "{{ neutron_vpnaas_distro_packages }}"
enabled: "{{ neutron_services['neutron-vpnaas-agent']['group'] in group_names and neutron_vpnaas | bool }}"