Update deployment example (CPU arch aware) #3

The ansible playbook is now using ansible_facts to determinate target
server or prober CPU architecture. The final "production" binary name
and changed to just simply "xmr-nodes-{client,server}".
This commit is contained in:
ditatompel 2024-05-18 18:09:36 +07:00
parent 279b142e76
commit 0f7029b939
No known key found for this signature in database
GPG key ID: 31D3D06D77950979
4 changed files with 21 additions and 11 deletions

View file

@ -11,21 +11,21 @@
- name: Upload binary file (AMD64) - name: Upload binary file (AMD64)
copy: copy:
src: ../../bin/xmr-nodes-static-linux-amd64 src: ../../bin/xmr-nodes-client-linux-amd64
dest: /path/to/remote/xmr-nodes/bin dest: /path/to/remote/xmr-nodes/bin/xmr-nodes-client
owner: your_user owner: your_user
group: your_group group: your_group
mode: 0755 mode: 0755
when: inventory_hostname in groups['prober'] when: inventory_hostname in groups['prober'] and ansible_facts['architecture'] == 'x86_64'
- name: Upload binary file (ARM64) - name: Upload binary file (ARM64)
copy: copy:
src: ../../bin/xmr-nodes-static-linux-arm64 src: ../../bin/xmr-nodes-client-linux-arm64
dest: /path/to/remote/xmr-nodes/bin dest: /path/to/remote/xmr-nodes/bin/xmr-nodes-client
owner: your_user owner: your_user
group: your_group group: your_group
mode: 0755 mode: 0755
when: inventory_hostname in groups['prober'] when: inventory_hostname in groups['prober'] and ansible_facts['architecture'] == 'aarch64'
- name: Start systemd timer - name: Start systemd timer

View file

@ -9,13 +9,23 @@
state: stopped state: stopped
when: inventory_hostname in groups['server'] when: inventory_hostname in groups['server']
- name: Upload binary file - name: Upload binary file (AMD64)
copy: copy:
src: ../../bin/xmr-nodes-static-linux-amd64 src: ../../bin/xmr-nodes-server-linux-amd64
dest: /path/to/remote/server/bin dest: /path/to/remote/server/bin/xmr-nodes-server
Owner: your_user Owner: your_user
Group: your_group Group: your_group
mode: 0755 mode: 0755
when: inventory_hostname in groups['server'] and ansible_facts['architecture'] == 'x86_64'
- name: Upload binary file (ARM64)
copy:
src: ../../bin/xmr-nodes-server-linux-arm64
dest: /path/to/remote/server/bin/xmr-nodes-server
Owner: your_user
Group: your_group
mode: 0755
when: inventory_hostname in groups['server'] and ansible_facts['architecture'] == 'aarch64'
- name: Start systemd daemon - name: Start systemd daemon
systemd: systemd:

View file

@ -6,7 +6,7 @@ After=network.target
Type=oneshot Type=oneshot
User=your_user User=your_user
WorkingDirectory=/path/to/project/dir WorkingDirectory=/path/to/project/dir
ExecStart=/path/to/project/dir/bin/xmr-nodes-static-linux-arm64 probe ExecStart=/path/to/project/dir/bin/xmr-nodes-client probe
TimeoutSec=90 TimeoutSec=90
# vim: filetype=systemd # vim: filetype=systemd

View file

@ -10,7 +10,7 @@ Type=simple
User=your_user User=your_user
Restart=always Restart=always
WorkingDirectory=/path/to/project/dir WorkingDirectory=/path/to/project/dir
ExecStart=/path/to/project/dir/bin/xmr-nodes-static-linux-arm64 serve ExecStart=/path/to/project/dir/bin/xmr-nodes-server serve
SyslogIdentifier=xmr-node-server SyslogIdentifier=xmr-node-server
# vim: filetype=systemd # vim: filetype=systemd