Skip to content
Snippets Groups Projects
Commit 6c54ce4d authored by Mark Goddard's avatar Mark Goddard Committed by Pierre Riteau
Browse files

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
parent 3b0a74df
No related branches found
No related tags found
No related merge requests found
Showing
with 129 additions and 0 deletions
--- ---
- name: Ensure LVM configuration is applied - name: Ensure LVM configuration is applied
hosts: seed-hypervisor:seed:overcloud:infra-vms 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: tags:
- lvm - lvm
- upgrade-check - upgrade-check
......
--- ---
- name: Ensure software RAID configuration is applied - name: Ensure software RAID configuration is applied
hosts: seed-hypervisor:seed:overcloud:infra-vms hosts: seed-hypervisor:seed:overcloud:infra-vms
max_fail_percentage: >-
{{ mdadm_max_fail_percentage |
default(host_configure_max_fail_percentage) |
default(kayobe_max_fail_percentage) |
default(100) }}
tags: tags:
- mdadm - mdadm
roles: roles:
......
--- ---
- name: Check network connectivity between hosts - name: Check network connectivity between hosts
hosts: seed:seed-hypervisor:overcloud:infra-vms hosts: seed:seed-hypervisor:overcloud:infra-vms
max_fail_percentage: >-
{{ network_connectivity_max_fail_percentage |
default(kayobe_max_fail_percentage) |
default(100) }}
vars: vars:
# Set this to an external IP address to check. # Set this to an external IP address to check.
nc_external_ip: 8.8.8.8 nc_external_ip: 8.8.8.8
......
--- ---
- name: Ensure networking is configured - name: Ensure networking is configured
hosts: seed-hypervisor:seed:overcloud:infra-vms hosts: seed-hypervisor:seed:overcloud:infra-vms
max_fail_percentage: >-
{{ network_max_fail_percentage |
default(host_configure_max_fail_percentage) |
default(kayobe_max_fail_percentage) |
default(100) }}
tags: tags:
- config - config
- network - network
......
...@@ -9,6 +9,10 @@ ...@@ -9,6 +9,10 @@
- name: Group overcloud nodes by their BMC type - name: Group overcloud nodes by their BMC type
hosts: overcloud hosts: overcloud
gather_facts: no gather_facts: no
max_fail_percentage: >-
{{ overcloud_bios_raid_max_fail_percentage |
default(kayobe_max_fail_percentage) |
default(100) }}
tags: tags:
- bios - bios
- raid - raid
...@@ -35,6 +39,10 @@ ...@@ -35,6 +39,10 @@
- name: Check whether any changes to nodes' BIOS and RAID configuration are required - name: Check whether any changes to nodes' BIOS and RAID configuration are required
hosts: overcloud_with_bmcs_of_type_idrac hosts: overcloud_with_bmcs_of_type_idrac
gather_facts: no gather_facts: no
max_fail_percentage: >-
{{ overcloud_bios_raid_max_fail_percentage |
default(kayobe_max_fail_percentage) |
default(100) }}
tags: tags:
- bios - bios
- raid - raid
...@@ -57,6 +65,10 @@ ...@@ -57,6 +65,10 @@
- name: Ensure that overcloud BIOS and RAID volumes are configured - name: Ensure that overcloud BIOS and RAID volumes are configured
hosts: overcloud_with_bmcs_of_type_idrac hosts: overcloud_with_bmcs_of_type_idrac
gather_facts: no gather_facts: no
max_fail_percentage: >-
{{ overcloud_bios_raid_max_fail_percentage |
default(kayobe_max_fail_percentage) |
default(100) }}
tags: tags:
- bios - bios
- raid - raid
......
...@@ -3,6 +3,10 @@ ...@@ -3,6 +3,10 @@
- name: Ensure the overcloud nodes are deprovisioned - name: Ensure the overcloud nodes are deprovisioned
hosts: overcloud hosts: overcloud
max_fail_percentage: >-
{{ overcloud_deprovision_max_fail_percentage |
default(kayobe_max_fail_percentage) |
default(100) }}
tags: tags:
- deprovision - deprovision
vars: vars:
......
...@@ -9,6 +9,10 @@ ...@@ -9,6 +9,10 @@
- name: Ensure overcloud hosts' /etc/hosts does not contain incorrect IPs - name: Ensure overcloud hosts' /etc/hosts does not contain incorrect IPs
hosts: overcloud hosts: overcloud
max_fail_percentage: >-
{{ overcloud_etc_hosts_fixup_max_fail_percentage |
default(kayobe_max_fail_percentage) |
default(100) }}
tags: tags:
- etc-hosts-fixup - etc-hosts-fixup
tasks: tasks:
...@@ -25,6 +29,10 @@ ...@@ -25,6 +29,10 @@
- name: Ensure rabbitmq containers' /etc/hosts does not contain incorrect IPs - name: Ensure rabbitmq containers' /etc/hosts does not contain incorrect IPs
hosts: overcloud hosts: overcloud
max_fail_percentage: >-
{{ overcloud_etc_hosts_fixup_max_fail_percentage |
default(kayobe_max_fail_percentage) |
default(100) }}
tags: tags:
- etc-hosts-fixup - etc-hosts-fixup
vars: vars:
......
--- ---
- name: Gather facts - name: Gather facts
hosts: overcloud hosts: overcloud
max_fail_percentage: >-
{{ overcloud_facts_gather_max_fail_percentage |
default(kayobe_max_fail_percentage) |
default(100) }}
gather_facts: false gather_facts: false
tasks: tasks:
- name: Gather facts - name: Gather facts
......
...@@ -3,6 +3,10 @@ ...@@ -3,6 +3,10 @@
- name: Ensure the overcloud nodes' hardware is inspected - name: Ensure the overcloud nodes' hardware is inspected
hosts: overcloud hosts: overcloud
max_fail_percentage: >-
{{ overcloud_hardware_inspect_max_fail_percentage |
default(kayobe_max_fail_percentage) |
default(100) }}
tags: tags:
- hardware-inspect - hardware-inspect
vars: vars:
......
--- ---
- name: Ensure the overcloud nodes' hardware introspection data is saved - name: Ensure the overcloud nodes' hardware introspection data is saved
hosts: overcloud hosts: overcloud
max_fail_percentage: >-
{{ overcloud_introspection_data_save_max_fail_percentage |
default(kayobe_max_fail_percentage) |
default(100) }}
vars: vars:
seed_host: "{{ groups['seed'][0] }}" seed_host: "{{ groups['seed'][0] }}"
# Override this to save results to another location. # Override this to save results to another location.
......
...@@ -3,6 +3,10 @@ ...@@ -3,6 +3,10 @@
- name: Ensure the overcloud nodes are provisioned - name: Ensure the overcloud nodes are provisioned
hosts: overcloud hosts: overcloud
max_fail_percentage: >-
{{ overcloud_provision_max_fail_percentage |
default(kayobe_max_fail_percentage) |
default(100) }}
tags: tags:
- provision - provision
vars: vars:
......
--- ---
- name: Save overcloud service configuration - name: Save overcloud service configuration
hosts: overcloud hosts: overcloud
max_fail_percentage: >-
{{ overcloud_service_config_save_max_fail_percentage |
default(kayobe_max_fail_percentage) |
default(100) }}
tags: tags:
- service-config-save - service-config-save
vars: vars:
......
...@@ -5,6 +5,10 @@ ...@@ -5,6 +5,10 @@
- name: Group hosts by their switch type and apply configuration filters - name: Group hosts by their switch type and apply configuration filters
hosts: switches hosts: switches
gather_facts: no gather_facts: no
max_fail_percentage: >-
{{ physical_network_max_fail_percentage |
default(kayobe_max_fail_percentage) |
default(100) }}
vars: vars:
# Set this variable to True to configure the network for hardware # Set this variable to True to configure the network for hardware
# discovery. # discovery.
...@@ -90,6 +94,10 @@ ...@@ -90,6 +94,10 @@
- name: Display switch configuration - name: Display switch configuration
hosts: switches_in_display_mode_True hosts: switches_in_display_mode_True
gather_facts: no gather_facts: no
max_fail_percentage: >-
{{ physical_network_max_fail_percentage |
default(kayobe_max_fail_percentage) |
default(100) }}
tasks: tasks:
- name: Display the candidate global switch configuration - name: Display the candidate global switch configuration
debug: debug:
...@@ -102,6 +110,10 @@ ...@@ -102,6 +110,10 @@
- name: Ensure Arista physical switches are configured - name: Ensure Arista physical switches are configured
hosts: switches_of_type_arista:&switches_in_display_mode_False hosts: switches_of_type_arista:&switches_in_display_mode_False
gather_facts: no gather_facts: no
max_fail_percentage: >-
{{ physical_network_max_fail_percentage |
default(kayobe_max_fail_percentage) |
default(100) }}
roles: roles:
- role: ssh-known-host - role: ssh-known-host
...@@ -114,6 +126,10 @@ ...@@ -114,6 +126,10 @@
- name: Ensure DellOS physical switches are configured - name: Ensure DellOS physical switches are configured
hosts: switches_of_type_dellos6:switches_of_type_dellos9:switches_of_type_dellos10:&switches_in_display_mode_False hosts: switches_of_type_dellos6:switches_of_type_dellos9:switches_of_type_dellos10:&switches_in_display_mode_False
gather_facts: no gather_facts: no
max_fail_percentage: >-
{{ physical_network_max_fail_percentage |
default(kayobe_max_fail_percentage) |
default(100) }}
roles: roles:
- role: ssh-known-host - role: ssh-known-host
...@@ -127,6 +143,10 @@ ...@@ -127,6 +143,10 @@
- name: Ensure Dell PowerConnect physical switches are configured - name: Ensure Dell PowerConnect physical switches are configured
hosts: switches_of_type_dell-powerconnect:&switches_in_display_mode_False hosts: switches_of_type_dell-powerconnect:&switches_in_display_mode_False
gather_facts: no gather_facts: no
max_fail_percentage: >-
{{ physical_network_max_fail_percentage |
default(kayobe_max_fail_percentage) |
default(100) }}
roles: roles:
- role: ssh-known-host - role: ssh-known-host
...@@ -139,6 +159,10 @@ ...@@ -139,6 +159,10 @@
- name: Ensure Juniper physical switches are configured - name: Ensure Juniper physical switches are configured
hosts: switches_of_type_junos:&switches_in_display_mode_False hosts: switches_of_type_junos:&switches_in_display_mode_False
gather_facts: no gather_facts: no
max_fail_percentage: >-
{{ physical_network_max_fail_percentage |
default(kayobe_max_fail_percentage) |
default(100) }}
roles: roles:
- role: ssh-known-host - role: ssh-known-host
...@@ -152,6 +176,10 @@ ...@@ -152,6 +176,10 @@
- name: Ensure Mellanox physical switches are configured - name: Ensure Mellanox physical switches are configured
hosts: switches_of_type_mellanox:&switches_in_display_mode_False hosts: switches_of_type_mellanox:&switches_in_display_mode_False
gather_facts: no gather_facts: no
max_fail_percentage: >-
{{ physical_network_max_fail_percentage |
default(kayobe_max_fail_percentage) |
default(100) }}
roles: roles:
- role: ssh-known-host - role: ssh-known-host
...@@ -164,6 +192,10 @@ ...@@ -164,6 +192,10 @@
- name: Ensure Cumulus physical switches are configured with NCLU - name: Ensure Cumulus physical switches are configured with NCLU
hosts: switches_of_type_nclu:&switches_in_display_mode_False hosts: switches_of_type_nclu:&switches_in_display_mode_False
gather_facts: no gather_facts: no
max_fail_percentage: >-
{{ physical_network_max_fail_percentage |
default(kayobe_max_fail_percentage) |
default(100) }}
roles: roles:
- role: ssh-known-host - role: ssh-known-host
......
--- ---
- name: Configure local PyPi mirror - name: Configure local PyPi mirror
hosts: seed-hypervisor:seed:overcloud:infra-vms hosts: seed-hypervisor:seed:overcloud:infra-vms
max_fail_percentage: >-
{{ pip_max_fail_percentage |
default(host_configure_max_fail_percentage) |
default(kayobe_max_fail_percentage) |
default(100) }}
tags: tags:
- pip - pip
vars: vars:
......
- name: Configure HTTP(S) proxy settings - name: Configure HTTP(S) proxy settings
hosts: seed-hypervisor:seed:overcloud:infra-vms hosts: seed-hypervisor:seed:overcloud:infra-vms
max_fail_percentage: >-
{{ proxy_max_fail_percentage |
default(host_configure_max_fail_percentage) |
default(kayobe_max_fail_percentage) |
default(100) }}
vars: vars:
ansible_python_interpreter: /usr/bin/python3 ansible_python_interpreter: /usr/bin/python3
tags: tags:
......
--- ---
- name: Configure SELinux state and reboot if required - name: Configure SELinux state and reboot if required
hosts: seed:seed-hypervisor:overcloud:infra-vms hosts: seed:seed-hypervisor:overcloud:infra-vms
max_fail_percentage: >-
{{ selinux_max_fail_percentage |
default(host_configure_max_fail_percentage) |
default(kayobe_max_fail_percentage) |
default(100) }}
tags: tags:
- selinux - selinux
roles: roles:
......
...@@ -2,6 +2,11 @@ ...@@ -2,6 +2,11 @@
- name: Ensure known hosts are configured - name: Ensure known hosts are configured
hosts: all hosts: all
gather_facts: no gather_facts: no
max_fail_percentage: >-
{{ ssh_known_host_max_fail_percentage |
default(host_configure_max_fail_percentage) |
default(kayobe_max_fail_percentage) |
default(100) }}
tags: tags:
- ssh-known-host - ssh-known-host
roles: roles:
......
...@@ -2,6 +2,11 @@ ...@@ -2,6 +2,11 @@
- name: Configure swap - name: Configure swap
hosts: seed-hypervisor:seed:overcloud:infra-vms hosts: seed-hypervisor:seed:overcloud:infra-vms
become: true become: true
max_fail_percentage: >-
{{ swap_max_fail_percentage |
default(host_configure_max_fail_percentage) |
default(kayobe_max_fail_percentage) |
default(100) }}
tags: tags:
- swap - swap
tasks: tasks:
......
--- ---
- name: Ensure Swift block devices are prepared - name: Ensure Swift block devices are prepared
hosts: "{{ swift_hosts }}" hosts: "{{ swift_hosts }}"
max_fail_percentage: >-
{{ swift_block_devices_max_fail_percentage |
default(kayobe_max_fail_percentage) |
default(100) }}
vars: vars:
swift_hosts: storage swift_hosts: storage
tags: tags:
......
--- ---
- name: Ensure sysctl parameters are configured - name: Ensure sysctl parameters are configured
hosts: seed:seed-hypervisor:overcloud:infra-vms hosts: seed:seed-hypervisor:overcloud:infra-vms
max_fail_percentage: >-
{{ sysctl_max_fail_percentage |
default(host_configure_max_fail_percentage) |
default(kayobe_max_fail_percentage) |
default(100) }}
tags: tags:
- sysctl - sysctl
roles: roles:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment