Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/molecule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ jobs:
- edpm_derive_pci_device_spec
- edpm_download_cache
- edpm_growvols
- edpm_multipathd
- edpm_network_config
- edpm_neutron_dhcp
- edpm_neutron_metadata
Expand Down
9 changes: 0 additions & 9 deletions roles/edpm_download_cache/tasks/container_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,6 @@
- edpm_neutron_ovn
- download_cache

- name: Download images for edpm_multipathd role
when: '"nova" in edpm_download_cache_running_services'
ansible.builtin.include_role:
name: osp.edpm.edpm_multipathd
tasks_from: download_cache.yml
tags:
- edpm_multipathd
- download_cache

- name: Download images for edpm_nova role
when: '"nova" in edpm_download_cache_running_services'
ansible.builtin.include_role:
Expand Down
10 changes: 10 additions & 0 deletions roles/edpm_download_cache/tasks/packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,13 @@
tags:
- edpm_iscsid
- download_cache

- name: Download packages for edpm_multipathd role
# multipathd is part of the "nova" EDPM service
when: '"nova" in edpm_download_cache_running_services'
ansible.builtin.include_role:
name: osp.edpm.edpm_multipathd
tasks_from: download_cache.yml
tags:
- edpm_multipathd
- download_cache
27 changes: 9 additions & 18 deletions roles/edpm_multipathd/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,13 @@ 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_image_download_delay: "{{ edpm_download_delay | default(60) }}"
edpm_multipathd_image_download_retries: "{{ edpm_download_retries | default(5) }}"

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
- /etc/multipath:/etc/multipath:z
- /etc/multipath.conf:/etc/multipath.conf:ro
edpm_multipathd_download_delay: "{{ edpm_download_delay | default(60) }}"
edpm_multipathd_download_retries: "{{ edpm_download_retries | default(5) }}"

edpm_multipathd_packages:
- device-mapper-multipath

# 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

Expand All @@ -47,5 +36,7 @@ edpm_multipathd_user_friendly_names: false

# This may be overridden to deploy a custom multipath.conf file.
edpm_multipathd_custom_config_file: ''
# If container health check should be enabled
edpm_multipathd_healthcheck: true

edpm_multipathd_legacy_services:
- tripleo_multipathd.service
- edpm_multipathd.service
18 changes: 0 additions & 18 deletions roles/edpm_multipathd/files/healthchecks/multipathd/healthcheck

This file was deleted.

4 changes: 4 additions & 0 deletions roles/edpm_multipathd/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---

- name: Restart the multipath subsystem
ansible.builtin.include_tasks: restart_multipath.yml
41 changes: 11 additions & 30 deletions roles/edpm_multipathd/meta/argument_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ argument_specs:
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_image_download_delay:
type: int
default: 5
Expand All @@ -16,29 +12,11 @@ argument_specs:
type: int
default: 5
description: The number of retries for failed download tasks
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.
edpm_multipathd_packages:
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
description: The list of packages to install for multipathd.
default:
- device-mapper-multipath
edpm_multipathd_custom_config_dir:
default: '/runner/multipath'
description: >-
Expand Down Expand Up @@ -81,8 +59,11 @@ argument_specs:
overcloud nodes will be updated match, even if the setting is
enabled in the local custom file.
type: str
edpm_multipathd_healthcheck:
type: bool
default: true
edpm_multipathd_legacy_services:
type: list
description: |
Enable container health check injection
The list of legacy containerized services associated with adoption
and brownfield deployment scenarios.
default:
- tripleo_multipathd.service
- edpm_multipathd.service
31 changes: 0 additions & 31 deletions roles/edpm_multipathd/molecule/custom_config/molecule.yml

This file was deleted.

1 change: 1 addition & 0 deletions roles/edpm_multipathd/molecule/custom_config/molecule.yml
19 changes: 0 additions & 19 deletions roles/edpm_multipathd/molecule/custom_config/prepare.yml

This file was deleted.

