Merge "Configure dracut multipath module for diskless nodes"

This commit is contained in:
Zuul 2022-05-26 01:12:57 +00:00 committed by Gerrit Code Review
commit 3f023bf4a3
2 changed files with 24 additions and 0 deletions

View File

@ -24,3 +24,4 @@ tripleo_multipathd_enable: true
tripleo_multipathd_find_multipaths: true
tripleo_multipathd_skip_kpartx: true
tripleo_multipathd_user_friendly_names: false
tripleo_boot_from_multipath_device: false

View File

@ -67,3 +67,26 @@
path: /etc/multipath
state: directory
setype: container_file_t
- name: Configure multipath dracut module
when:
- tripleo_boot_from_multipath_device | bool
block:
- name: Check if multipath module is already configured in dracut
lineinfile:
state: absent
path: "/etc/dracut.conf"
regexp: "add_dracutmodules.*multipath.*"
check_mode: true
changed_when: false
register: check
- name: Add multipath dracut module if it's missing and refresh dracut
when: check.found == 0
block:
- name: Add multipath dracut module if it's missing
lineinfile:
state: present
path: "/etc/dracut.conf"
line: 'add_dracutmodules+="multipath"'
- name: Refresh dracut
shell: dracut -f