From 4e88bdb7da94a8be4e4eb48c313aff6fadbce685 Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Tue, 1 Jun 2021 14:59:47 +0300 Subject: [PATCH] Don't rely on compute_hosts existance There might be scenarios when compute_hosts group is not present, but we still need to deploy nova scheduler. So we have to set default for groups['compute_hosts']. Change-Id: I18d42e902b0b3eb5494bcffb424731dfe85c74f9 --- defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index c035dbf5..7db041c7 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -313,7 +313,7 @@ nova_ram_allocation_ratio: 1.0 nova_ram_weight_multiplier: 5.0 nova_reserved_host_disk_mb: 2048 -nova_scheduler_host_subset_size: "{{ ((((groups['compute_hosts'] | length) * 0.3) | round | int, 10) | min, 1) | max }}" +nova_scheduler_host_subset_size: "{{ ((((groups['compute_hosts'] | default([]) | length) * 0.3) | round | int, 10) | min, 1) | max }}" nova_scheduler_max_attempts: 5 nova_scheduler_default_filters: - AvailabilityZoneFilter