Skip to content

Commit

Permalink
fix: check service status
Browse files Browse the repository at this point in the history
  • Loading branch information
gonzaloetjo committed Nov 30, 2023
1 parent 1f5207d commit d29186c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions roles/yarn/resourcemanager/tasks/capacity_scheduler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,20 @@
group: root
mode: "644"

- name: Check if Hadoop YARN ResourceManager service is running
ansible.builtin.systemd:
name: hadoop-yarn-resourcemanager.service
state: started
register: yarn_service
ignore_errors: true

- name: "Yarn scheduler | take kerberos ticket"
ansible.builtin.command: kinit -kt /etc/security/keytabs/rm.service.keytab "rm/{{ ansible_hostname | tosit.tdp.access_fqdn(hostvars) }}@{{ realm }}"
become_user: yarn
when: yarn_service is defined and yarn_service.status.ActiveState == 'active'

- name: "Yarn scheduler | Refresh Queues"
ansible.builtin.command: /usr/bin/yarn rmadmin -refreshQueues
become_user: yarn
when: yarn_service is defined and yarn_service.status.ActiveState == 'active'

Check failure on line 29 in roles/yarn/resourcemanager/tasks/capacity_scheduler.yml

View workflow job for this annotation

GitHub Actions / ansible-lint

yaml[empty-lines]

Too many blank lines (1 > 0)

0 comments on commit d29186c

Please sign in to comment.