Skip to content

Commit 3ff7d65

Browse files
committed
set custom fact with zfs pool to libvirt pool mappings
1 parent 361041a commit 3ff7d65

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

tasks/pools.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,24 @@
4242
uri: "{{ libvirt_host_uri | default(omit, true) }}"
4343
with_items: "{{ libvirt_host_pools }}"
4444
become: True
45+
46+
- name: "Create custom fact directory"
47+
file:
48+
path: "/etc/ansible/facts.d"
49+
state: "directory"
50+
when: item.type == "zfs"
51+
with_items: "{{ libvirt_host_pools }}"
52+
become: True
53+
54+
- name: Create Ansible fact for zfs pool to path mapping
55+
ini_file:
56+
path: /etc/ansible/facts.d/zfs-pool.fact
57+
section: null
58+
option: "{{ item.name }}"
59+
value: "{{ item.source }}"
60+
when: item.type == "zfs"
61+
with_items: "{{ libvirt_host_pools }}"
62+
become: True
63+
64+
- name: reload facts
65+
setup: ~

0 commit comments

Comments
 (0)