openstack-ansible-os_nova/tasks/nova_compute_kvm_install.yml
Hugh Saunders 1f63049542 Use PyPi packages for ceph python bindings
Ceph python bindings are now available from pypi, so they can be
installed within a venv. Previously we were relying on the bindings
being installed via an apt package and symlinking out of the relevant
venvs into site packages.

This commit also includes a revert for the commit that introduced the
symlinks:

Revert "Symlink ceph libraries out of venv"

This reverts commit a0ab6f7a6efea1dabf5ac006f766c17596a0d10b.

Ceph Bug: http://tracker.ceph.com/issues/5900
Related-Bug: #1509837
Package URL: https://pypi.python.org/pypi/python-cephlibs/0.94.5.post1

Change-Id: Id8a0b8ea810fd9e43f9743bb2572e2b6b0985230
2015-12-02 22:24:19 +00:00

95 lines
2.7 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: Update apt sources
apt:
update_cache: yes
cache_valid_time: 600
register: apt_update
until: apt_update|success
retries: 5
delay: 2
tags:
- nova-apt-packages
- nova-compute-kvm-apt-packages
- name: Install apt packages
apt:
pkg: "{{ item }}"
state: latest
register: install_packages
until: install_packages|success
retries: 5
delay: 2
with_items: nova_compute_kvm_apt_packages
tags:
- nova-apt-packages
- nova-compute-kvm-apt-packages
- name: Install pip packages (venv)
pip:
name: "{{ item }}"
state: present
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
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: present
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