---
# Tasks to statically provision NFS volumes
# Include if not using dynamic volume provisioning

- name: Setting up NFS storage
  block:
    - name: Include the NFS Setup role tasks
      import_role:
        role: openshift_nfs
        tasks_from: setup.yml
      vars:
        l_nfs_base_dir: "{{ openshift_management_storage_nfs_base_dir }}"

    - name: Create the App export
      import_role:
        role: openshift_nfs
        tasks_from: create_export.yml
      vars:
        l_nfs_base_dir: "{{ openshift_management_storage_nfs_base_dir }}"
        l_nfs_export_config: "{{ __openshift_management_flavor_short }}"
        l_nfs_export_name: "{{ __openshift_management_flavor_short }}-app"
        l_nfs_options: "*(rw,no_root_squash,no_wdelay)"

    - name: Create the DB export
      import_role:
        role: openshift_nfs
        tasks_from: create_export.yml
      vars:
        l_nfs_base_dir: "{{ openshift_management_storage_nfs_base_dir }}"
        l_nfs_export_config: "{{ __openshift_management_flavor_short }}"
        l_nfs_export_name: "{{ __openshift_management_flavor_short }}-db"
        l_nfs_options: "*(rw,no_root_squash,no_wdelay)"
      when:
        - not __openshift_management_use_ext_db

  delegate_to: "{{ openshift_management_nfs_server }}"
