From 68ce8e11f84efca20f9cdd6349eedc76ddec0f8f Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Fri, 8 Mar 2024 17:10:43 +0100 Subject: [PATCH] linter: address syntax errors This fixes the following error: ``` syntax-check[specific]: The field 'hosts' has an invalid value, which includes an undefined variable. ``` Signed-off-by: Guillaume Abrioux --- infrastructure-playbooks/cephadm-adopt.yml | 2 +- infrastructure-playbooks/shrink-mds.yml | 4 ++-- infrastructure-playbooks/shrink-mgr.yml | 4 ++-- infrastructure-playbooks/shrink-mon.yml | 4 ++-- infrastructure-playbooks/shrink-osd.yml | 6 +++--- infrastructure-playbooks/shrink-rbdmirror.yml | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/infrastructure-playbooks/cephadm-adopt.yml b/infrastructure-playbooks/cephadm-adopt.yml index 818777b14..9a0767598 100644 --- a/infrastructure-playbooks/cephadm-adopt.yml +++ b/infrastructure-playbooks/cephadm-adopt.yml @@ -603,7 +603,7 @@ CEPHADM_IMAGE: '{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}' - name: adopt ceph mgr daemons - hosts: "{{ groups[mgr_group_name] | default(groups[mon_group_name]) }}" + hosts: "{{ groups['mgrs'] | default(groups['mons']) | default(omit) }}" serial: 1 become: true gather_facts: false diff --git a/infrastructure-playbooks/shrink-mds.yml b/infrastructure-playbooks/shrink-mds.yml index 296ef52f1..04b8e1daa 100644 --- a/infrastructure-playbooks/shrink-mds.yml +++ b/infrastructure-playbooks/shrink-mds.yml @@ -24,7 +24,7 @@ tasks_from: container_binary - name: perform checks, remove mds and print cluster health - hosts: "{{ groups[mon_group_name][0] }}" + hosts: mons[0] become: true vars_prompt: - name: ireallymeanit @@ -165,4 +165,4 @@ post_tasks: - name: show ceph health command: "{{ container_exec_cmd | default('') }} ceph --cluster {{ cluster }} -s" - changed_when: false \ No newline at end of file + changed_when: false diff --git a/infrastructure-playbooks/shrink-mgr.yml b/infrastructure-playbooks/shrink-mgr.yml index 66745f7c6..378ab661a 100644 --- a/infrastructure-playbooks/shrink-mgr.yml +++ b/infrastructure-playbooks/shrink-mgr.yml @@ -21,7 +21,7 @@ msg: gather facts on all Ceph hosts for following reference - name: confirm if user really meant to remove manager from the ceph cluster - hosts: "{{ groups[mon_group_name][0] }}" + hosts: mons[0] become: true vars_prompt: - name: ireallymeanit @@ -130,4 +130,4 @@ post_tasks: - name: show ceph health command: "{{ container_exec_cmd | default('') }} ceph --cluster {{ cluster }} -s" - changed_when: false \ No newline at end of file + changed_when: false diff --git a/infrastructure-playbooks/shrink-mon.yml b/infrastructure-playbooks/shrink-mon.yml index 05d6c2be5..1bf1f7c46 100644 --- a/infrastructure-playbooks/shrink-mon.yml +++ b/infrastructure-playbooks/shrink-mon.yml @@ -22,7 +22,7 @@ - debug: msg="gather facts on all Ceph hosts for following reference" - name: confirm whether user really meant to remove monitor from the ceph cluster - hosts: "{{ groups[mon_group_name][0] }}" + hosts: mons[0] become: true vars_prompt: - name: ireallymeanit @@ -144,4 +144,4 @@ - name: show ceph mon status command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} mon stat" delegate_to: "{{ mon_host }}" - changed_when: false \ No newline at end of file + changed_when: false diff --git a/infrastructure-playbooks/shrink-osd.yml b/infrastructure-playbooks/shrink-osd.yml index 8e739fafa..6f866710d 100644 --- a/infrastructure-playbooks/shrink-osd.yml +++ b/infrastructure-playbooks/shrink-osd.yml @@ -14,8 +14,8 @@ - name: gather facts and check the init system hosts: - - "{{ mon_group_name|default('mons') }}" - - "{{ osd_group_name|default('osds') }}" + - mons + - osds become: True tasks: @@ -23,7 +23,7 @@ - name: confirm whether user really meant to remove osd(s) from the cluster - hosts: "{{ groups[mon_group_name][0] }}" + hosts: mons[0] become: true diff --git a/infrastructure-playbooks/shrink-rbdmirror.yml b/infrastructure-playbooks/shrink-rbdmirror.yml index db7cc3a21..92a30679a 100644 --- a/infrastructure-playbooks/shrink-rbdmirror.yml +++ b/infrastructure-playbooks/shrink-rbdmirror.yml @@ -22,7 +22,7 @@ - name: confirm whether user really meant to remove rbd mirror from the ceph cluster - hosts: "{{ groups[mon_group_name][0] }}" + hosts: mons[0] become: true vars_prompt: - name: ireallymeanit