pvc.yml 686 B

1234567891011121314151617
  1. ---
  2. - name: Deploy PersistentVolumeClaim definitions
  3. template:
  4. dest: "{{ mktemp.stdout }}/persistent-volume-claims.yml"
  5. src: persistent-volume-claim.yml.j2
  6. when: persistent_volume_claims | length > 0
  7. changed_when: False
  8. - name: Create PersistentVolumeClaims
  9. command: >
  10. {{ openshift.common.client_binary }} create
  11. -f {{ mktemp.stdout }}/persistent-volume-claims.yml
  12. --config={{ mktemp.stdout }}/admin.kubeconfig
  13. register: pvc_create_output
  14. when: persistent_volume_claims | length > 0
  15. failed_when: ('already exists' not in pvc_create_output.stderr) and ('created' not in pvc_create_output.stdout)
  16. changed_when: ('created' in pvc_create_output.stdout)