Use bindep.txt and requirements.txt for dependencies
Binary and pip dependencies and their versions are currently spilled
over everywhere. Apart from not having them easily identifiable, some
dependencies are not pinned either.
This is a proposal to start using tools and built in capabilities for
managing requirements in standardized way which could be helpful during
offline deployment work and for multidistro support.
The tools & capabilities are listed below:
- distro packages: use bindep to list the binary dependencies per platform
so they can be controlled centrally and installed appropriately depending
on the platform [0]
- pip packages: use requirements.txt to list and pin requirements
Please note that the dependencies and their versions listed in bindep.txt
and requirements.txt are collected from
- engine/config/engine-vars.sh
- engine/files/engine-lib.sh
- engine/var/versions.yml
- various playbooks and roles
This means that we might be installing some unnecessary dependencies by
collecting everything in one place. (such as some libvirt dependencies
are installed even though the provisioner is heat etc.) However, this is
very small cost comparing to the benefits we get back. If we see the need
to reduce the need of packages we install, we can fine tune what is installed
where by introducing profiles for bindep and additional requirements
files for pip.
[0] https://docs.openstack.org/infra/bindep/readme.html
Change-Id: Id377d36707417b1d3465146340f9a74cdaedf2c6
diff --git a/playbooks/roles/create-libvirt-vms/tasks/main.yml b/playbooks/roles/create-libvirt-vms/tasks/main.yml
index 6205742..53bd9fd 100644
--- a/playbooks/roles/create-libvirt-vms/tasks/main.yml
+++ b/playbooks/roles/create-libvirt-vms/tasks/main.yml
@@ -35,13 +35,6 @@
path: "{{ ansible_env.HOME }}/.vbmc/"
state: absent
-- name: Install virtualbmc
- pip:
- name: virtualbmc
- version: "{{ virtualbmc_version }}"
- virtualenv: "{{ engine_venv }}"
- become: no
-
- name: Create virtualbmc folder
file:
path: "{{ ansible_env.HOME }}/.vbmc/"
diff --git a/playbooks/roles/prepare-libvirt/tasks/main.yml b/playbooks/roles/prepare-libvirt/tasks/main.yml
index 593613b..4978b44 100644
--- a/playbooks/roles/prepare-libvirt/tasks/main.yml
+++ b/playbooks/roles/prepare-libvirt/tasks/main.yml
@@ -19,21 +19,6 @@
- name: "Load distribution defaults"
include_vars: "{{ ansible_os_family | lower }}.yml"
-- name: "Install required packages"
- package:
- name: "{{ required_packages }}"
- update_cache: "{{ (ansible_pkg_mgr in ['apt', 'zypper']) | ternary('yes', omit) }}"
- state: present
-
-- name: "Install libvirt and lxml using pip"
- pip:
- name: "{{ item }}"
- virtualenv: "{{ engine_venv }}"
- become: no
- with_items:
- - libvirt-python
- - lxml
-
- name: "Restart libvirt service"
service:
name: "{{ libvirt_service_name }}"
diff --git a/playbooks/roles/prepare-libvirt/vars/debian.yml b/playbooks/roles/prepare-libvirt/vars/debian.yml
index de358a8..c426687 100644
--- a/playbooks/roles/prepare-libvirt/vars/debian.yml
+++ b/playbooks/roles/prepare-libvirt/vars/debian.yml
@@ -18,13 +18,5 @@
# ============LICENSE_END=========================================================
sgabios_dir: /usr/share/qemu/
libvirt_service_name: libvirt-bin
-required_packages:
- - libvirt-bin
- - qemu-utils
- - qemu-kvm
- - qemu-system-x86
- - sgabios
- - pkg-config
- - libvirt-dev
# vim: set ts=2 sw=2 expandtab: