Skip to content

Instantly share code, notes, and snippets.

@github-somerandomguy-xyz
Created April 11, 2020 07:30
Show Gist options
  • Save github-somerandomguy-xyz/fc4c7e011c8121cf96fdfad86ca3e059 to your computer and use it in GitHub Desktop.
Save github-somerandomguy-xyz/fc4c7e011c8121cf96fdfad86ca3e059 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