|
3 | 3 | # Striped volume |
4 | 4 | - name: SAP Storage Preparation - {{ sap_storage_cloud_type | upper }} - {{ sap_storage_az_vmsize }} - {{ item.value.name }} - Striped |
5 | 5 | block: |
6 | | - |
| 6 | + |
7 | 7 | # Get LUNs from metadata |
8 | 8 | - name: SAP Storage Preparation - {{ sap_storage_cloud_type | upper }} - {{ sap_storage_az_vmsize }} - {{ item.value.name }} Get LUNs from metadata |
9 | | - shell: | |
| 9 | + ansible.builtin.shell: | |
10 | 10 | for i in {1..{{ item.value.numluns }}} |
11 | 11 | do |
12 | 12 | {{ item.value.vg }}${i}lun="{{ sap_storage_az_lun }} \ |
|
20 | 20 | args: |
21 | 21 | executable: /bin/bash |
22 | 22 | register: pvs_reg |
23 | | - |
24 | | - - set_fact: |
| 23 | + |
| 24 | + - ansible.builtin.set_fact: |
25 | 25 | pvs_list: "{{ pvs_reg.stdout.split() }}" |
26 | 26 |
|
27 | 27 | # Create Volume Group |
28 | 28 | - name: SAP Storage Preparation - {{ sap_storage_cloud_type | upper }} - {{ sap_storage_az_vmsize }} - {{ item.value.name }} Volume Group Striped |
29 | | - lvg: |
| 29 | + community.general.lvg: |
30 | 30 | vg: "{{ item.value.vg }}" |
31 | 31 | pvs: "{{ pvs_list | join(',') }}" |
32 | | - force: yes |
| 32 | + force: true |
33 | 33 |
|
34 | 34 | # Create Logical Group |
35 | 35 | - name: SAP Storage Preparation - {{ sap_storage_cloud_type | upper }} - {{ sap_storage_az_vmsize }} - {{ item.value.name }} Logical Volume - Striped |
36 | | - lvol: |
| 36 | + community.general.lvol: |
37 | 37 | vg: "{{ item.value.vg }}" |
38 | 38 | lv: "{{ item.value.lv }}" |
39 | 39 | size: 100%VG |
40 | 40 | opts: "-i{{ item.value.numluns }} -I{{ item.value.stripesize }}" |
41 | 41 |
|
42 | | - when: |
| 42 | + when: |
43 | 43 | - "item.value.numluns != '1'" |
44 | 44 |
|
45 | 45 | # Single volume |
|
48 | 48 |
|
49 | 49 | # Get LUNs from metadata |
50 | 50 | - name: SAP Storage Preparation - {{ sap_storage_cloud_type | upper }} - {{ sap_storage_az_vmsize }} - {{ item.value.name }} Get LUNs from metadata |
51 | | - shell: | |
| 51 | + ansible.builtin.shell: | |
52 | 52 | {{ item.value.vg }}lun="{{ sap_storage_az_lun }} \ |
53 | 53 | `awk '/caching/ { r=""; f=1 } f { r = (r ? r ORS : "") $0 } \ |
54 | 54 | /writeAcceleratorEnabled/ \ |
|
60 | 60 | executable: /bin/bash |
61 | 61 | register: pvs_reg |
62 | 62 |
|
63 | | - - set_fact: |
| 63 | + - ansible.builtin.set_fact: |
64 | 64 | pvs_one: "{{ pvs_reg.stdout }}" |
65 | 65 |
|
66 | 66 | # Create Volume Group |
67 | 67 | - name: SAP Storage Preparation - {{ sap_storage_cloud_type | upper }} - {{ sap_storage_az_vmsize }} - {{ item.value.name }} Volume Group One |
68 | | - lvg: |
| 68 | + community.general.lvg: |
69 | 69 | vg: "{{ item.value.vg }}" |
70 | 70 | pvs: "{{ pvs_one }}" |
71 | | - force: yes |
| 71 | + force: true |
72 | 72 |
|
73 | 73 | # Create Logical Group |
74 | 74 | - name: SAP Storage Preparation - {{ sap_storage_cloud_type | upper }} - {{ sap_storage_az_vmsize }} - {{ item.value.name }} Logical Volume - One |
75 | | - lvol: |
| 75 | + community.general.lvol: |
76 | 76 | vg: "{{ item.value.vg }}" |
77 | 77 | lv: "{{ item.value.lv }}" |
78 | 78 | size: 100%VG |
79 | 79 |
|
80 | | - when: |
| 80 | + when: |
81 | 81 | - "item.value.numluns == '1'" |
82 | 82 |
|
83 | 83 | # Create Filesystem |
84 | 84 | - name: SAP Storage Preparation - {{ sap_storage_cloud_type | upper }} - {{ sap_storage_az_vmsize }} - {{ item.value.name }} Filesystem |
85 | | - filesystem: |
| 85 | + community.general.filesystem: |
86 | 86 | fstype: xfs |
87 | 87 | dev: "/dev/{{ item.value.vg }}/{{ item.value.lv }}" |
88 | 88 |
|
89 | 89 | # Mount Filesystem |
90 | 90 | - name: SAP Storage Preparation - {{ sap_storage_cloud_type | upper }} - {{ sap_storage_az_vmsize }} - {{ item.value.name }} Mount |
91 | | - mount: |
| 91 | + ansible.posix.mount: |
92 | 92 | path: "{{ item.value.directory }}" |
93 | 93 | fstype: xfs |
94 | 94 | src: "/dev/mapper/{{ item.value.vg }}-{{ item.value.lv }}" |
|
0 commit comments