Gorka Eguileor | 87d4802 | 2023-01-18 10:23:34 +0100 | [diff] [blame] | 1 | - hosts: tempest |
| 2 | vars: |
| 3 | mpath_package: "{{ 'device-mapper-multipath' if ansible_os_family == 'RedHat' else 'multipath-tools' }}" |
| 4 | tasks: |
| 5 | - name: Install multipath package on RedHat systems |
| 6 | package: |
| 7 | name: "{{ mpath_package }}" |
| 8 | state: present |
| 9 | become: yes |
| 10 | |
| 11 | - name: Create configuration |
| 12 | command: mpathconf --enable --with_multipathd y --user_friendly_names n --find_multipaths y |
| 13 | args: |
| 14 | creates: /etc/multipath.conf |
| 15 | become: yes |
| 16 | |
| 17 | - name: Start and enable on boot the multipath daemon |
| 18 | service: |
| 19 | name: multipathd |
| 20 | state: started |
| 21 | enabled: yes |
| 22 | become: yes |