summaryrefslogtreecommitdiffstats
path: root/playbooks/libvirt/openshift-cluster/tasks/configure_libvirt_storage_pool.yml
blob: 8685624ececfa1263a23f786ac4ec1385036163c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
---
- name: Create libvirt storage directory for openshift
  file:
    dest: "{{ libvirt_storage_pool_path }}"
    state: directory

# 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 }}'
    entity: kvm
    etype: group
    name: "{{ libvirt_storage_pool_path }}"
    permissions: '{{ item.permissions }}'
    state: present
  with_items:
    - default: no
      permissions: x
    - default: yes
      permissions: rwx

- 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