From b848701a5fcf84f91e38a1bf4264e96ca80926f2 Mon Sep 17 00:00:00 2001 From: Giuseppe Di Piazza <41148801+dipiazzg@users.noreply.github.com> Date: Thu, 27 Oct 2022 15:29:19 +0100 Subject: [PATCH] [FIX] Add ability to ignore deprecated AMI (#121) --- EXAMPLE/cluster_defs/cluster_vars.yml | 2 ++ cluster_hosts/tasks/get_cluster_hosts_target.yml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/EXAMPLE/cluster_defs/cluster_vars.yml b/EXAMPLE/cluster_defs/cluster_vars.yml index db05fde6..518e3ffb 100644 --- a/EXAMPLE/cluster_defs/cluster_vars.yml +++ b/EXAMPLE/cluster_defs/cluster_vars.yml @@ -1,5 +1,7 @@ --- +override_deprecated_ami: true # If set true will prevent the playbook to fail in case any of the existing VM has a deprecated AMI. + redeploy_schemes_supported: ['_scheme_addallnew_rmdisk_rollback', '_scheme_addnewvm_rmdisk_rollback', '_scheme_rmvm_rmdisk_only', '_scheme_rmvm_keepdisk_rollback', '_noredeploy_scale_in_only'] #redeploy_scheme: _scheme_addallnew_rmdisk_rollback diff --git a/cluster_hosts/tasks/get_cluster_hosts_target.yml b/cluster_hosts/tasks/get_cluster_hosts_target.yml index d8b47e87..049aba9f 100644 --- a/cluster_hosts/tasks/get_cluster_hosts_target.yml +++ b/cluster_hosts/tasks/get_cluster_hosts_target.yml @@ -44,7 +44,7 @@ - warn_str: msg="get_cluster_hosts_target | Replaced some base images to ensure consistency across hosttype. {{cluster_hosts_target | symmetric_difference(__orig_cluster_hosts_target)}}" when: (cluster_hosts_target | symmetric_difference(__orig_cluster_hosts_target)) - when: (cluster_hosts_state | json_query('[?tagslabels.lifecycle_state==\'current\']') | length) + when: (cluster_hosts_state | json_query('[?tagslabels.lifecycle_state==\'current\']') | length and not override_deprecated_ami | bool) - name: get_cluster_hosts_target | Augment with cloud-specific parameters (if necessary)