1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- ---
- - 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)
- - name: create standard pv and pvc lists
- # generate_pv_pvcs_list is a custom action module defined in ../action_plugins
- 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
|