kayobe/ansible/lvm.yml
Mark Goddard 6c54ce4d3b Introduce max fail percentage to playbooks
This allows us to continue execution until a certain proportion of hosts
fail. This can be useful at scale, where failures are common, and
restarting a deployment is time-consuming.

The default max failure percentage is 100, keeping the default
behaviour. A global max failure percentage may be set via
kayobe_max_fail_percentage, and individual playbooks may define a max
failure percentage via <playbook>_max_fail_percentage.

Related Kolla Ansible patch:
https://review.opendev.org/c/openstack/kolla-ansible/+/805598

Change-Id: Ib81c72b63be5765cca664c38141ffc769640cf07
2024-06-03 16:24:29 +00:00

41 lines
1.4 KiB
YAML

---
- name: Ensure LVM configuration is applied
hosts: seed-hypervisor:seed:overcloud:infra-vms
max_fail_percentage: >-
{{ lvm_max_fail_percentage |
default(host_configure_max_fail_percentage) |
default(kayobe_max_fail_percentage) |
default(100) }}
tags:
- lvm
- upgrade-check
tasks:
- name: Fail if the LVM physical disks have not been configured
fail:
msg: >
The physical disk list has not been configured for volume
{{ item.vgname }}. Ensure that each volume group in 'lvm_groups'
has a valid 'disks' list.
with_items: "{{ lvm_groups | default([]) }}"
when: not item.disks | default([]) or 'changeme' in item.disks | default([])
- name: Fail if the LVM physical disks are configured as a comma-separated string
fail:
msg: >
The physical disk list for volume {{ item.vgname }} must be
configured as a list instead of a comma-separated string. Ensure that
each volume group in 'lvm_groups' has a valid 'disks' list.
with_items: "{{ lvm_groups | default([]) }}"
when: item.disks | string() == item.disks
- name: Ensure LVM configuration is applied
vars:
manage_lvm: True
include_role:
name: mrlesmithjr.manage_lvm
apply:
become: True
when:
- lvm_groups is defined
- lvm_groups | length > 0