]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commit
infra: use dedicated variables for balancer status
authorDimitri Savineau <dsavinea@redhat.com>
Tue, 3 Aug 2021 15:58:49 +0000 (11:58 -0400)
committerDimitri Savineau <savineau.dimitri@gmail.com>
Wed, 4 Aug 2021 15:43:47 +0000 (11:43 -0400)
commit2377da8f9b7cdb67c992a1536bd54ad2b8b30ccc
tree0c3bfb48a8cfecae89d0afd7acbf9cb5c6b37857
parent31cc8bd2aac835957103d107d4ba29cb1a37cde6
infra: use dedicated variables for balancer status

The balancer status is registered during the cephadm-adopt, rolling_update
and swith2container playbooks. But it is also used in the ceph-handler role
which is included in those playbooks too.
Even if the ceph-handler tasks are skipped for rolling_update and
switch2container, the balancer_status variable is erased with the skip task
result.

play1:
  register: balancer_status
play2:
  register: balancer_status <-- skipped
play3:
  when: (balancer_status.stdout | from_json)['active'] | bool

This leads to issue like:

The conditional check '(balancer_status.stdout | from_json)['active'] | bool'
failed. The error was: Unexpected templating type error occurred on
({% if (balancer_status.stdout | from_json)['active'] | bool %} True
{% else %} False {% endif %}): expected string or buffer.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1982054
Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
(cherry picked from commit 386661699bcfe05a220de6d58b9d50baa7eb6dc1)
infrastructure-playbooks/cephadm-adopt.yml
infrastructure-playbooks/rolling_update.yml
infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml