Skip to content

Commit

Permalink
split into nvidia and amd mining
Browse files Browse the repository at this point in the history
  • Loading branch information
compscidr committed Oct 15, 2021
1 parent e054fac commit 946f258
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 5 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ Everything is made to work via setting two environment variables. The DO_PAT
is the digital ocean API token. The pvt_key is set to the key which should be
rolled out to the deployed resources.

- Ansible (available in apt on Ubuntu >= 20.04)
- Ansible (>=3.2)
- via ppa:ansible/ansible because default ubuntu only has 2.8 or something
- A `/etc/hosts` or `/etc/ansible/hosts` entry which maps the host from the
ansible playbooks to the IP (either locally or public)
- Install the gpg module on ansible machine:
Expand All @@ -37,7 +38,7 @@ ansible playbooks to the IP (either locally or public)
- ssh installed and ssh access via key from deploy machine (ie: authorized keys
contains public key of deploy machine):
```
sudo apt install ssh ssh-import-id
sudo apt install ssh
ssh-import-id gh:compscidr
```
You'll probably want to test it works (and accept the ssh key) - with:
Expand Down
4 changes: 4 additions & 0 deletions ansible/requirements.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# from galaxy
roles:
- name: nickjj.docker
- name: diodonfrost.terraform

# from github
- src: https://github.com/webarchitect609/ansible-role-jet-brains-toolbox

collections:
- name: community.docker
14 changes: 14 additions & 0 deletions ansible/roles/development/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,22 @@
groups: plugdev
append: yes

- name: add ansible GPG
tags: ansible
become: true
apt_key:
keyserver: keyserver.ubuntu.com
id: 6125E2A8C77F2818FB7BD15B93C4A3FD7BB9C367

- name: Add ansible PPA
become: true
tags: ansible
ansible.builtin.apt_repository:
repo: ppa:ansible/ansible

# ansible and terraform
- name: install deploy tools
tags: ansible
become: true
apt:
pkg:
Expand Down
16 changes: 16 additions & 0 deletions ansible/roles/home_server/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
- "/storage/downloads:/downloads:rw"
ports:
- "9117:9117"
links:
flaresolver
env:
TZ: "America/Los_Angeles"
PUID: "1000"
Expand All @@ -69,6 +71,20 @@
restart_policy: unless-stopped
memory: "1g"

- name: FlareSolver
tags: flaresolver
vars:
ansible_python_interpreter: "/usr/bin/env python3-docker"
docker_container:
name: flaresolver
image: ghcr.io/flaresolverr/flaresolverr:latest
pull: true
ports:
- "8191:8191"
env:
CAPTCHA_SOLVER: "hcaptcha-solver"
restart_policy: unless-stopped

- name: Sonarr
tags: sonarr
vars:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
ansible_python_interpreter: "/usr/bin/env python3-docker"
docker_container:
name: lolminer
image: compscidr/lolminer-docker:0.2
image: compscidr/lolminer-docker:amd-1.33
pull: true
restart_policy: unless-stopped
devices:
Expand Down
16 changes: 16 additions & 0 deletions ansible/roles/mining-nvidia/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
- name: lolMiner install
tags: mining
vars:
ansible_python_interpreter: "/usr/bin/env python3-docker"
community.docker.docker_container:
name: lolminer
image: compscidr/lolminer-docker:nvidia-1.33
pull: true
restart_policy: unless-stopped
device_requests:
- driver: nvidia
count: -1
capabilities:
- gpu
env:
MACHINE: "{{inventory_hostname}}"
8 changes: 6 additions & 2 deletions ansible/site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,13 @@
roles:
- internal_lan

- hosts: ubuntu-server, ubuntu-desktop, ubuntu-desktop-beast
- hosts: ubuntu-server, ubuntu-desktop
roles:
- mining
- mining-amd

- hosts: ubuntu-desktop-beast
roles:
- mining-nvidia

- hosts: ubuntu-server, ubuntu-desktop, jason-ubuntu-laptop
roles:
Expand Down

0 comments on commit 946f258

Please sign in to comment.