Skip to content

Instantly share code, notes, and snippets.

@github-somerandomguy-xyz
Created April 9, 2020 20:11
Show Gist options
  • Save github-somerandomguy-xyz/ff57606ba92e05d333661625346904fe to your computer and use it in GitHub Desktop.
Save github-somerandomguy-xyz/ff57606ba92e05d333661625346904fe to your computer and use it in GitHub Desktop.
add a storage pool for storing libvirt images if Pool doesn't already exists
- name: add a storage pool for storing libvirt images if Pool doesn't already exists
virt_pool:
command: define
# looks like setting name here is a redundant, the name is anyways taken from the template xml file, but should set it to make virt_pool module happy.
name: "{{ image_pool_name }}"
xml: '{{ lookup("template", "pool/dir.xml.j2") }}'
uri: "{{ libvirt_uri }}"
when: image_pool_name not in ansible_libvirt_pools
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment