|
18 | 18 | state: present |
19 | 19 | label: gpt |
20 | 20 | with_items: |
21 | | - - "{{ hostvars[inventory_hostname]['ansible_devices'] | select('match','nvme[0-9]|[1-9][0-9]n1') | list }}" |
| 21 | + - "{{ (hostvars[inventory_hostname]['ansible_devices'] | select('match','nvme[1-9][0-9]n1') | list ) + (hostvars[inventory_hostname]['ansible_devices'] | select('match','nvme[0-9]n1') | list) }}" |
22 | 22 |
|
23 | 23 | - name: create a filesystem |
24 | 24 | filesystem: |
25 | 25 | dev: "/dev/{{item}}p1" |
26 | 26 | fstype: xfs |
27 | 27 | opts: "-L locscratch{{item | replace('nvme','') | replace('n1','')}}" |
28 | 28 | with_items: |
29 | | - - "{{ hostvars[inventory_hostname]['ansible_devices'] | select('match','nvme[0-9]|[1-9][0-9]n1') | list }}" |
| 29 | + - "{{ (hostvars[inventory_hostname]['ansible_devices'] | select('match','nvme[1-9][0-9]n1') | list ) + (hostvars[inventory_hostname]['ansible_devices'] | select('match','nvme[0-9]n1') | list) }}" |
30 | 30 | when: not ( one_lv | bool ) |
31 | 31 |
|
32 | 32 | - name: Mount local volume |
|
37 | 37 | opts: defaults,noatime |
38 | 38 | state: mounted |
39 | 39 | with_items: |
40 | | - - "{{ hostvars[inventory_hostname]['ansible_devices'] | select('match','nvme[0-9]|[1-9][0-9]n1') | list }}" |
| 40 | + - "{{ (hostvars[inventory_hostname]['ansible_devices'] | select('match','nvme[1-9][0-9]n1') | list ) + (hostvars[inventory_hostname]['ansible_devices'] | select('match','nvme[0-9]n1') | list) }}" |
41 | 41 | when: not ( one_lv | bool ) |
42 | 42 |
|
43 | 43 | - name: "set permissions on {{ nvme_path_edited }}" |
|
50 | 50 | group: "{{privilege_group_name}}" |
51 | 51 | recurse: no |
52 | 52 | with_items: |
53 | | - - "{{ hostvars[inventory_hostname]['ansible_devices'] | select('match','nvme[0-9]|[1-9][0-9]n1') | list }}" |
| 53 | + - "{{ (hostvars[inventory_hostname]['ansible_devices'] | select('match','nvme[1-9][0-9]n1') | list ) + (hostvars[inventory_hostname]['ansible_devices'] | select('match','nvme[0-9]n1') | list) }}" |
54 | 54 | when: not ( one_lv | bool ) |
55 | 55 |
|
56 | 56 | - name: Check for lvm devices |
|
61 | 61 | - name: Create volume group |
62 | 62 | lvg: |
63 | 63 | vg: "vg_nvmes" |
64 | | - pvs: "{{['/dev/']|product(hostvars[inventory_hostname]['ansible_devices'] | select('match','nvme[0-9]|[1-9][0-9]n1') | list)|map('join', '') | join(',')}}" |
| 64 | + pvs: "{{['/dev/']|product((hostvars[inventory_hostname]['ansible_devices'] | select('match','nvme[1-9][0-9]n1') | list ) + (hostvars[inventory_hostname]['ansible_devices'] | select('match','nvme[0-9]n1') | list) )|map('join', '') | join(',')}}" |
65 | 65 |
|
66 | 66 | - name: Create Logical volume |
67 | 67 | lvol: |
|
0 commit comments