Streamline task execution

This change moves the compute drivers into their own directory which will
isolate the compute execution tasks which will limit the loaded tasks
and ensure we're not excessively skipping tasks.

Change-Id: I67895687906c3ba4cbdc8c3cb6a3b17f07bceee1
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
This commit is contained in:
Kevin Carter 2017-05-18 13:17:01 -05:00
parent 385d03cf20
commit 33b2472724
27 changed files with 151 additions and 150 deletions

@ -52,7 +52,7 @@
tags:
- nova-pip-packages
- include: nova_console_novnc_ssl.yml
- include: consoles/nova_console_novnc_ssl.yml
static: no
when:
- nova_console_user_ssl_cert is defined

@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- include: nova_compute_kvm_install.yml
- include: drivers/kvm/nova_compute_kvm_install.yml
tags:
- nova-config
@ -34,7 +34,7 @@
- nova-kvm
- name: Set kernel permissions to enable libguestfs features (Ubuntu)
include: nova_kernel_permissions.yml
include: drivers/kvm/nova_kernel_permissions.yml
when:
- ansible_distribution == 'Ubuntu'
- nova_libvirt_inject_key | bool or nova_libvirt_inject_password | bool
@ -113,13 +113,13 @@
- nova-kvm
- nova-libvirt
- include: nova_disable_smt.yml
- include: drivers/kvm/nova_disable_smt.yml
when:
- ansible_architecture == 'ppc64le'
tags:
- nova-config
- include: nova_compute_kvm_virsh_net_remove.yml
- include: drivers/kvm/nova_compute_kvm_virsh_net_remove.yml
tags:
- nova-config
- nova-kvm

@ -29,3 +29,28 @@
delay: 2
tags:
- nova-pip-packages
- name: Add nova user to lxd group
user:
name: "{{ nova_system_user_name }}"
groups: "lxd"
append: "yes"
tags:
- nova-lxd
- name: Place lxd config script
template:
src: lxd-init.sh.j2
dest: "{{ nova_system_home_folder }}/lxd-init.sh"
owner: "{{ nova_system_user_name }}"
group: "lxd"
mode: 0770
register: lxd_init_script
tags:
- nova-lxd
- name: Configure lxd init
command: "{{ nova_system_home_folder }}/lxd-init.sh"
when: lxd_init_script | changed
tags:
- nova-lxd

@ -13,10 +13,20 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- include: nova_compute_powervm_install.yml
- name: Install pip packages
pip:
name: "{{ nova_compute_powervm_pip_packages }}"
state: "{{ nova_pip_package_state }}"
virtualenv: "{{ nova_bin | dirname }}"
virtualenv_site_packages: "no"
extra_args: "{{ pip_install_options|default('') }}"
register: install_packages
until: install_packages|success
retries: 5
delay: 2
tags:
- nova-install
- nova-powervm
- nova-pip-packages
- name: Add nova user to pvm_admin group
user:

1
tasks/drivers/qemu Symbolic link

@ -0,0 +1 @@
kvm

@ -34,10 +34,11 @@
- include: nova_virt_detect.yml
static: no
when: nova_virt_type is not defined
when:
- nova_virt_type is not defined
tags:
- always
- nova-virt-detect
- nova-config
- include: nova_pre_install.yml
tags:
@ -52,7 +53,8 @@
- nova-config
- include: nova_db_setup.yml
when: inventory_hostname == groups['nova_api_os_compute'][0]
when:
- inventory_hostname == groups['nova_api_os_compute'][0]
tags:
- nova-config
@ -61,7 +63,8 @@
- nova-config
- include: nova_service_setup.yml
when: inventory_hostname == groups['nova_api_os_compute'][0]
when:
- inventory_hostname == groups['nova_api_os_compute'][0]
tags:
- nova-config
@ -73,7 +76,8 @@
- nova-placement
- include: nova_compute.yml
when: inventory_hostname in groups['nova_compute']
when:
- inventory_hostname in groups['nova_compute']
tags:
- nova-compute
@ -82,13 +86,14 @@
- include: nova_compute_wait.yml
when:
- "{{ 'nova_compute' in group_names }}"
- "{{ nova_compute_restart | default(dict(changed=False)) | changed }}"
- "{{ nova_discover_hosts_in_cells_interval | int < 1 }}"
- "'nova_compute' in group_names"
- nova_compute_restart | default(dict(changed=False)) | changed
- nova_discover_hosts_in_cells_interval | int < 1
tags:
- nova-config
- include: nova_db_post_setup.yml
when: inventory_hostname == groups['nova_api_os_compute'][0]
when:
- inventory_hostname == groups['nova_api_os_compute'][0]
tags:
- nova-config

@ -13,7 +13,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- include: "nova_compute_{{ nova_virt_type }}.yml"
- include: "{{ item }}"
with_first_found:
- files:
- "nova_compute_{{ nova_virt_type }}.yml"
skip: true
paths:
- "drivers/{{ nova_virt_type }}/"
tags:
- nova-install

