From 107374d93c5c12cef31bf443c4c7278fa24207be Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 18 Oct 2021 07:13:49 -0500 Subject: [PATCH] General Improvements + FreeBSD Fixes (#15) * 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. --- README.md | 14 +++++++------- facts/general/package.yml | 2 +- facts/miner/system.yml | 2 +- facts/workstation/package.yml | 2 ++ files/sudoers_ansible | 3 ++- files/sudoers_sudo | 3 ++- hosts | 5 ++++- local.yml | 6 +++++- tasks/general/acct_mgmt/users.yml | 2 ++ tasks/miner/software/nanominer.yml | 3 +++ tasks/workstation/settings/gnome.yml | 4 ++-- tasks/workstation/settings/services.yml | 18 ++++++++++++++++++ 12 files changed, 49 insertions(+), 15 deletions(-) create mode 100644 tasks/workstation/settings/services.yml diff --git a/README.md b/README.md index 7b59dbb..5cb1863 100644 --- a/README.md +++ b/README.md @@ -2,20 +2,20 @@ Getting real with system management via ansible-pull. ## Disclaimer -This setup is specific tom the maintainer's devices and needs. You're welcome to use it as an example for your needs, but do not expect it to work as-is. +This setup is specific to the maintainer's devices and needs. You're welcome to use it as an example for your needs, but do not expect it to work as-is. ## Currently Supported Linux Systems ### Debian Family #### Debian -But only if using a recent enough version of Ansible. `pip` likely has a better version than `apt`. +100%, but only if using a recent enough version of Ansible. `pip` usually has a better version than `apt`. #### Ubuntu -100% +100%, both server and desktop. #### Pop!_OS -100% +100%, have not used for a while though. #### Mint -But not really used, just tested once for fun. +100%, but not really used, just tested once for fun. #### Parrot Security OS (MATE) -Still testing, but so far so good! +100% for a while, but OS did not serve maintainer's needs and 404 errors were terrible. Ubuntu Rolling Rhino filled the gap. ### Arch Family #### Manjaro @@ -23,7 +23,7 @@ Still testing, but so far so good! ## Currently Supported Unix Systems ### FreeBSD 12, 13 -100%, although GUI has not been tested on 13 yet. +100%, although GUI is not working completely on 13 yet (dash-to-dock doesn't compile). Software choices are slightly more limited since not `flatpak`-enabled and not feeling a `ports` setup. ## Waiting To Be Tested diff --git a/facts/general/package.yml b/facts/general/package.yml index 6516d48..24a25c9 100644 --- a/facts/general/package.yml +++ b/facts/general/package.yml @@ -59,7 +59,7 @@ echo "*** Pkg ***" && sudo pkg update && sudo pkg upgrade && - when: ansible_pkg_mgr == "pkg" + when: ansible_pkg_mgr in ("pkg", "pkgng") - name: General | Facts | Package | Update Commands | parrot-upgrade set_fact: diff --git a/facts/miner/system.yml b/facts/miner/system.yml index 1d14fb5..519e319 100644 --- a/facts/miner/system.yml +++ b/facts/miner/system.yml @@ -33,7 +33,7 @@ - name: Miner | Facts | System | nanominer 1 set_fact: nanominer_home: "{{ user_mfn.home }}/nanominer" - nanominer_version: "3.3.12" # Download link: https://github.com/nanopool/nanominer/releases + nanominer_version: "3.3.13" # Download link: https://github.com/nanopool/nanominer/releases nanominer_script: "{{ user_mfn.home }}/nanominer.sh" nanominer_tar_remote: "InstallFiles/Miners/nanominer/*.tar.gz" diff --git a/facts/workstation/package.yml b/facts/workstation/package.yml index ec237ed..d838249 100644 --- a/facts/workstation/package.yml +++ b/facts/workstation/package.yml @@ -19,6 +19,7 @@ appimagelauncher: htop #placeholder nfs: nfs-common msgfmt: gettext + make: make - name: Workstation | Facts | Package | Pop_OS! @@ -76,5 +77,6 @@ firefox_esr: firefox-esr psutil: py38-psutil ansible_python_interpreter: "/usr/local/bin/python3.8" + make: gmake # make comes with OS and cannot be installed with pkg. Try using gmake for better luck. when: ansible_system == "FreeBSD" diff --git a/files/sudoers_ansible b/files/sudoers_ansible index 1f118d2..e277426 100644 --- a/files/sudoers_ansible +++ b/files/sudoers_ansible @@ -1 +1,2 @@ -ansible ALL=(ALL) NOPASSWD: ALL \ No newline at end of file + +ansible ALL=(ALL) NOPASSWD: ALL diff --git a/files/sudoers_sudo b/files/sudoers_sudo index f72a4b2..7f90c37 100644 --- a/files/sudoers_sudo +++ b/files/sudoers_sudo @@ -1 +1,2 @@ -%sudo ALL=(ALL) ALL \ No newline at end of file + +%sudo ALL=(ALL) ALL diff --git a/hosts b/hosts index 86676be..12ecfb8 100644 --- a/hosts +++ b/hosts @@ -62,8 +62,11 @@ silicon-power ; nanominer_gpu_pool : Set to pool organization to use for GPU mining ; Valid values: nanopool etherpool f2pool ; +; eth_minhashrate : Set to minimum hashrate over 10 minutes before restarting. Can accept M for Million and K for thousand. +; Example: 100K +; usb-miner amdgpu=true nanominer=true nanominer_gpu=eth nanominer_gpus=0 nanominer_gpu_pool=nanopool -x570 amdgpu=true nanominer=true nanominer_gpu=eth nanominer_gpus=0 nanominer_gpu_pool=nanopool +x570 amdgpu=true nanominer=true nanominer_gpu=eth nanominer_gpus=0 nanominer_gpu_pool=nanopool eth_minhashrate=50M ;x570 amdgpu=true ethminer=true [server] diff --git a/local.yml b/local.yml index e2420ed..5703e37 100644 --- a/local.yml +++ b/local.yml @@ -40,7 +40,7 @@ # Additional setup for systems with GUI. -- name: Main | Workstation UI Setup +- name: Main | Workstation Setup hosts: workstation connection: local become: true @@ -48,6 +48,7 @@ tasks: - include: facts/general/system.yml - include: facts/workstation/package.yml + - include: facts/general/service.yml # Set Up Desktop Environments # - include: tasks/workstation/freebsd/software/gui.yml @@ -84,6 +85,9 @@ when: rdp is defined - include: tasks/workstation/settings/vnc.yml when: vnc is defined + + - include: tasks/workstation/settings/services.yml + ignore_errors: yes diff --git a/tasks/general/acct_mgmt/users.yml b/tasks/general/acct_mgmt/users.yml index 9924fa8..3d885c1 100644 --- a/tasks/general/acct_mgmt/users.yml +++ b/tasks/general/acct_mgmt/users.yml @@ -144,6 +144,7 @@ return 1 } sync: alias sync='date && echo "Syncing!" && sync && date' + editor: export EDITOR='vi' - name: General | Account Management | Users | Files | Common Variable set_fact: @@ -159,6 +160,7 @@ {{ remount }} {{ update }} {{ sync }} + {{ editor }} - name: General | Account Management | Users | Files | .bashrc blockinfile: diff --git a/tasks/miner/software/nanominer.yml b/tasks/miner/software/nanominer.yml index 45c4a25..b29855f 100644 --- a/tasks/miner/software/nanominer.yml +++ b/tasks/miner/software/nanominer.yml @@ -106,6 +106,9 @@ 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' diff --git a/tasks/workstation/settings/gnome.yml b/tasks/workstation/settings/gnome.yml index 0ca1de3..5dbbf7e 100644 --- a/tasks/workstation/settings/gnome.yml +++ b/tasks/workstation/settings/gnome.yml @@ -52,13 +52,13 @@ - name: Workstation | Account Management | GNOME | Dash To Dock | Install | Dependencies package: name: - - make + - "{{ make }}" - "{{ msgfmt }}" state: present when: ansible_distribution not in ("Ubuntu") and dash_to_dock_exists.failed - name: Workstation | Account Management | GNOME | Dash To Dock | Install | Make - shell: "cd ~/TRASH/dash-to-dock/; make; make install" + shell: "cd ~/TRASH/dash-to-dock/; {{ make }}; {{ make }} install" become_user: ling when: ansible_distribution not in ("Ubuntu") and dash_to_dock_exists.failed diff --git a/tasks/workstation/settings/services.yml b/tasks/workstation/settings/services.yml new file mode 100644 index 0000000..37be15b --- /dev/null +++ b/tasks/workstation/settings/services.yml @@ -0,0 +1,18 @@ +--- +# Enable and disable services. + +## CUPS ## + +- name: General | Software | Services | Disable CUPS Daemon + service: + name: "{{ cups }}" + pattern: "{{ cups_pattern }}" + state: started + enabled: yes + +- name: General | Software | Services | Disable CUPS-Browse Daemon + service: + name: "{{ cups_browse }}" + pattern: "{{ cups_browse_pattern }}" + state: started + enabled: yes