Skip to content

Commit 4641d1f

Browse files
committed
cinder adoption, netapp: use the source configuration group name
Make sure to use the configuration group name of the source cluster for the netapp/NFS backend. This means generalizing a bit one of the templates, and converting a static configuration file to a template.
1 parent 17407b0 commit 4641d1f

3 files changed

Lines changed: 9 additions & 3 deletions

File tree

tests/roles/cinder_adoption/tasks/cinder_volume_netapp_nfs.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@
3232
- 'Missing required Netapp input'
3333

3434
- name: Render Netapp OpenShift Secret template
35+
ansible.builtin.template:
36+
src: "{{ role_path }}/templates/cinder_volume_netapp_nfs.yaml.j2"
37+
dest: /tmp/cinder_volume_netapp_nfs.yaml
38+
mode: "0600"
39+
40+
- name: Render cinder netapp NFS OpenShift patch file template
3541
ansible.builtin.template:
3642
src: "{{ role_path }}/templates/cinder-volume-ontap-secrets.yaml.j2"
3743
dest: /tmp/cinder-volume-ontap-secrets.yaml
@@ -47,4 +53,4 @@
4753
ansible.builtin.shell: |
4854
{{ shell_header }}
4955
{{ oc_header }}
50-
oc patch openstackcontrolplane openstack --type=merge --patch-file={{ role_path }}/files/cinder_volume_netapp_nfs.yaml
56+
oc patch openstackcontrolplane openstack --type=merge --patch-file=/tmp/cinder_volume_netapp_nfs.yaml

tests/roles/cinder_adoption/templates/cinder-volume-ontap-secrets.yaml.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ metadata:
1010
type: Opaque
1111
stringData:
1212
ontap-cinder-secrets: |
13-
[ontap-nfs]
13+
[{{ cinder_netapp_backend }}]
1414
netapp_server_hostname = {{ cinder_volume_netapp_config.netapp_server_hostname }}
1515
netapp_login = {{ cinder_volume_netapp_config.netapp_login }}
1616
netapp_password = {{ cinder_volume_netapp_config.netapp_password }}

tests/roles/cinder_adoption/files/cinder_volume_netapp_nfs.yaml renamed to tests/roles/cinder_adoption/templates/cinder_volume_netapp_nfs.yaml.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ spec:
66
networkAttachments:
77
- storage
88
customServiceConfig: |
9-
[ontap-nfs]
9+
[{{ cinder_netapp_backend }}]
1010
volume_backend_name=ontap-nfs
1111
volume_driver=cinder.volume.drivers.netapp.common.NetAppDriver
1212
netapp_storage_protocol=nfs

0 commit comments

Comments
 (0)