From 10a7049dd565e99ab225979d6a22b92a92699b3d Mon Sep 17 00:00:00 2001 From: SteBaum Date: Thu, 26 Sep 2024 18:19:01 +0200 Subject: [PATCH] fix: become user hdfs and yarn for node check --- .../hadoop_decommissioning_check/tasks/main.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/roles/utils/hadoop_decommissioning_check/tasks/main.yml b/roles/utils/hadoop_decommissioning_check/tasks/main.yml index 20cc08c9..f3c9af20 100644 --- a/roles/utils/hadoop_decommissioning_check/tasks/main.yml +++ b/roles/utils/hadoop_decommissioning_check/tasks/main.yml @@ -2,6 +2,12 @@ # SPDX-License-Identifier: Apache-2.0 --- +- name: kinit yarn RM + ansible.builtin.command: kinit -kt /etc/security/keytabs/rm.service.keytab rm/{{ ansible_hostname | tosit.tdp.access_fqdn(hostvars) }}@{{ realm }} + become: true + become_user: yarn + changed_when: false + - name: Check yarn node status ansible.builtin.command: yarn node -list -all register: node_output @@ -24,6 +30,12 @@ ansible.builtin.debug: msg: "{{ app_output.stdout }}" +- name: kinit hdfs NN + ansible.builtin.command: kinit -kt /etc/security/keytabs/nn.service.keytab nn/{{ ansible_hostname | tosit.tdp.access_fqdn(hostvars) }}@{{ realm }} + become: true + become_user: hdfs + changed_when: false + - name: Check HDFS datanodes usage ansible.builtin.command: hdfs dfsadmin -report register: storage_output