1 change: 1 addition & 0 deletions roles/edpm_multipathd/molecule/custom_config/prepare.yml
3 changes: 3 additions & 0 deletions roles/edpm_multipathd/molecule/default/collections.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
collections:
- name: community.general
20 changes: 3 additions & 17 deletions roles/edpm_multipathd/molecule/default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,6 @@
hosts: all
gather_facts: false
vars:
# We cannot use the real multipathd command because the daemon needs
# privileges that are not available in a rootless molecule container,
# even with "privileged: true".
edpm_multipathd_command: "/usr/bin/sleep 3600"
tasks:
- name: Install multipathd
ansible.builtin.import_role:
name: osp.edpm.edpm_multipathd
tasks_from: install.yml
- name: Configure multipathd
ansible.builtin.import_role:
name: osp.edpm.edpm_multipathd
tasks_from: configure.yml
- name: Run multipathd
ansible.builtin.import_role:
name: osp.edpm.edpm_multipathd
tasks_from: run.yml
edpm_container_cli: "true"
roles:
- role: osp.edpm.edpm_multipathd
18 changes: 6 additions & 12 deletions roles/edpm_multipathd/molecule/default/molecule.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
---
dependency:
name: galaxy
options:
role-file: collections.yml
driver:
name: podman
name: delegated
options:
managed: false
ansible_connection_options:
ansible_connection: local
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
- name: edpm_multipathd
provisioner:
name: ansible
log: true
Expand Down
61 changes: 46 additions & 15 deletions roles/edpm_multipathd/molecule/default/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,56 @@
# License for the specific language governing permissions and limitations
# under the License.

- name: Prepare test deps
- name: Prepare
hosts: all
gather_facts: false
roles:
- role: ../../../../molecule/common/test_deps
test_deps_extra_packages:
- iproute
- iscsi-initiator-utils
- podman
test_deps_setup_edpm: true
test_deps_setup_stream: true
- name: Prepare
hosts: all
roles:
- role: osp.edpm.env_data

- name: Setup DUT
hosts: all
gather_facts: false
vars:
test_helper_dir: "../../../../molecule/test-helpers"
tasks:
- name: set /etc/localtime
- name: Load role vars
ansible.builtin.include_vars: ../../defaults/main.yml

- name: Create systemd unit file for mocked legacy containerized services
become: true
ansible.builtin.copy:
dest: "/etc/systemd/system/{{ legacy_service }}"
content: |
[Unit]
Description=Mock containerized multipathd service

[Service]
ExecStart=sleep 9999

[Install]
WantedBy=multi-user.target
mode: '0644'
loop: "{{ edpm_multipathd_legacy_services }}"
loop_control:
loop_var: legacy_service

- name: Enable and start mocked legacy services
become: true
ansible.builtin.file:
path: /etc/localtime
src: /usr/share/zoneinfo/UTC
state: link
ansible.builtin.systemd_service:
name: "{{ legacy_service }}"
enabled: true
state: started
daemon_reload: true
loop: "{{ edpm_multipathd_legacy_services }}"
loop_control:
loop_var: legacy_service

- name: Verify mocked legacy services are running
ansible.builtin.include_tasks: "{{test_helper_dir}}/verify_systemd_unit.yaml"
vars:
item:
name: "{{ legacy_service }}"
loop: "{{ edpm_multipathd_legacy_services }}"
loop_control:
loop_var: legacy_service
20 changes: 20 additions & 0 deletions roles/edpm_multipathd/molecule/default/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,14 @@
- name: Verify
hosts: all
gather_facts: false
vars:
test_helper_dir: "../../../../molecule/test-helpers"
tasks:
- name: Load role vars
ansible.builtin.include_vars: ../../defaults/main.yml

- name: Check /etc/multipath.conf settings
become: true
lineinfile:
name: /etc/multipath.conf
regexp: "^\\s+{{ item.var }}"
Expand All @@ -39,3 +45,17 @@
- multipath_result.changed
failed_when:
- true

- name: Ensure multipathd service is enabled and running
ansible.builtin.include_tasks: "{{test_helper_dir}}/verify_systemd_unit.yaml"
loop:
- { "name": "multipathd.service", "osp_service": false }

- name: Ensure legacy services are disabled and not running
become: true
ansible.builtin.shell: |
! systemctl is-enabled "{{ legacy_service }}" && ! systemctl is-active "{{ legacy_service }}"
changed_when: false
loop: "{{ edpm_multipathd_legacy_services }}"
loop_control:
loop_var: legacy_service
Loading