@ -29,7 +29,8 @@
dest: "/var/tmp/openstack-nova-key.sh"
mode: "0755"
delegate_to: localhost
when: inventory_hostname == first_available_compute
when:
- inventory_hostname == first_available_compute
tags:
- nova-key
- nova-key-distribute

@ -1,46 +0,0 @@
---
# Copyright 2016, Walmart Stores, 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.
- include: nova_compute_lxd_install.yml
tags:
- nova-install
- name: Add nova user to lxd group
user:
name: "{{ nova_system_user_name }}"
groups: "lxd"
append: "yes"
tags:
- nova-lxd
- nova-install
- name: Place lxd config script
template:
src: lxd-init.sh.j2
dest: "{{ nova_system_home_folder }}/lxd-init.sh"
owner: "{{ nova_system_user_name }}"
group: "lxd"
mode: 0770
register: lxd_init_script
tags:
- nova-lxd
- nova-config
- name: Configure lxd init
command: "{{ nova_system_home_folder }}/lxd-init.sh"
when: lxd_init_script | changed
tags:
- nova-lxd
- nova-config

@ -1,29 +0,0 @@
---
# Copyright 2016, IBM Corp.
#
# 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 pip packages
pip:
name: "{{ nova_compute_powervm_pip_packages }}"
state: "{{ nova_pip_package_state }}"
virtualenv: "{{ nova_bin | dirname }}"
virtualenv_site_packages: "no"
extra_args: "{{ pip_install_options|default('') }}"
register: install_packages
until: install_packages|success
retries: 5
delay: 2
tags:
- nova-install
- nova-pip-packages

@ -38,7 +38,8 @@
{% for item in nova_developer_constraints %}
{{ item }}
{% endfor %}
when: nova_developer_mode | bool
when:
- nova_developer_mode | bool
tags:
- nova-pip-packages
@ -61,7 +62,8 @@
url: "{{ nova_venv_download_url | replace('tgz', 'checksum') }}"
return_content: yes
register: nova_venv_checksum
when: nova_venv_download | bool
when:
- nova_venv_download | bool
tags:
- nova-pip-packages
@ -71,7 +73,8 @@
dest: "/var/cache/{{ nova_venv_download_url | basename }}"
checksum: "sha1:{{ nova_venv_checksum.content | trim }}"
register: nova_get_venv
when: nova_venv_download | bool
when:
- nova_venv_download | bool
tags:
- nova-pip-packages
@ -79,7 +82,8 @@
file:
path: "{{ nova_bin | dirname }}"
state: absent
when: nova_get_venv | changed
when:
- nova_get_venv | changed
tags:
- nova-pip-packages
@ -88,7 +92,8 @@
path: "{{ nova_bin | dirname }}"
state: directory
register: nova_venv_dir
when: nova_get_venv | changed
when:
- nova_get_venv | changed
tags:
- nova-pip-packages
@ -97,7 +102,8 @@
src: "/var/cache/{{ nova_venv_download_url | basename }}"
dest: "{{ nova_bin | dirname }}"
copy: "no"
when: nova_get_venv | changed
when:
- nova_get_venv | changed
notify: Restart nova services
tags:
- nova-pip-packages
@ -116,7 +122,8 @@
until: install_packages|success
retries: 5
delay: 2
when: nova_get_venv | failed or nova_get_venv | skipped
when:
- nova_get_venv | failed or nova_get_venv | skipped
notify: Restart nova services
tags:
- nova-pip-packages
@ -132,7 +139,8 @@
- name: Update virtualenv path
command: >
virtualenv-tools --update-path=auto --reinitialize {{ nova_bin | dirname }}
when: nova_get_venv | changed
when:
- nova_get_venv | changed
tags:
- nova-pip-packages
@ -145,9 +153,16 @@
with_items:
- "{{ install_nova_role_packages.results }}"
- include: "nova_console_{{ nova_console_type }}_install.yml"
- include: "{{ item }}"
with_first_found:
- files:
- "nova_console_{{ nova_console_type }}_install.yml"
skip: true
paths:
- "consoles/"
when:
- "{{ 'nova_console' in group_names }}"
- "'nova_console' in group_names"
tags:
- nova-install
- nova-novnc-console
- nova-spice-console

@ -13,8 +13,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- include: nova_install_apt_powervm.yml
when: nova_virt_type == "powervm"
- include: "{{ item }}"
with_first_found:
- files:
- "nova_install_apt_{{ nova_virt_type }}.yml"
skip: true
tags:
- nova-install
- name: Install nova role packages (apt)
apt:
@ -24,7 +29,8 @@
cache_valid_time: "{{ cache_timeout }}"
with_items:
- "{{ nova_packages_list | selectattr('enabled') | sum(attribute='packages', start=[]) }}"
when: item != ''
when:
- item != ''
register: install_nova_role_packages
async: 600
poll: 0

@ -19,7 +19,8 @@
state: "{{ nova_package_state }}"
with_items:
- "{{ nova_packages_list | selectattr('enabled') | sum(attribute='packages', start=[]) }}"
when: item != ''
when:
- item != ''
register: install_nova_role_packages
async: 600
poll: 0

