Skip to content

Commit bd200cb

Browse files
authored
Merge pull request #23 from mtb-xt/archlinuxify
Add Archlinux variables, add ZFS pool support.
2 parents 4ab78ef + d3a540d commit bd200cb

File tree

5 files changed

+32
-3
lines changed

5 files changed

+32
-3
lines changed

defaults/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# List of pools to define and start.
33
# Each item should be a dict containing the following items:
44
# name: The name of the pool.
5-
# type: The type of the pool, currently only 'dir' is supported.
5+
# type: The type of the pool, currently only 'dir', 'lvm2' or 'zfs' are supported.
66
# capacity: The capacity, in bytes, of the pool.
77
# path: The absolute path to the pool's backing directory.
88
# mode: The access mode of the pool.

meta/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ galaxy_info:
1717
- name: Debian
1818
versions:
1919
- all
20+
- name: ArchLinux
21+
versions:
22+
- all
2023
galaxy_tags:
2124
- cloud
2225
- kvm

tasks/pools.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@
4141
autostart: yes
4242
uri: "{{ libvirt_host_uri | default(omit, true) }}"
4343
with_items: "{{ libvirt_host_pools }}"
44-
become: True
44+
become: True

templates/pool.xml.j2

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,17 @@
33
{% if 'capacity' in item %}
44
<capacity>{{ item.capacity }}</capacity>
55
{% endif %}
6-
{% if item.type == 'lvm2' %}
6+
{% if item.type == 'lvm2' or item.type == 'zfs' %}
77
<source>
88
<name>{{ item.source }}</name>
9+
{% if item.type == 'lvm2' %}
910
<format type='lvm2'/>
11+
{% endif %}
1012
</source>
1113
{% endif %}
14+
{% if item.type != 'zfs' %}
1215
<target>
1316
<path>{{ item.path | default('placeholder_value') }}</path>
1417
</target>
18+
{% endif %}
1519
</pool>

vars/Archlinux.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
# List of package dependencies common to all Debian distributions
3+
libvirt_host_libvirt_packages_default:
4+
- libvirt
5+
- qemu-headless
6+
- libvirt-python
7+
- python-lxml
8+
- ebtables
9+
- dnsmasq
10+
11+
# Packages that are only necessary if you require EFI support
12+
libvirt_host_packages_efi:
13+
- ovmf
14+
15+
# List of all packages to install
16+
libvirt_host_libvirt_packages: >
17+
{{ libvirt_host_libvirt_packages_default +
18+
(libvirt_host_packages_efi if libvirt_host_enable_efi_support else []) | unique
19+
}}
20+
21+
# These are passed to the lineinfile module to customize configuration files
22+
libvirt_host_lineinfile_extra_rules: []

0 commit comments

Comments
 (0)