# We currently only support external netapp
- block:
      - name: Copy storage configuration file to the remote
        copy:
            src: "{{ hostvars['localhost']['install_storage_config_file'] }}"
            dest: "{{ template_base }}/storage-config.yaml"

      - name: Append the storage configuration line to the base overcloud deploy script
        lineinfile:
            dest: "~/overcloud_deploy.sh"
            line: '-e {{ template_base }}/storage-config.yaml \'

  when: install.storage.external

# We currently only support external netapp
- block:
      - name: Copy storage configuration file to the remote
        copy:
            src: "{{ hostvars['localhost']['install_storage_config_file'] }}"
            dest: "{{ template_base }}/storage-config.yaml"

      - name: Append the storage configuration line to the base overcloud deploy script
        lineinfile:
            dest: "~/overcloud_deploy.sh"
            line: '-e {{ template_base }}/storage-config.yaml \'
        when: install.storage.backend != 'netapp-nfs'

      # storage-config.yaml is an env file for external storage backend and is shell be placed
      # after the default env files specified by deploy-script to override default values
      - name: Append storage configuration to deploy script
        lineinfile:
            dest: "~/overcloud_deploy.sh"
            line: "-e {{ template_base }}/storage-config.yaml \\"
            insertbefore: "^--log-file.*"
            state: "{{ item }}"
        loop:
            - absent
            - present
        when:
            - storage_backend == 'netapp-nfs'

  when: install.storage.external

Call storage-config yaml file after the template
Call storage-config yaml file after the template

Change-Id: I6864ee315962e504fd623874efde0089e63e34d2
