mirror of
https://github.com/ditatompel/xmr-remote-nodes.git
synced 2025-01-03 09:29:35 +00:00
Adding deploy-prober example
This commit is contained in:
parent
28f12b772b
commit
e873d8f84a
2 changed files with 46 additions and 6 deletions
17
Makefile
17
Makefile
|
@ -1,12 +1,7 @@
|
|||
.PHONY: deploy-server ui build linux-amd64 linux-arm64
|
||||
.PHONY: deploy-prober deploy-server ui build linux-amd64 linux-arm64
|
||||
|
||||
BINARY_NAME = xmr-nodes
|
||||
|
||||
# Deploy server
|
||||
# To use this, make sure the inventory and deploy-server.yml file is properly configured
|
||||
deploy-server: build
|
||||
ansible-playbook -i ./tools/ansible/inventory.ini -l server ./tools/ansible/deploy-server.yml -K
|
||||
|
||||
build: ui linux-amd64 linux-arm64
|
||||
|
||||
ui:
|
||||
|
@ -22,3 +17,13 @@ clean:
|
|||
go clean
|
||||
rm -rfv ./bin
|
||||
rm -rf ./frontend/build
|
||||
|
||||
# Deploying new binary file to server and probers host
|
||||
# The deploy-* command doesn't build the binary file, so you need to run `make build` first.
|
||||
# And make sure the inventory and deploy-*.yml file is properly configured.
|
||||
|
||||
deploy-server:
|
||||
ansible-playbook -i ./tools/ansible/inventory.ini -l server ./tools/ansible/deploy-server.yml -K
|
||||
|
||||
deploy-prober:
|
||||
ansible-playbook -i ./tools/ansible/inventory.ini -l prober ./tools/ansible/deploy-prober.yml -K
|
||||
|
|
35
tools/ansible/deploy-prober.example.yml
Normal file
35
tools/ansible/deploy-prober.example.yml
Normal file
|
@ -0,0 +1,35 @@
|
|||
---
|
||||
- name: Deploy and Restart Prober Timer
|
||||
hosts: all
|
||||
become: true
|
||||
tasks:
|
||||
- name: Stop prober systemd timer
|
||||
systemd:
|
||||
name: xmr-nodes-prober.timer
|
||||
state: stopped
|
||||
when: inventory_hostname in groups['prober']
|
||||
|
||||
- name: Upload binary file (AMD64)
|
||||
copy:
|
||||
src: ../../bin/xmr-nodes-static-linux-amd64
|
||||
dest: /path/to/remote/xmr-nodes/bin
|
||||
owner: your_user
|
||||
group: your_group
|
||||
mode: 0755
|
||||
when: inventory_hostname in groups['prober']
|
||||
|
||||
- name: Upload binary file (ARM64)
|
||||
copy:
|
||||
src: ../../bin/xmr-nodes-static-linux-arm64
|
||||
dest: /path/to/remote/xmr-nodes/bin
|
||||
owner: your_user
|
||||
group: your_group
|
||||
mode: 0755
|
||||
when: inventory_hostname in groups['prober']
|
||||
|
||||
|
||||
- name: Start systemd timer
|
||||
systemd:
|
||||
name: xmr-nodes-prober.timer
|
||||
state: started
|
||||
when: inventory_hostname in groups['prober']
|
Loading…
Reference in a new issue