Merge "Combine package install tasks"
This commit is contained in:
commit
5fc846b56c
@ -24,6 +24,11 @@
|
|||||||
tags:
|
tags:
|
||||||
- always
|
- always
|
||||||
|
|
||||||
|
- name: Gather variables that apply to all operating systems
|
||||||
|
include_vars: common.yml
|
||||||
|
tags:
|
||||||
|
- always
|
||||||
|
|
||||||
- name: Fail when virt type is unsupported
|
- name: Fail when virt type is unsupported
|
||||||
fail: msg="Unsupported Virt Type Provided {{ nova_supported_virt_types }}"
|
fail: msg="Unsupported Virt Type Provided {{ nova_supported_virt_types }}"
|
||||||
when:
|
when:
|
||||||
|
@ -13,17 +13,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
- include: nova_compute_kvm.yml
|
- include: "nova_compute_{{ nova_virt_type }}.yml"
|
||||||
when: nova_virt_type == 'kvm' or nova_virt_type == 'qemu'
|
|
||||||
|
|
||||||
- include: nova_compute_powervm.yml
|
|
||||||
when: nova_virt_type == 'powervm'
|
|
||||||
|
|
||||||
- include: nova_compute_lxd.yml
|
|
||||||
when: nova_virt_type == 'lxd'
|
|
||||||
|
|
||||||
- include: nova_compute_ironic.yml
|
|
||||||
when: nova_virt_type == 'ironic'
|
|
||||||
tags:
|
tags:
|
||||||
- nova-install
|
- nova-install
|
||||||
|
|
||||||
|
@ -38,21 +38,6 @@
|
|||||||
tags:
|
tags:
|
||||||
- novalink-repo
|
- novalink-repo
|
||||||
|
|
||||||
- name: Install apt packages
|
|
||||||
apt:
|
|
||||||
pkg: "{{ item }}"
|
|
||||||
state: "{{ nova_package_state }}"
|
|
||||||
update_cache: yes
|
|
||||||
cache_valid_time: "{{ cache_timeout }}"
|
|
||||||
register: install_packages
|
|
||||||
until: install_packages|success
|
|
||||||
retries: 5
|
|
||||||
delay: 2
|
|
||||||
with_items: "{{ nova_compute_powervm_distro_packages }}"
|
|
||||||
tags:
|
|
||||||
- nova-apt-packages
|
|
||||||
- nova-compute-powervm-apt-packages
|
|
||||||
|
|
||||||
- name: Register pypowervm module path (venv)
|
- name: Register pypowervm module path (venv)
|
||||||
command: python -c 'import pypowervm; print pypowervm.__file__'
|
command: python -c 'import pypowervm; print pypowervm.__file__'
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
1
tasks/nova_compute_qemu.yml
Symbolic link
1
tasks/nova_compute_qemu.yml
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
nova_compute_kvm.yml
|
@ -13,62 +13,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
- name: Ensure apt cache is up to date
|
- include: "nova_install_{{ ansible_pkg_mgr }}.yml"
|
||||||
apt:
|
|
||||||
update_cache: yes
|
|
||||||
cache_valid_time: "{{ cache_timeout }}"
|
|
||||||
when:
|
|
||||||
- ansible_pkg_mgr == 'apt'
|
|
||||||
|
|
||||||
- name: Add Ubuntu Cloud Archive key package
|
|
||||||
package:
|
|
||||||
name: ubuntu-cloud-keyring
|
|
||||||
state: "{{ nova_package_state }}"
|
|
||||||
when:
|
|
||||||
- nova_uca_enable
|
|
||||||
- ansible_pkg_mgr == 'apt'
|
|
||||||
register: nova_uca_add_keys
|
|
||||||
tags:
|
|
||||||
- add-apt-keys
|
|
||||||
|
|
||||||
- name: Add Ubuntu Cloud Archive apt repository
|
|
||||||
apt_repository:
|
|
||||||
repo: "{{ uca_repo }}"
|
|
||||||
state: present
|
|
||||||
update_cache: yes
|
|
||||||
filename: "{{ uca_apt_source_list_filename | default(omit) }}"
|
|
||||||
register: nova_uca_add_repo
|
|
||||||
when:
|
|
||||||
- nova_uca_enable
|
|
||||||
- ansible_pkg_mgr == 'apt'
|
|
||||||
until: add_repo|success
|
|
||||||
retries: 5
|
|
||||||
delay: 2
|
|
||||||
tags:
|
|
||||||
- add-uca-repo
|
|
||||||
|
|
||||||
- name: Install RDO package
|
|
||||||
package:
|
|
||||||
name: "{{ rdo_package }}"
|
|
||||||
state: "present"
|
|
||||||
register: install_cloud_rdo_package
|
|
||||||
until: install_cloud_rdo_package | success
|
|
||||||
retries: 5
|
|
||||||
delay: 2
|
|
||||||
when:
|
|
||||||
- ansible_pkg_mgr == 'yum'
|
|
||||||
|
|
||||||
- name: Install distro packages
|
|
||||||
package:
|
|
||||||
name: "{{ item }}"
|
|
||||||
state: "{{ nova_package_state }}"
|
|
||||||
register: install_packages
|
|
||||||
until: install_packages|success
|
|
||||||
retries: 5
|
|
||||||
delay: 2
|
|
||||||
with_items: "{{ nova_distro_packages }}"
|
|
||||||
tags:
|
|
||||||
- nova-apt-packages
|
|
||||||
|
|
||||||
- name: Remove known problem packages for the Spice console
|
- name: Remove known problem packages for the Spice console
|
||||||
package:
|
package:
|
||||||
@ -86,54 +31,6 @@
|
|||||||
- nova-apt-packages
|
- nova-apt-packages
|
||||||
- nova-spice-apt-packages
|
- nova-spice-apt-packages
|
||||||
|
|
||||||
- name: Install distro packages (novnc console)
|
|
||||||
package:
|
|
||||||
name: "{{ item }}"
|
|
||||||
state: "{{ nova_package_state }}"
|
|
||||||
register: install_packages
|
|
||||||
until: install_packages|success
|
|
||||||
retries: 5
|
|
||||||
delay: 2
|
|
||||||
with_items: "{{ nova_novnc_distro_packages }}"
|
|
||||||
when:
|
|
||||||
- inventory_hostname in groups['nova_console']
|
|
||||||
- nova_console_type == "novnc"
|
|
||||||
tags:
|
|
||||||
- nova-apt-packages
|
|
||||||
- nova-novnc-apt-packages
|
|
||||||
|
|
||||||
- name: Install distro packages (compute - KVM)
|
|
||||||
package:
|
|
||||||
name: "{{ item }}"
|
|
||||||
state: "{{ nova_package_state }}"
|
|
||||||
register: install_packages
|
|
||||||
until: install_packages|success
|
|
||||||
retries: 5
|
|
||||||
delay: 2
|
|
||||||
with_items: "{{ nova_compute_kvm_distro_packages }}"
|
|
||||||
when:
|
|
||||||
- inventory_hostname in groups['nova_compute']
|
|
||||||
- nova_virt_type == 'kvm' or nova_virt_type == 'qemu'
|
|
||||||
tags:
|
|
||||||
- nova-apt-packages
|
|
||||||
- nova-compute-kvm-apt-packages
|
|
||||||
|
|
||||||
- name: Install distro packages (compute - LXD)
|
|
||||||
package:
|
|
||||||
name: "{{ item }}"
|
|
||||||
state: "{{ nova_package_state }}"
|
|
||||||
register: install_packages
|
|
||||||
until: install_packages|success
|
|
||||||
retries: 5
|
|
||||||
delay: 2
|
|
||||||
with_items: "{{ nova_compute_lxd_distro_packages }}"
|
|
||||||
when:
|
|
||||||
- inventory_hostname in groups['nova_compute']
|
|
||||||
- nova_virt_type == 'lxd'
|
|
||||||
tags:
|
|
||||||
- nova-apt-packages
|
|
||||||
- nova-compute-lxd-apt-packages
|
|
||||||
|
|
||||||
- name: Create developer mode constraint file
|
- name: Create developer mode constraint file
|
||||||
copy:
|
copy:
|
||||||
dest: "/opt/developer-pip-constraints.txt"
|
dest: "/opt/developer-pip-constraints.txt"
|
||||||
@ -145,7 +42,7 @@
|
|||||||
tags:
|
tags:
|
||||||
- nova-pip-packages
|
- nova-pip-packages
|
||||||
|
|
||||||
- name: Install requires pip packages
|
- name: Install required pip packages
|
||||||
pip:
|
pip:
|
||||||
name: "{{ nova_requires_pip_packages }}"
|
name: "{{ nova_requires_pip_packages }}"
|
||||||
state: "{{ nova_pip_package_state }}"
|
state: "{{ nova_pip_package_state }}"
|
||||||
@ -230,16 +127,18 @@
|
|||||||
tags:
|
tags:
|
||||||
- nova-pip-packages
|
- nova-pip-packages
|
||||||
|
|
||||||
- include: nova_console_spice_install.yml
|
- name: Ensure distro packages are fully installed on all hosts
|
||||||
when:
|
async_status:
|
||||||
- inventory_hostname in groups['nova_console']
|
jid: "{{ item.ansible_job_id }}"
|
||||||
- nova_console_type == "spice"
|
register: install_nova_role_packages_async_job
|
||||||
tags:
|
until: install_nova_role_packages_async_job.finished
|
||||||
- nova-spice-console
|
retries: 300
|
||||||
|
with_items:
|
||||||
|
- "{{ install_nova_role_packages.results }}"
|
||||||
|
|
||||||
- include: nova_console_novnc_install.yml
|
- include: "nova_console_{{ nova_console_type }}_install.yml"
|
||||||
when:
|
when:
|
||||||
- inventory_hostname in groups['nova_console']
|
- "{{ 'nova_console' in group_names }}"
|
||||||
- nova_console_type == "novnc"
|
|
||||||
tags:
|
tags:
|
||||||
- nova-novnc-console
|
- nova-novnc-console
|
||||||
|
- nova-spice-console
|
||||||
|
54
tasks/nova_install_apt.yml
Normal file
54
tasks/nova_install_apt.yml
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
---
|
||||||
|
# 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.
|
||||||
|
|
||||||
|
- name: Ensure apt cache is up to date
|
||||||
|
apt:
|
||||||
|
update_cache: yes
|
||||||
|
cache_valid_time: "{{ cache_timeout }}"
|
||||||
|
|
||||||
|
- name: Add Ubuntu Cloud Archive key package
|
||||||
|
package:
|
||||||
|
name: ubuntu-cloud-keyring
|
||||||
|
state: "{{ nova_package_state }}"
|
||||||
|
when:
|
||||||
|
- nova_uca_enable
|
||||||
|
register: nova_uca_add_keys
|
||||||
|
tags:
|
||||||
|
- add-apt-keys
|
||||||
|
|
||||||
|
- name: Add Ubuntu Cloud Archive apt repository
|
||||||
|
apt_repository:
|
||||||
|
repo: "{{ uca_repo }}"
|
||||||
|
state: present
|
||||||
|
update_cache: yes
|
||||||
|
filename: "{{ uca_apt_source_list_filename | default(omit) }}"
|
||||||
|
register: nova_uca_add_repo
|
||||||
|
when:
|
||||||
|
- nova_uca_enable
|
||||||
|
until: add_repo|success
|
||||||
|
retries: 5
|
||||||
|
delay: 2
|
||||||
|
tags:
|
||||||
|
- add-uca-repo
|
||||||
|
|
||||||
|
- name: Install nova role packages (apt)
|
||||||
|
apt:
|
||||||
|
name: "{{ item }}"
|
||||||
|
state: "{{ nova_package_state }}"
|
||||||
|
with_items:
|
||||||
|
- "{{ nova_packages_list | selectattr('enabled') | sum(attribute='packages', start=[]) }}"
|
||||||
|
register: install_nova_role_packages
|
||||||
|
async: 600
|
||||||
|
poll: 0
|
35
tasks/nova_install_yum.yml
Normal file
35
tasks/nova_install_yum.yml
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
---
|
||||||
|
# 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.
|
||||||
|
|
||||||
|
- name: Install RDO package
|
||||||
|
package:
|
||||||
|
name: "{{ rdo_package }}"
|
||||||
|
state: "present"
|
||||||
|
register: install_cloud_rdo_package
|
||||||
|
until: install_cloud_rdo_package | success
|
||||||
|
retries: 5
|
||||||
|
delay: 2
|
||||||
|
when:
|
||||||
|
- ansible_pkg_mgr == 'yum'
|
||||||
|
|
||||||
|
- name: Install nova role packages (yum)
|
||||||
|
yum:
|
||||||
|
name: "{{ item }}"
|
||||||
|
state: "{{ nova_package_state }}"
|
||||||
|
with_items:
|
||||||
|
- "{{ nova_packages_list | selectattr('enabled') | sum(attribute='packages', start=[]) }}"
|
||||||
|
register: install_nova_role_packages
|
||||||
|
async: 600
|
||||||
|
poll: 0
|
30
vars/common.yml
Normal file
30
vars/common.yml
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
---
|
||||||
|
# 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.
|
||||||
|
|
||||||
|
# This special list brings together all of the package installations into one
|
||||||
|
# task to save time and allow for async to work.
|
||||||
|
nova_packages_list:
|
||||||
|
- packages: "{{ nova_distro_packages }}"
|
||||||
|
enabled: yes
|
||||||
|
- packages: "{{ nova_novnc_distro_packages }}"
|
||||||
|
enabled: "{{ 'nova_console' in group_names and nova_console_type == 'novnc' }}"
|
||||||
|
- packages: "{{ nova_compute_kvm_distro_packages }}"
|
||||||
|
enabled: "{{ 'nova_compute' in group_names and nova_virt_type in ['kvm', 'qemu'] }}"
|
||||||
|
- packages: "{{ nova_compute_lxd_distro_packages }}"
|
||||||
|
enabled: "{{ 'nova_compute' in group_names and nova_virt_type == 'lxd' }}"
|
||||||
|
- packages: "{{ nova_compute_powervm_distro_packages }}"
|
||||||
|
enabled: "{{ 'nova_compute' in group_names and nova_virt_type == 'powervm' }}"
|
||||||
|
- packages: "{{ nova_nginx_distro_packages }}"
|
||||||
|
enabled: yes
|
Loading…
Reference in New Issue
Block a user