restart.yml: add playbook to restart all nodes

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2021-10-26 13:20:42 +02:00
parent db178fc217
commit 8e19a929d3
No known key found for this signature in database
GPG Key ID: 4EF064D0E6D63020
1 changed files with 26 additions and 0 deletions

26
ansible/restart.yml Normal file
View File

@ -0,0 +1,26 @@
---
- name: Restart all nodes on all hosts
hosts:
- nimbus.mainnet
- nimbus.pyrmont
- nimbus.prater
become: false
tasks:
- name: Restart nodes on Linux
when: ansible_system == "Linux"
command: |
sudo systemctl --no-block restart 'beacon-node-*'
- name: Restart nodes on MacOS
when: ansible_system == "Darwin"
shell: |
sudo launchctl list | \
awk '/status.beacon-node/{print "system/$3"}' | \
xargs -n1 sudo launchctl kickstart -k
- name: Restart nodes on Windows
when: ansible_system == "Win32NT"
win_shell: |
Get-Service | \
where Name -Match '^beacon-node' | \
Restart-Service