blob: 1c32a674367972fe86fae086694ec0987575d43d (
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
---
- name: Create temp directory for volume definitions
command: mktemp -d /tmp/openshift-ansible-XXXXXXX
register: mktemp
changed_when: False
- name: Copy the admin client config(s)
command: >
cp {{ openshift_master_config_dir }}/admin.kubeconfig {{ mktemp.stdout }}/admin.kubeconfig
changed_when: False
- set_fact:
glusterfs_pv:
- name: "{{ openshift_hosted_registry_storage_volume_name }}-glusterfs-volume"
capacity: "{{ openshift_hosted_registry_storage_volume_size }}"
access_modes: "{{ openshift_hosted_registry_storage_access_modes }}"
storage:
glusterfs:
endpoints: "{{ openshift_hosted_registry_storage_glusterfs_endpoints }}"
path: "{{ openshift_hosted_registry_storage_glusterfs_path }}"
readOnly: "{{ openshift_hosted_registry_storage_glusterfs_readOnly }}"
glusterfs_pvc:
- name: "{{ openshift_hosted_registry_storage_volume_name }}-glusterfs-claim"
capacity: "{{ openshift_hosted_registry_storage_volume_size }}"
access_modes: "{{ openshift_hosted_registry_storage_access_modes }}"
when:
- openshift_hosted_registry_storage_glusterfs_swap | default(False)
- openshift_hosted_registry_storage_class is not defined
- set_fact:
glusterfs_pv: []
glusterfs_pvc:
- name: "{{ openshift_hosted_registry_storage_volume_name }}-claim"
storageclass: "{{ openshift_hosted_registry_storage_class }}"
capacity: "{{ openshift_hosted_registry_storage_volume_size }}"
access_modes: "{{ openshift_hosted_registry_storage_access_modes }}"
when:
- openshift_hosted_registry_storage_class is defined
- name: create standard pv and pvc lists
# generate_pv_pvcs_list is a custom action module defined in
# roles/lib_utils/action_plugins/generate_pv_pvcs_list.py
generate_pv_pvcs_list: {}
register: l_pv_pvcs_list
- include_tasks: pv.yml
vars:
l_extra_persistent_volumes: "{{ openshift_persistent_volume_extras | union(glusterfs_pv) }}"
persistent_volumes: "{{ l_pv_pvcs_list.persistent_volumes | union(l_extra_persistent_volumes) }}"
- include_tasks: pvc.yml
vars:
l_extra_persistent_volume_claims: "{{ openshift_persistent_volume_claims_extras | union(glusterfs_pvc) }}"
persistent_volume_claims: "{{ l_pv_pvcs_list.persistent_volume_claims | union(l_extra_persistent_volume_claims) }}"
- name: Delete temp directory
file:
name: "{{ mktemp.stdout }}"
state: absent
changed_when: False
|