Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions roles/mtv_management/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,23 @@ mtv_management_storage_map_overrides: [
# include: true
]

mtv_management_multiple_storage_maps_overrides: {}
# map_name1:
# - id: <datastore_id>
# storageClass: <name of the storage class>
# exclude: true
# include: true
# - id: <datastore_id>
# storageClass: <name of the storage class>
# exclude: true
# include: true
# map_name2:
# - id: <datastore_id>
# storageClass: <name of the storage class>
# exclude: true
# include: true


# title: MTV Network Map Overrides
# required: False
# description: Overrides for the network map
Expand Down
15 changes: 14 additions & 1 deletion roles/mtv_management/tasks/mtv_maps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,22 @@
quiet: true
fail_msg: "Destination Provider with name '{{ mtv_management_destination_target }}' not found in namespace '{{ mtv_management_provider_namespace }}'" # noqa: yaml[line-length]

- name: mtv_maps | Configure MTV Storage Maps (Multiple)
ansible.builtin.include_tasks: _mtv_storage_map.yml
loop: "{{ mtv_management_multiple_storage_maps_overrides | dict2items }}"
vars:
defined_storage_map_name: "{{ item.key }}"
mtv_management_storage_map_overrides: "{{ item.value }}"
when:
- mtv_management_map_storage is defined and mtv_management_map_storage | bool
- mtv_management_multiple_storage_maps_overrides is defined
- mtv_management_multiple_storage_maps_overrides | length > 0

- name: mtv_maps | Configure MTV Storage Maps
ansible.builtin.include_tasks: _mtv_storage_map.yml
when: mtv_management_map_storage is defined and mtv_management_map_storage | bool
when:
- mtv_management_map_storage is defined and mtv_management_map_storage | bool
- mtv_management_multiple_storage_maps_overrides is not defined or mtv_management_multiple_storage_maps_overrides | length == 0

- name: mtv_maps | Configure MTV Network Map
ansible.builtin.include_tasks: _mtv_network_map.yml
Expand Down
2 changes: 1 addition & 1 deletion roles/mtv_management/templates/storagemap.yml.j2
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: forklift.konveyor.io/v1beta1
kind: StorageMap
metadata:
name: "{{ (mtv_management_source_target + '-' + mtv_management_destination_target) | infra.openshift_virtualization_migration.rfc1123 }}"
name: "{{ defined_storage_map_name | default(mtv_management_source_target + '-' + mtv_management_destination_target) | infra.openshift_virtualization_migration.rfc1123 }}"
namespace: "{{ mtv_management_migration_namespace }}"
spec:
provider:
Expand Down