Add multipathd role
diff --git a/playbooks/openstack.yml b/playbooks/openstack.yml
index 9dfbf5d..97bff43 100644
--- a/playbooks/openstack.yml
+++ b/playbooks/openstack.yml
@@ -119,6 +119,10 @@
tags:
- lpfc
+ - role: multipathd
+ tags:
+ - multipathd
+
- name: Deploy Open vSwitch
hosts: controllers:computes
become: true
diff --git a/roles/multipathd/README.md b/roles/multipathd/README.md
new file mode 100644
index 0000000..c91fba0
--- /dev/null
+++ b/roles/multipathd/README.md
@@ -0,0 +1,3 @@
+# `multipath-tools` for Linux
+
+This role manage `multipath-tools` package and its configuration.
diff --git a/roles/multipathd/defaults/main.yml b/roles/multipathd/defaults/main.yml
new file mode 100644
index 0000000..d41f011
--- /dev/null
+++ b/roles/multipathd/defaults/main.yml
@@ -0,0 +1,22 @@
+# Copyright (c) 2023 VEXXHOST, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+# Allow usage of user friendly names only for "multipathd" CLI
+#
+# NOTE(mnaser): This defaults to "true" in the "multipathd" package however it
+# will break online volume expansion. It is recommended to set
+# this to "false" to avoid issues with volume expansion.
+#
+# See: https://bugs.launchpad.net/kolla-ansible/+bug/1982777
+multipathd_user_friendly_names: false
diff --git a/roles/multipathd/handlers/main.yml b/roles/multipathd/handlers/main.yml
new file mode 100644
index 0000000..818a509
--- /dev/null
+++ b/roles/multipathd/handlers/main.yml
@@ -0,0 +1,18 @@
+# Copyright (c) 2023 VEXXHOST, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+- name: Reload "multipathd"
+ ansible.builtin.service:
+ name: multipathd
+ state: reloaded
diff --git a/roles/multipathd/tasks/main.yml b/roles/multipathd/tasks/main.yml
new file mode 100644
index 0000000..be14d2a
--- /dev/null
+++ b/roles/multipathd/tasks/main.yml
@@ -0,0 +1,23 @@
+# Copyright (c) 2023 VEXXHOST, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+- name: Install the configuration file
+ ansible.builtin.template:
+ src: multipath.conf.j2
+ dest: /etc/multipath.conf
+ owner: root
+ group: root
+ mode: "0644"
+ notify:
+ - Reload "multipathd"
diff --git a/roles/multipathd/templates/multipath.conf.j2 b/roles/multipathd/templates/multipath.conf.j2
new file mode 100644
index 0000000..6eb0c5f
--- /dev/null
+++ b/roles/multipathd/templates/multipath.conf.j2
@@ -0,0 +1,5 @@
+# {{ ansible_managed }}
+
+defaults {
+ user_friendly_names {{ multipathd_user_friendly_names | bool | ternary('yes', 'no') }}
+}