Files
openstack-ansible-os_nova/tasks/nova_compute_kvm_install.yml
Jesse Pretorius f7b96c0229 Update role to use the Multi-Distro framework
* The default apt packages have been moved the appropriate
  platform specific vars files.
* Most apt related tasks have been moved into the common
  nova_install_apt task file which is only executed when
  apt is the package manager.
* Vars with 'apt' in the name have been changed to be more
  generic.

Implements: blueprint multi-platform-host
Change-Id: Ie97c0379b18a9ecabf3e4c0148cb555771b04747
2016-07-02 12:19:40 +00:00

91 lines
2.9 KiB
YAML

---
# Copyright 2014, 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: Check if qemu save directory is a directory
stat:
path: "/var/lib/libvirt/qemu/save"
register: qemu_savedir_stat
- name: Check if qemu save directory is empty
shell: 'ls -1A /var/lib/libvirt/qemu/save'
register: qemu_savedir_empty
# We force the link creation if our tests passed, this removes the directory as
# well
- name: Symlink qemu save dir to nova_libvirt_save_path
file:
path: "/var/lib/libvirt/qemu/save"
state: link
owner: "{{ nova_qemu_user }}"
group: "{{ nova_qemu_group }}"
src: "{{ nova_libvirt_save_path }}"
force: True
when:
- qemu_savedir_stat.stat.isdir
- qemu_savedir_empty.stdout_lines | length == 0
- name: Install pip packages (venv)
pip:
name: "{{ item }}"
state: latest
virtualenv: "{{ nova_venv_bin | dirname }}"
virtualenv_site_packages: "no"
extra_args: "{{ pip_install_options|default('') }}"
register: install_packages
until: install_packages|success
retries: 5
delay: 2
with_items: "{{ nova_compute_pip_packages }}"
when:
- nova_venv_enabled | bool
- nova_get_venv | failed or nova_developer_mode | bool
tags:
- nova-install
- nova-pip-packages
# TODO(cloudnull): use a package from pypi when its made available
# This is being done because guestfs is not an installable package at this time.
# There is a change in the works to upload the guestfs package to pypi in the
# future however that's not been done as of yet.
# related thread http://lists.openstack.org/pipermail/openstack-dev/2015-July/070927.html
- name: Link guestfs into the venv
file:
src: "{{ item.name }}"
dest: "{{ nova_venv_bin | dirname }}/lib/python2.7/{{ item.name | basename }}"
state: "{{ item.state }}"
force: "yes"
with_items:
- { state: link, name: "/usr/lib/python2.7/dist-packages/libguestfsmod.so" }
- { state: link, name: "/usr/lib/python2.7/dist-packages/guestfs.py" }
when: nova_venv_enabled | bool
tags:
- nova-install
- nova-pip-packages
- name: Install pip packages (no venv)
pip:
name: "{{ item }}"
state: latest
extra_args: "{{ pip_install_options|default('') }}"
register: install_packages
until: install_packages|success
retries: 5
delay: 2
with_items: "{{ nova_compute_pip_packages }}"
when: not nova_venv_enabled | bool
tags:
- nova-install
- nova-pip-packages