mirror of
https://github.com/ditatompel/xmr-remote-nodes.git
synced 2024-12-22 11:39:23 +00:00
Adding ansible example deploy server
This commit is contained in:
parent
e7164ae0c1
commit
0804c4f055
3 changed files with 32 additions and 1 deletions
7
Makefile
7
Makefile
|
@ -1,7 +1,12 @@
|
|||
.PHONY: ui build linux-amd64 linux-arm64
|
||||
.PHONY: 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:
|
||||
|
|
21
tools/ansible/deploy-server.example.yml
Normal file
21
tools/ansible/deploy-server.example.yml
Normal file
|
@ -0,0 +1,21 @@
|
|||
---
|
||||
- name: Deploy and Restart Services
|
||||
hosts: all
|
||||
become: true
|
||||
tasks:
|
||||
- name: Stop server systemd daemon
|
||||
systemd:
|
||||
name: xmr-nodes-server.service
|
||||
state: stopped
|
||||
when: inventory_hostname in groups['server']
|
||||
|
||||
- name: Upload binary file
|
||||
copy:
|
||||
src: ../../bin/xmr-nodes-static-linux-amd64
|
||||
dest: /path/to/remote/server/bin
|
||||
|
||||
- name: Start systemd daemon
|
||||
systemd:
|
||||
name: xmr-nodes-server.service
|
||||
state: started
|
||||
when: inventory_hostname in groups['server']
|
5
tools/ansible/inventory.example.ini
Normal file
5
tools/ansible/inventory.example.ini
Normal file
|
@ -0,0 +1,5 @@
|
|||
[server]
|
||||
xmr-node-server ansible_host=192.168.0.2 ansible_user=xmr-nodes ansible_ssh_private_key_file=/path/to/ssh/private_key
|
||||
|
||||
[prober]
|
||||
prober-1 ansible_host=192.168.0.3 ansible_user=xmr-nodes
|
Loading…
Reference in a new issue