@ -27,7 +27,8 @@
until: install_packages|success
retries: 5
delay: 2
when: nova_get_venv | failed or nova_get_venv | skipped
when:
- nova_get_venv | failed or nova_get_venv | skipped
notify: Restart nova services
tags:
- nova-pip-packages

@ -51,6 +51,7 @@
src: "/etc/nginx/sites-available/nova_placement_api.conf"
path: "/etc/nginx/sites-enabled/nova_placement_api.conf"
state: link
when: ansible_os_family == "Debian"
when:
- ansible_os_family == "Debian"
notify:
- Reload Nginx

@ -46,7 +46,8 @@
password: "{{ nova_placement_service_password }}"
insecure: "{{ keystone_service_adminuri_insecure }}"
register: add_service
when: not nova_placement_service_in_ldap | bool
when:
- not nova_placement_service_in_ldap | bool
until: add_service|success
retries: 5
delay: 10
@ -67,7 +68,8 @@
role_name: "{{ nova_placement_service_role_name }}"
insecure: "{{ keystone_service_adminuri_insecure }}"
register: add_service
when: not nova_placement_service_in_ldap | bool
when:
- not nova_placement_service_in_ldap | bool
until: add_service|success
retries: 5
delay: 10

@ -30,7 +30,8 @@
- "{{ nova_system_home_folder }}/.ssh/authorized_keys"
- "{{ nova_system_home_folder }}/.ssh/id_rsa"
- "{{ nova_system_home_folder }}/.ssh/id_rsa.pub"
when: nova_recreate_keys | bool
when:
- nova_recreate_keys | bool
tags:
- nova-key
- nova-key-create
@ -96,7 +97,8 @@
owner: "{{ nova_system_user_name }}"
group: "{{ nova_system_group_name }}"
mode: "0755"
when: log_dir.rc != 0
when:
- log_dir.rc != 0
tags:
- nova-dirs
- nova-logs
@ -116,4 +118,3 @@
set_fact:
nova_console_type: "novnc"
when: ansible_architecture == 'ppc64le'

@ -47,7 +47,8 @@
password: "{{ nova_service_password }}"
insecure: "{{ keystone_service_adminuri_insecure }}"
register: add_service
when: not nova_service_in_ldap | bool
when:
- not nova_service_in_ldap | bool
until: add_service|success
retries: 5
delay: 10
@ -69,7 +70,8 @@
role_name: "{{ nova_service_role_name }}"
insecure: "{{ keystone_service_adminuri_insecure }}"
register: add_service
when: not nova_service_in_ldap | bool
when:
- not nova_service_in_ldap | bool
until: add_service|success
retries: 5
delay: 10

@ -13,39 +13,38 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Get CPU info content and store as var
command: cat /proc/cpuinfo
register: cpuinfo_contents
changed_when: false
failed_when: false
tags:
- always
- block:
- name: Get CPU info content and store as var
command: cat /proc/cpuinfo
register: cpuinfo_contents
changed_when: false
tags:
- always
- name: Register a fact for the nova kvm virt type
set_fact:
nova_virt_type: "kvm"
when: cpuinfo_contents.stdout.find('vmx') != -1
or cpuinfo_contents.stdout.find('svm') != -1
or cpuinfo_contents.stdout.find('PowerNV') != -1
or (cpuinfo_contents.stdout.find('pSeries') != -1
and cpuinfo_contents.stdout.find('qemu') != -1
and ansible_architecture == 'ppc64le')
tags:
- nova-virt-type-set
- name: Register a fact for the nova kvm virt type
set_fact:
nova_virt_type: "kvm"
when: cpuinfo_contents.stdout.find('vmx') != -1
or cpuinfo_contents.stdout.find('svm') != -1
or cpuinfo_contents.stdout.find('PowerNV') != -1
or (cpuinfo_contents.stdout.find('pSeries') != -1
and cpuinfo_contents.stdout.find('qemu') != -1
and ansible_architecture == 'ppc64le')
tags:
- nova-virt-type-set
- name: Register a fact for the nova powervm virt type
set_fact:
nova_virt_type: "powervm"
when:
- cpuinfo_contents.stdout.find('pSeries') != -1
- ansible_architecture == 'ppc64le'
- cpuinfo_contents.stdout.find('qemu') == -1
tags:
- nova-virt-type-set
- name: Register a fact for the nova qemu virt type
set_fact:
nova_virt_type: "qemu"
when: nova_virt_type is not defined
tags:
- always
- name: Register a fact for the nova powervm virt type
set_fact:
nova_virt_type: "powervm"
when:
- cpuinfo_contents.stdout.find('pSeries') != -1
- ansible_architecture == 'ppc64le'
- cpuinfo_contents.stdout.find('qemu') == -1
tags:
- nova-virt-type-set
rescue:
- name: Register a fact for the nova qemu virt type
set_fact:
nova_virt_type: "qemu"
tags:
- always