Skip to content

Commit 3b6df77

Browse files
author
jovial
authored
Merge pull request #5 from jovial/debian
Add support for Debian GNU/Linux and derivatives
2 parents d29a305 + 4612c5e commit 3b6df77

File tree

4 files changed

+37
-10
lines changed

4 files changed

+37
-10
lines changed

meta/main.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ galaxy_info:
1111
- name: EL
1212
versions:
1313
- 7
14+
- name: Ubuntu
15+
versions:
16+
- all
17+
- name: Debian
18+
versions:
19+
- all
1420
galaxy_tags:
1521
- cloud
1622
- kvm

tasks/install.yml

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,32 @@
11
---
2-
- name: Ensure the libvirt package is installed
3-
yum:
2+
3+
- name: gather os specific variables
4+
include_vars: "{{ item }}"
5+
with_first_found:
6+
- "{{ ansible_distribution }}-{{ ansible_distribution_major_version}}.yml"
7+
- "{{ ansible_distribution }}.yml"
8+
- "{{ ansible_os_family }}.yml"
9+
tags: vars
10+
11+
- name: Ensure libvirt packages are installed
12+
package:
413
name: "{{ item }}"
514
state: installed
6-
with_items:
7-
- libvirt
8-
- libvirt-daemon-kvm
9-
- libvirt-python
10-
- python-lxml
11-
- qemu-kvm
15+
with_items: "{{ libvirt_host_libvirt_packages }}"
1216
become: True
1317

1418
# NOTE: QEMU emulators are available in EPEL.
1519
- name: Ensure the EPEL repository is enabled
1620
yum:
1721
name: epel-release
1822
state: installed
19-
when: libvirt_host_qemu_emulators | length > 0
2023
become: True
24+
when:
25+
- ansible_os_family == "RedHat"
26+
- libvirt_host_qemu_emulators | length > 0
2127

2228
- name: Ensure QEMU emulator packages are installed
23-
yum:
29+
package:
2430
name: "{{ package }}"
2531
state: installed
2632
with_items: "{{ libvirt_host_qemu_emulators }}"

vars/Debian.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
# List of libvirt package dependencies.
3+
libvirt_host_libvirt_packages:
4+
- libvirt-bin
5+
- qemu-kvm
6+
- python-libvirt
7+
- python-lxml

vars/RedHat.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
# List of libvirt package dependencies.
3+
libvirt_host_libvirt_packages:
4+
- libvirt
5+
- libvirt-daemon-kvm
6+
- libvirt-python
7+
- python-lxml
8+
- qemu-kvm

0 commit comments

Comments
 (0)