Skip to content

Add support for Debian GNU/Linux and derivatives #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ galaxy_info:
- name: EL
versions:
- 7
- name: Ubuntu
versions:
- all
- name: Debian
versions:
- all
galaxy_tags:
- cloud
- kvm
Expand Down
26 changes: 16 additions & 10 deletions tasks/install.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,32 @@
---
- name: Ensure the libvirt package is installed
yum:

- name: gather os specific variables
include_vars: "{{ item }}"
with_first_found:
- "{{ ansible_distribution }}-{{ ansible_distribution_major_version}}.yml"
- "{{ ansible_distribution }}.yml"
- "{{ ansible_os_family }}.yml"
tags: vars

- name: Ensure libvirt packages are installed
package:
name: "{{ item }}"
state: installed
with_items:
- libvirt
- libvirt-daemon-kvm
- libvirt-python
- python-lxml
- qemu-kvm
with_items: "{{ libvirt_host_libvirt_packages }}"
become: True

# NOTE: QEMU emulators are available in EPEL.
- name: Ensure the EPEL repository is enabled
yum:
name: epel-release
state: installed
when: libvirt_host_qemu_emulators | length > 0
become: True
when:
- ansible_os_family == "RedHat"
- libvirt_host_qemu_emulators | length > 0

- name: Ensure QEMU emulator packages are installed
yum:
package:
name: "{{ package }}"
state: installed
with_items: "{{ libvirt_host_qemu_emulators }}"
Expand Down
7 changes: 7 additions & 0 deletions vars/Debian.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
# List of libvirt package dependencies.
libvirt_host_libvirt_packages:
- libvirt-bin

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

python-lxml and libvirt python required too?

- qemu-kvm
- python-libvirt
- python-lxml
8 changes: 8 additions & 0 deletions vars/RedHat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
# List of libvirt package dependencies.
libvirt_host_libvirt_packages:
- libvirt
- libvirt-daemon-kvm
- libvirt-python
- python-lxml
- qemu-kvm