Skip to content

Commit

Permalink
Merge pull request #340 from ASBishop/edpm_multipathd-role
Browse files Browse the repository at this point in the history
Add edpm_multipathd role
  • Loading branch information
openshift-merge-robot authored Sep 24, 2023
2 parents 0a8fd83 + 3d6c653 commit c0ff3ba
Show file tree
Hide file tree
Showing 29 changed files with 912 additions and 1 deletion.
6 changes: 6 additions & 0 deletions playbooks/configure_os.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@
tasks_from: configure.yml
tags:
- edpm_iscsid
- name: Configure edpm_multipathd
import_role:
name: osp.edpm.edpm_multipathd
tasks_from: configure.yml
tags:
- edpm_multipathd
- name: Configure nftables
import_role:
name: osp.edpm.edpm_nftables
Expand Down
6 changes: 6 additions & 0 deletions playbooks/install_os.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,9 @@
tasks_from: install.yml
tags:
- edpm_iscsid
- name: Install edpm_multipathd
import_role:
name: osp.edpm.edpm_multipathd
tasks_from: install.yml
tags:
- edpm_multipathd
6 changes: 6 additions & 0 deletions playbooks/run_os.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,9 @@
tasks_from: run.yml
tags:
- edpm_iscsid
- name: Run edpm_multipathd
import_role:
name: osp.edpm.edpm_multipathd
tasks_from: run.yml
tags:
- edpm_multipathd
46 changes: 46 additions & 0 deletions roles/edpm_multipathd/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
# Copyright 2023 Red Hat, Inc.
# All Rights Reserved.
#
# 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.

edpm_container_cli: "{{ container_cli | default('podman') }}"

# All variables intended for modification should be placed in this file.

edpm_multipathd_image: "quay.io/podified-antelope-centos9/openstack-multipathd:current-podified"
edpm_multipathd_command: "/usr/sbin/multipathd -d"
edpm_multipathd_volumes:
- /var/lib/kolla/config_files/multipathd.json:/var/lib/kolla/config_files/config.json:ro
- /dev:/dev
- /run/udev:/run/udev
- /sys:/sys
- /lib/modules:/lib/modules:ro
- /etc/iscsi:/etc/iscsi:ro
- /var/lib/iscsi:/var/lib/iscsi:z
- /etc/multipath:/etc/multipath:z
- /etc/multipath.conf:/etc/multipath.conf:ro

# These should not need to be overridden except in unique situations.
edpm_multipathd_restart_sentinel: /etc/multipath/.multipath_restart_required
edpm_multipathd_custom_config_dir: /runner/multipath
edpm_multipathd_enable: true

# These should not need to be overridden as they are the recommended values.
edpm_multipathd_find_multipaths: true
edpm_multipathd_recheck_wwid: true
edpm_multipathd_skip_kpartx: true
edpm_multipathd_user_friendly_names: false

# This may be overridden to deploy a custom multipath.conf file.
edpm_multipathd_custom_config_file: ''
9 changes: 9 additions & 0 deletions roles/edpm_multipathd/files/custom_multipath.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# This represents a custom configuration file the user wishes to deploy.

defaults {
user_friendly_names yes
find_multipaths yes
# Use custom_variable as a marker to ensure this custom config file
# gets deployed.
custom_variable custom_value
}
93 changes: 93 additions & 0 deletions roles/edpm_multipathd/files/multipath.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# This is a basic configuration file with some examples, for device mapper
# multipath.
#
# For a complete list of the default configuration values, run either
# multipath -t
# or
# multipathd show config
#
# For a list of configuration options with descriptions, see the multipath.conf
# man page

## By default, devices with vendor = "IBM" and product = "S/390.*" are
## blacklisted. To enable mulitpathing on these devies, uncomment the
## following lines.
#blacklist_exceptions {
# device {
# vendor "IBM"
# product "S/390.*"
# }
#}

