summaryrefslogtreecommitdiffstats
path: root/roles/openshift_persistent_volumes/tasks/pvc.yml
blob: e44f9b18f6dc99e2e0352f1429dbe0c2f116b238 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
---
- name: Deploy PersistentVolumeClaim definitions
  template:
    dest: "{{ mktemp.stdout }}/persistent-volume-claims.yml"
    src: persistent-volume-claim.yml.j2
  when: persistent_volume_claims | length > 0
  changed_when: False

- name: Create PersistentVolumeClaims
  command: >
    {{ openshift.common.client_binary }} create
    -f {{ mktemp.stdout }}/persistent-volume-claims.yml
    --config={{ mktemp.stdout }}/admin.kubeconfig
  register: pvc_create_output
  when: persistent_volume_claims | length > 0
  failed_when: ('already exists' not in pvc_create_output.stderr) and ('created' not in pvc_create_output.stdout)
  changed_when: ('created' in pvc_create_output.stdout)