Hyperling
107374d93c
* Remove Thunderbird and Audacity. Don't add Geary to new installs but don't remove it in case it comes with the distro. * Remove Thunderbird from Favorites. * Add more systems to Dev branch. * Add sudo so older distros don't ask for password on every app update. * Alias for sync to help save some time typing. * Post less often to hopefully allow keeping up a year of data in less than 16GB. * Allow workstations to use printers without manual intervention. * Section does more than UI work. * Fix file path. * Upgrade nanominer to 3.3.13. * Add more chances for script to automatically restart. * Add the minhashrate for x570. * Up the minimum for x570. * Fix "1: syntax error, unexpected USERGROUP, expecting END or ':' or '\n'" on FreeBSD. * Correct FreeBSD package manager. ``` ansible -m setup localhost | grep ansible_pkg_mgr "ansible_pkg_mgr": "pkgng" ``` * Set vi as EDITOR. * Add FreeBSD to distros that include make. It does not have an install from pkg. * Make on FreeBSD hates dash-to-dock's Makefile. GMake has better luck. * Update supported OS's.
187 lines
5.1 KiB
YAML
187 lines
5.1 KiB
YAML
---
|
|
# Nanominer from nanopool.org
|
|
# Good documentation that might help with how to do variables.
|
|
# https://docs.ansible.com/ansible/latest/user_guide/playbooks_tests.html
|
|
|
|
## Installation ##
|
|
|
|
- name: Miner | Software | Nanominer | Installation | Create Home
|
|
shell: "mkdir -p {{ nanominer_home }}"
|
|
become_user: mfn
|
|
|
|
- name: Miner | Software | Nanominer | Installation | Download Tarball
|
|
shell: "scp {{ file_server }}:{{ nanominer_tar_remote }} {{ nanominer_tar_local }}; chown mfn {{ nanominer_tar_local }}"
|
|
|
|
- name: Miner | Software | Nanominer | Installation | Extract Tarball
|
|
shell: "tar -xvf {{ nanominer_tar_local }}"
|
|
args:
|
|
chdir: "{{ nanominer_home }}"
|
|
become_user: mfn
|
|
|
|
|
|
|
|
## Configuration ##
|
|
|
|
# Delete Old Config #
|
|
|
|
- name: Miner | Software | Nanominer | Configuration | Reset
|
|
shell: "mv {{ nanominer_config }} ~/TRASH/"
|
|
ignore_errors: yes
|
|
|
|
# CPU #
|
|
|
|
- name: Miner | Software | Nanominer | Configuration | CPU | Header Info
|
|
blockinfile:
|
|
path: "{{ nanominer_config }}"
|
|
block: |
|
|
[{{ item.algorithm }}]
|
|
wallet = {{ item.wallet }}
|
|
watchdog = true
|
|
rigName = {{ ansible_hostname }}
|
|
logpath = {{ nanominer_logs }}
|
|
;webPassword = {{ ansible_hostname }}
|
|
webPort = 8080
|
|
useSSL = true
|
|
email = me@hyperling.com
|
|
sortPools = true
|
|
marker: ';{mark} MANAGED BY ANSIBLE - CPU Headers'
|
|
marker_begin: ';;;;;;;;;;;; BEGIN'
|
|
marker_end: ' END'
|
|
state: "{{ item.state }}"
|
|
create: yes
|
|
loop:
|
|
- { "algorithm": "RandomX", "wallet": '{{ wallet_xmr }}', "state": "{{ (nanominer_cpu == 'xmr') | ternary('present', 'absent') }}"}
|
|
become_user: mfn
|
|
when: nanominer_cpu is defined
|
|
|
|
- name: Miner | Software | Nanominer | Configuration | CPU | Add Pools
|
|
lineinfile:
|
|
path: "{{ nanominer_config }}"
|
|
line: "pool{{item.priority}} = {{ item.name }}"
|
|
state: present
|
|
create: no
|
|
loop: "{{ cpu_pool }}"
|
|
become_user: mfn
|
|
when: nanominer_cpu is defined
|
|
|
|
- name: Miner | Software | Nanominer | Configuration | CPU | End Section
|
|
lineinfile:
|
|
path: "{{ nanominer_config }}"
|
|
line: ";;;;;;;;;;;;; END CPU"
|
|
state: present
|
|
create: no
|
|
become_user: mfn
|
|
when: nanominer_cpu is defined
|
|
|
|
# Add Spacing #
|
|
|
|
- name: Miner | Software | Nanominer | Configuration | Spacing
|
|
blockinfile:
|
|
path: "{{ nanominer_config }}"
|
|
block: |
|
|
;
|
|
;
|
|
;
|
|
marker: ';'
|
|
state: present
|
|
create: no
|
|
become_user: mfn
|
|
when: nanominer_config is file
|
|
|
|
# GPU #
|
|
|
|
- name: Miner | Software | Nanominer | Configuration | GPU | Header Info
|
|
blockinfile:
|
|
path: "{{ nanominer_config }}"
|
|
block: |
|
|
[{{ item.algorithm }}]
|
|
wallet = {{ item.wallet }}
|
|
watchdog = true
|
|
rigName = {{ ansible_hostname }}
|
|
logpath = {{ nanominer_logs }}
|
|
;webPassword = {{ ansible_hostname }}
|
|
webPort = 8080
|
|
devices = {{ nanominer_gpus }}
|
|
useSSL = true
|
|
email = me@hyperling.com
|
|
sortPools = true
|
|
memTweak = 0
|
|
minHashrate = {{ eth_minhashrate }}
|
|
restarts = 0
|
|
maxRejectedShares = 1
|
|
marker: ';{mark} MANAGED BY ANSIBLE - GPU Headers'
|
|
marker_begin: ';;;;;;;;;;;; BEGIN'
|
|
marker_end: ' END'
|
|
state: "{{ item.state }}"
|
|
create: yes
|
|
loop:
|
|
- { "algorithm": "Ethash", "wallet": '{{ wallet_eth }}', "state": "{{ (nanominer_gpu == 'eth') | ternary('present', 'absent') }}"}
|
|
become_user: mfn
|
|
when: nanominer_gpu is defined
|
|
|
|
- name: Miner | Software | Nanominer | Configuration | GPU | Add Pools
|
|
lineinfile:
|
|
path: "{{ nanominer_config }}"
|
|
line: "pool{{item.priority}} = {{ item.name }}"
|
|
state: present
|
|
create: no
|
|
loop: "{{ gpu_pool }}"
|
|
become_user: mfn
|
|
when: nanominer_gpu is defined
|
|
|
|
- name: Miner | Software | Nanominer | Configuration | GPU | End Section
|
|
lineinfile:
|
|
path: "{{ nanominer_config }}"
|
|
line: ";;;;;;;;;;;;; END GPU"
|
|
state: present
|
|
create: no
|
|
become_user: mfn
|
|
when: nanominer_gpu is defined
|
|
|
|
|
|
|
|
## Executable ##
|
|
|
|
- name: Miner | Software | Nanominer | Executable | Reset
|
|
shell: "mv {{ nanominer_script }} ~/TRASH/"
|
|
ignore_errors: yes
|
|
|
|
- name: Miner | Software | Nanominer | Executable | Create
|
|
blockinfile:
|
|
path: "{{ nanominer_script }}"
|
|
block: |
|
|
# 2021-02-15 - Automate nanominer script creation.
|
|
|
|
date
|
|
whoami
|
|
pwd
|
|
|
|
{{ check_alive_start }}{{ nanominer_script }}{{ check_alive_end }} {
|
|
time {{ nanominer_exec }} {{ nanominer_config }}
|
|
}
|
|
|
|
marker: '{mark}'
|
|
marker_begin: "#!{{ bash_exec.stdout }} -x"
|
|
marker_end: "exit 0"
|
|
state: present
|
|
create: yes
|
|
become_user: mfn
|
|
|
|
|
|
|
|
## Permissions ##
|
|
|
|
- name: Miner | Software | Nanominer | Permissions
|
|
shell: "chown -R mfn {{ user_mfn.home }}/nanominer*; chmod -R 755 {{ user_mfn.home }}/nanominer*"
|
|
|
|
|
|
|
|
## Reload ##
|
|
|
|
# TODO: Make this a script that always gets called by cron.
|
|
# It should kill the miner if a user logs into an X session, such as if I'm gaming.
|
|
# Then once I log out the job should come back within the minute.
|
|
- name: Miner | Software | Nanominer | Reload
|
|
shell: "killall {{ nanominer_script }}; killall {{ nanominer_exec }}; killall nanominer.sh; killall nanominer"
|
|
become_user: mfn
|
|
ignore_errors: yes |