summaryrefslogtreecommitdiffstats
path: root/playbooks/libvirt/openshift-cluster/tasks/configure_libvirt_storage_pool.yml
diff options
context:
space:
mode:
authorJason DeTiberus <detiber@gmail.com>2016-08-22 16:42:10 -0400
committerGitHub <noreply@github.com>2016-08-22 16:42:10 -0400
commit39d87c8ff79caddd9ff56d19846a9d8ecf5164e0 (patch)
tree5a615d9ea66d7432ede4f87b97d0e912e86ba275 /playbooks/libvirt/openshift-cluster/tasks/configure_libvirt_storage_pool.yml
parenteb3df4cc0431a3f65f47a2ed0fd9427a6126907b (diff)
parentd3faaccc614c694b539e6fb8c02327da4f9b296b (diff)
downloadopenshift-39d87c8ff79caddd9ff56d19846a9d8ecf5164e0.tar.gz
openshift-39d87c8ff79caddd9ff56d19846a9d8ecf5164e0.tar.bz2
openshift-39d87c8ff79caddd9ff56d19846a9d8ecf5164e0.tar.xz
openshift-39d87c8ff79caddd9ff56d19846a9d8ecf5164e0.zip
Merge pull request #2340 from lhuard1A/ansible_virt_module
Replace some virsh commands by native virt_XXX ansible module
Diffstat (limited to 'playbooks/libvirt/openshift-cluster/tasks/configure_libvirt_storage_pool.yml')
-rw-r--r--playbooks/libvirt/openshift-cluster/tasks/configure_libvirt_storage_pool.yml29
1 files changed, 16 insertions, 13 deletions
diff --git a/playbooks/libvirt/openshift-cluster/tasks/configure_libvirt_storage_pool.yml b/playbooks/libvirt/openshift-cluster/tasks/configure_libvirt_storage_pool.yml
index 397158b9e..8685624ec 100644
--- a/playbooks/libvirt/openshift-cluster/tasks/configure_libvirt_storage_pool.yml
+++ b/playbooks/libvirt/openshift-cluster/tasks/configure_libvirt_storage_pool.yml
@@ -6,22 +6,25 @@
# We need to set permissions on the directory and any items created under the directory, so we need to call the acl module with and without default set.
- acl:
- default: "{{ item }}"
+ default: '{{ item.default }}'
entity: kvm
etype: group
name: "{{ libvirt_storage_pool_path }}"
- permissions: rwx
+ permissions: '{{ item.permissions }}'
state: present
with_items:
- - no
- - yes
+ - default: no
+ permissions: x
+ - default: yes
+ permissions: rwx
-- name: Test if libvirt storage pool for openshift already exists
- command: "virsh -c {{ libvirt_uri }} pool-info {{ libvirt_storage_pool }}"
- register: pool_info_result
- changed_when: False
- failed_when: "pool_info_result.rc != 0 and 'no storage pool with matching name' not in pool_info_result.stderr"
-
-- name: Create the libvirt storage pool for openshift
- command: 'virsh -c {{ libvirt_uri }} pool-create-as {{ libvirt_storage_pool }} dir --target {{ libvirt_storage_pool_path }}'
- when: pool_info_result.rc == 1
+- name: Create the libvirt storage pool for OpenShift
+ virt_pool:
+ name: '{{ libvirt_storage_pool }}'
+ state: '{{ item }}'
+ autostart: 'yes'
+ xml: "{{ lookup('template', 'storage-pool.xml') }}"
+ uri: '{{ libvirt_uri }}'
+ with_items:
+ - present
+ - active