From 3a8f330959119a53305ca678a0e1b49219e94c00 Mon Sep 17 00:00:00 2001 From: "flyingscorpio@clevo" Date: Sat, 5 Mar 2022 19:34:14 +0100 Subject: [PATCH] Make variable for pool name --- roles/libvirt/tasks/main.yml | 4 ++-- roles/libvirt/templates/libvirt-pool.xml.j2 | 2 +- roles/libvirt/vars/main.yml | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 roles/libvirt/vars/main.yml diff --git a/roles/libvirt/tasks/main.yml b/roles/libvirt/tasks/main.yml index acf7cfa..6af15cb 100644 --- a/roles/libvirt/tasks/main.yml +++ b/roles/libvirt/tasks/main.yml @@ -38,7 +38,7 @@ - name: Define session pool virt_pool: command: define - name: libvirt-pool + name: "{{ pool_name }}" uri: "qemu:///session" xml: "{{ lookup('template', 'libvirt-pool.xml.j2') }}" @@ -46,5 +46,5 @@ virt_pool: state: active autostart: true - name: libvirt-pool + name: "{{ pool_name }}" uri: "qemu:///session" diff --git a/roles/libvirt/templates/libvirt-pool.xml.j2 b/roles/libvirt/templates/libvirt-pool.xml.j2 index d102d6c..eee95d2 100644 --- a/roles/libvirt/templates/libvirt-pool.xml.j2 +++ b/roles/libvirt/templates/libvirt-pool.xml.j2 @@ -1,5 +1,5 @@ - libvirt-pool + {{ pool_name }} diff --git a/roles/libvirt/vars/main.yml b/roles/libvirt/vars/main.yml new file mode 100644 index 0000000..7438bb2 --- /dev/null +++ b/roles/libvirt/vars/main.yml @@ -0,0 +1,2 @@ +--- +pool_name: libvirt-pool