Beginning to put together tasks for ETH mining.

This commit is contained in:
Hyperling 2021-02-11 08:05:34 -06:00
parent b318d6a6a6
commit 2a6edcb788
6 changed files with 111 additions and 2 deletions

View File

@ -63,6 +63,33 @@
- include: tasks/workstation/settings/gnome.yml
# Additional setup for miners!
- name: Main | Workstation UI Setup
hosts: miner
connection: local
become: true
pre_tasks:
- include: tasks/miner/acct_mgmt/mfn.yml
tasks:
# Monero
- include: tasks/miner/cpu/xmr.yml
become_user: mfn
when: mine.xmr is defined
# Ethereum
- include: tasks/miner/driver/amdgpu.yml
when: ansible_distribution == "Ubuntu" and mine.eth is defined
- include: tasks/miner/gpu/eth/ethminer.yml
become_user: mfn
when: ansible_distribution == "Ubuntu" and mine.eth is defined
post_tasks:
- include: tasks/miner/cron/ansible.yml
# Create reports to analyze security.
- name: Main | Hardness Tests
hosts: localhost

View File

@ -0,0 +1,8 @@
---
# Account to do mining tasks.
- name: Miner | Account Management | User | Miner Forty Niner
user:
name: mfn
comment: Miner Forty Niner
system: yes

View File

@ -0,0 +1,11 @@
---
# Jobs for miners.
- name: Cron | XMR
shell: ""
when: mine.xmr is defined
#- name: Cron | ETH
# cron:
# name: Mine Ethereum
# when: mine.eth is defined

View File

@ -0,0 +1,17 @@
---
# Install OpenCL drivers.
- name: Folder
shell: 'mkdir -p Downloads'
- name: Download
shell: 'scp ling@leet:InstallFiles/Drivers/amdgpu-pro-20.45-1188099-ubuntu-20.04.tar.xz Downloads/'
- name: Extract
shell: 'cd Downloads; tar -xvf amdgpu-pro-20.45-1188099-ubuntu-20.04.tar.xz'
- name: Install 1 - All
shell: 'cd Downloads/amdgpu-pro-20.45-1188099-ubuntu-20.04; amdgpu-install -y'
- name: Install 2 - Pro
shell: 'cd Downloads/amdgpu-pro-20.45-1188099-ubuntu-20.04; amdgpu-pro-install -y --opencl=pal,legacy'

View File

@ -1,2 +0,0 @@
---
# Mine Ethereum with GPU!

View File

@ -0,0 +1,48 @@
---
# Mine Ethereum with GPU!
- name: Install Dependencies
package:
name: build-essential dkms cmake perl libdbus-1-dev mesa-common-dev
state: present
become: true
- name: Add PPA
shell: 'add-apt-repository ppa:ethereum/ethereum; apt update'
become: true
- name: Install Ethereum
package:
name: ethereum
state: present
become: true
- name: Clone Git Repo
shell: 'git clone https://github.com/ethereum-mining/ethminer.git'
- name: Update Repo's Repos
shell: 'cd ethminer; git submodule update --init --recursive'
- name: Create Build Folder
shell: 'cd ethminer; mkdir -p build'
- name: cmake Flags
shell: 'cd ethminer/build; cmake .. -DETHASHCL=ON -DETHASHCUDA=OFF -DAPICORE=ON -DBINKERN=ON -DETHDBUS=ON -DUSE_SYS_OPENCL=ON -ETHASHCPU=ON -DEVBUILD=ON'
- name: cmake Build
shell: 'cd ethminer/build; cmake --build .'
- name: cmake Build
shell: 'cd /home/mfn/ethminer/build; make install'
become: true
- name: Download Script
shell: 'scp ling@leet:InstallFiles/Miners/ETH/ethminer.sh /home/mfn/; chmod 755 /home/mfn/ethminer.sh'
become: true
- name: Kill Current Jobs
shell: 'killall ethminer.sh'
become: true
- name: Start Mining
shell: 'time ethminer.sh'