Comment 2 for bug 2051262

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ansible-playbooks (master)

Reviewed: https://review.opendev.org/c/starlingx/ansible-playbooks/+/906744
Committed: https://opendev.org/starlingx/ansible-playbooks/commit/4d2e62d02a45917555ce933afbf465bd4de9e7aa
Submitter: "Zuul (22348)"
Branch: master

commit 4d2e62d02a45917555ce933afbf465bd4de9e7aa
Author: Salman Rana <email address hidden>
Date: Thu Jan 25 11:00:52 2024 -0500

    Fix: Rehoming Active Controller Check

    When an inactive controller-0 DX subcloud is targeted for rehoming,
    the pre-rehome validation is observed to fail incorrectly and report
    a misleading error. In this scenario, the active_controller check
    (verify if it's controller-0) is expected to fail. However, the playbook
    fails incorrectly/pre-maturely with the distributed_cloud_role check
    failing to identify the target as a subcloud.

    This pre-mature failure is a result of credentials not loading when
    attempting to check the distributed_cloud_role. The credentials failure
    is expected in this specific scenario, as the target is not the active
    controller. However, this should not be
    reported as distributed_cloud_role failure, as the issue is related
    to the active controller.

    This change ensures that the active controller check is performed
    prior to the distributed_cloud_role check.

    Test Plan:
     1. PASS: Rehome a controller-1 active DX subcloud.
              Attempt it with each controller's oam address.
              For each attempt, check the playbook logs and ensure:
            1. Correct playbook task fails: controller check fails
               (not the subcloud check)
            2. The following error message is printed in the playbook logs:
               "Rehoming can only be done when controller-0 is active."

     2. PASS: Swact the previously failing controller-1 active DX subcloud
              and ensure that it can be rehomed successfully.

    Closes-Bug: 2051262

    Change-Id: I1a289e26db0a95619c8107a3e734e8531e77592e
    Signed-off-by: Salman Rana <email address hidden>