## Use user friendly names, instead of using WWIDs as names.
defaults {
user_friendly_names yes
find_multipaths yes
}
##
## Here is an example of how to configure some standard options.
##
#
#defaults {
# udev_dir /dev
# polling_interval 10
# selector "round-robin 0"
# path_grouping_policy multibus
# prio alua
# path_checker readsector0
# rr_min_io 100
# max_fds 8192
# rr_weight priorities
# failback immediate
# no_path_retry fail
# user_friendly_names yes
#}
##
## The wwid line in the following blacklist section is shown as an example
## of how to blacklist devices by wwid. The 2 devnode lines are the
## compiled in default blacklist. If you want to blacklist entire types
## of devices, such as all scsi devices, you should use a devnode line.
## However, if you want to blacklist specific devices, you should use
## a wwid line. Since there is no guarantee that a specific device will
## not change names on reboot (from /dev/sda to /dev/sdb for example)
## devnode lines are not recommended for blacklisting specific devices.
##
#blacklist {
# wwid 26353900f02796769
# devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"
# devnode "^hd[a-z]"
#}
#multipaths {
# multipath {
# wwid 3600508b4000156d700012000000b0000
# alias yellow
# path_grouping_policy multibus
# path_checker readsector0
# path_selector "round-robin 0"
# failback manual
# rr_weight priorities
# no_path_retry 5
# }
# multipath {
# wwid 1DEC_____321816758474
# alias red
# }
#}
#devices {
# device {
# vendor "COMPAQ "
# product "HSV110 (C)COMPAQ"
# path_grouping_policy multibus
# path_checker readsector0
# path_selector "round-robin 0"
# hardware_handler "0"
# failback 15
# rr_weight priorities
# no_path_retry queue
# }
# device {
# vendor "COMPAQ "
# product "MSA1000 "
# path_grouping_policy multibus
# }
#}
75 changes: 75 additions & 0 deletions roles/edpm_multipathd/meta/argument_specs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
---
argument_specs:
# ./roles/edpm_multipathd/tasks/main.yml entry point
main:
short_description: The main entry point for the edpm_multipathd role.
options:
edpm_multipathd_image:
default: 'quay.io/podified-antelope-centos9/openstack-multipathd:current-podified'
description: 'URL of the multipathd image.'
type: str
edpm_multipathd_command:
default: '/usr/sbin/multipathd -d'
description: 'The command to start the multipathd daemon.'
type: str
edpm_multipathd_volumes:
default:
- /var/lib/kolla/config_files/multipathd.json:/var/lib/kolla/config_files/config.json:ro
- /dev:/dev
- /run/udev:/run/udev
- /sys:/sys
- /lib/modules:/lib/modules:ro
- /etc/iscsi:/etc/iscsi:ro
- /var/lib/iscsi:/var/lib/iscsi:z
- /etc/multipath:/etc/multipath:z
- /etc/multipath.conf:/etc/multipath.conf:ro
description: List of volumes in a mount point format.
type: list
edpm_multipathd_restart_sentinel:
default: '/etc/multipath/.multipath_restart_required'
description: >-
Path to the sentinel file that is used to signal when the multipath
daemon needs to be restarted.
type: str
edpm_multipathd_custom_config_dir:
default: '/runner/multipath'
description: >-
Directory used by the ansibleee-runner pod to install a custom
multipath.conf file.
type: str
edpm_multipathd_enable:
default: true
description: 'Whether to enable the multipath daemon.'
type: bool
edpm_multipathd_find_multipaths:
default: true
description: >-
Whether to automatically create a multipath device for each path.
type: bool
edpm_multipathd_recheck_wwid:
default: true
description: >-
Whether to recheck the path WWID when a failed path is restored.
type: bool
edpm_multipathd_skip_kpartx:
default: true
description: >-
Whether to skip automatically creating partitions on the device.
type: bool
edpm_multipathd_user_friendly_names:
default: false
description: >-
Whether to enable assigning a user friendly name to each path.
type: bool
edpm_multipathd_custom_config_file:
default: ''
description: >-
Fully qualified path of a local multipath.conf file to be
installed on the overcloud nodes. By default, a minimal
multipath.conf file will be installed. NOTE - Other TripleO
multipath parameters will override any corresponding
value in the local custom config file. For example, if
MultipathdEnableUserFriendlyNames is False, the files on the
overcloud nodes will be updated match, even if the setting is
enabled in the local custom file.
type: str
42 changes: 42 additions & 0 deletions roles/edpm_multipathd/meta/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
# Copyright 2023 Red Hat, Inc.
# All Rights Reserved.
#
# 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.


galaxy_info:
namespace: openstack
author: OpenStack
description: EDPM OpenStack Role -- edpm_multipathd
company: Red Hat
license: Apache-2.0
min_ansible_version: '2.9'
#
# Provide a list of supported platforms, and for each platform a list of versions.
# If you don't wish to enumerate all versions for a particular platform, use 'all'.
# To view available platforms and versions (or releases), visit:
# https://galaxy.ansible.com/api/v1/platforms/
#
platforms:
- name: 'EL'
versions:
- '9'

galaxy_tags:
- edpm


# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.
dependencies: []
22 changes: 22 additions & 0 deletions roles/edpm_multipathd/molecule/custom_config/converge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
# Copyright 2023 Red Hat, Inc.
# All Rights Reserved.
#
# 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: Run the default converge playbook
import_playbook: ../default/converge.yml
vars:
edpm_multipathd_custom_config_dir: "."
edpm_multipathd_custom_config_file: custom_multipath.conf
31 changes: 31 additions & 0 deletions roles/edpm_multipathd/molecule/custom_config/molecule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
dependency:
name: galaxy
options:
role-file: collections.yml
driver:
name: podman
platforms:
- command: /sbin/init
dockerfile: ../../../../molecule/common/Containerfile.j2
image: ${EDPM_ANSIBLE_MOLECULE_IMAGE:-"ubi9/ubi-init"}
name: instance
privileged: true
registry:
url: ${EDPM_ANSIBLE_MOLECULE_REGISTRY:-"registry.access.redhat.com"}
volumes:
- /run/udev:/run/udev
provisioner:
name: ansible
log: true
scenario:
test_sequence:
- destroy
- create
- prepare
- converge
- check
- verify
- destroy
verifier:
name: ansible
19 changes: 19 additions & 0 deletions roles/edpm_multipathd/molecule/custom_config/prepare.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
# Copyright 2023 Red Hat, Inc.
# All Rights Reserved.
#
# 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: Run the default prepare playbook
import_playbook: ../default/prepare.yml
Loading

0 comments on commit c0ff3ba

Please sign in to comment.