summaryrefslogtreecommitdiffstats
path: root/roles/openshift_persistent_volumes/templates/persistent-volume.yml.j2
blob: 9c510359744509d5949bb80c7c28e06d1280b724 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
---
apiVersion: v1
kind: List
items:
{% for volume in persistent_volumes %}
- apiVersion: v1
  kind: PersistentVolume
  metadata:
    name: "{{ volume.name }}"
{% if volume.labels is defined and volume.labels is mapping %}
    labels:
{% for key,value in volume.labels.iteritems() %}
      {{ key }}: {{ value }}
{% endfor %}
{% endif %}
  spec:
    capacity:
      storage: "{{ volume.capacity }}"
    accessModes: {{ volume.access_modes | to_padded_yaml(2, 2) }}
    {{ volume.storage.keys()[0] }}: {{ volume.storage[volume.storage.keys()[0]] | to_padded_yaml(3, 2) }}
{% endfor %}