General Improvements + Miner Deprecation (#23)

* Add volume key controls.

* Add placeholder for LBRY app.

* Refactor gui into gnome and packages. Remove deprecated lineinfiles. Enhance package management.

* Variablize tar to fix FreeBSD.

* Variablize tar to fix FreeBSD.

* Take FreeBSD gui.yml refactor into account.

* Unfinished changes to use self-signed cert so local traffic can hit https. Server starts fine, but getting "gnutls_handshake() failed: An unexpected TLS packet was received." on client's `git clone`.

* Make D2D optional. FreeBSD is still having a hard time compiling it.

* Use a block for Dash To Dock so only one ignore_errors is necessary.

* Deprecate miner section since machines have been decommissioned.

* Remove deprecated file.

* Switch to lightdm on FreeBSD.

* Automate GPU driver installation.

* Updated DWM config and added TODO's.

* Move lynis to src folder for cleanliness.

* Remove debug.

* Refactor for "shared" system type folder.

* Fix FreeBSD gpu.yml location.

* Add a default hosts file to hide warnings.
This commit is contained in:
2022-01-10 13:41:54 +00:00
committed by GitHub
parent b26d94d911
commit 791dc245a6
21 changed files with 468 additions and 468 deletions

View File

@ -88,6 +88,9 @@
; vnc : Set to true for installation of VNC protocol
; UNFINISHED/UNTESTED
;
; bsd_gpu : Set to [] to install GPU driver
; Example: amdgpu
;
[global]
marker: '; {mark} MANAGED BY ANSIBLE | Workstation Config'
state: present
@ -102,6 +105,7 @@
gaming: "{{ lookup('ini', 'gaming file={{wrk_file}} default=false') }}"
rdp: "{{ lookup('ini', 'rdp file={{wrk_file}} default=false') }}"
vnc: "{{ lookup('ini', 'vnc file={{wrk_file}} default=false') }}"
bsd_gpu: "{{ lookup('ini', 'bsd_gpu file={{wrk_file}} default=false') }}"
- name: General | Account Management | Provisioning Configuration | Workstation | List
set_fact:
@ -113,86 +117,87 @@
- { 'gaming': "{{ gaming }}" }
- { 'rdp': "{{ rdp }}" }
- { 'vnc': "{{ vnc }}" }
- { 'bsd_gpu': "{{ bsd_gpu }}" }
## Miner ##
- name: General | Account Management | Provisioning Configuration | Miner | Create
blockinfile:
path: "{{ mnr_file }}"
block: |
;;;;;;; Available options - all require lowercase values ;;;;;;
;
; enable : Set to true for system to be considered a miner.
;
; amdgpu : Set to true for installation of AMDGPU-Pro drivers on Ubuntu (20.04 preferred)
;
; nanominer : Set to true for installation of nanominer
;
; nanominer_cpu : Set to coin code that you'd like the CPU to work on
; Valid values: xmr
;
; nanominer_cpu_pool : Set to pool organization to use for CPU mining
; Valid values: nanopool
;
; nanominer_gpu : Set to coin code that you'd like the GPU to work on
; Valid values: eth
;
; nanominer_gpus : Set to comma list of GPU devices that should be used for nanominer
; Example: 0,2,3
;
; 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
;
; ethminer : Set to true for installation of ethminer
; UNFINISHED/UNTESTED
;
; nvidia : Set to true for NVidia support in ethminer.
; UNFINISHED/UNTESTED
;
; xmr_stak_cpu : Set to true for istallation
; UNFINISHED/UNTESTED
;
[global]
marker: '; {mark} MANAGED BY ANSIBLE | Miner Config'
state: present
create: yes
backup: yes
- name: General | Account Management | Provisioning Configuration | Miner | Load
set_fact:
miner: "{{ lookup('ini', 'enable file={{mnr_file}} default=false') }}"
amdgpu: "{{ lookup('ini', 'amdgpu file={{mnr_file}} default=false') }}"
nanominer: "{{ lookup('ini', 'nanominer file={{mnr_file}} default=false') }}"
nanominer_cpu: "{{ lookup('ini', 'nanominer_cpu file={{mnr_file}} default=false') }}"
nanominer_cpu_pool: "{{ lookup('ini', 'nanominer_cpu_pool file={{mnr_file}} default=false') }}"
nanominer_gpu: "{{ lookup('ini', 'nanominer_gpu file={{mnr_file}} default=false') }}"
nanominer_gpus: "{{ lookup('ini', 'nanominer_gpus file={{mnr_file}} default=false') }}"
nanominer_gpu_pool: "{{ lookup('ini', 'nanominer_gpu_pool file={{mnr_file}} default=false') }}"
eth_minhashrate: "{{ lookup('ini', 'eth_minhashrate file={{mnr_file}} default=false') }}"
ethminer: "{{ lookup('ini', 'ethminer file={{mnr_file}} default=false') }}"
nvidia: "{{ lookup('ini', 'nvidia file={{mnr_file}} default=false') }}"
xmr_stak_cpu: "{{ lookup('ini', 'xmr_stak_cpu file={{mnr_file}} default=false') }}"
- name: General | Account Management | Provisioning Configuration | Miner | List
set_fact:
provision_variables: "{{ provision_variables | combine(item) }}"
loop:
- { 'miner': "{{ miner }}" }
- { 'amdgpu': "{{ amdgpu }}" }
- { 'nanominer': "{{ nanominer }}" }
- { 'nanominer_cpu': "{{ nanominer_cpu }}" }
- { 'nanominer_cpu_pool': "{{ nanominer_cpu_pool }}" }
- { 'nanominer_gpu': "{{ nanominer_gpu }}" }
- { 'nanominer_gpus': "{{ nanominer_gpus }}" }
- { 'nanominer_gpu_pool': "{{ nanominer_gpu_pool }}" }
- { 'eth_minhashrate': "{{ eth_minhashrate }}" }
- { 'ethminer': "{{ ethminer }}" }
- { 'nvidia': "{{ nvidia }}" }
- { 'xmr_stak_cpu': "{{ xmr_stak_cpu }}" }
# No longer mining, this is now considered deprecated.
### Miner ##
#
#- name: General | Account Management | Provisioning Configuration | Miner | Create
# blockinfile:
# path: "{{ mnr_file }}"
# block: |
# ;;;;;;; Available options - all require lowercase values ;;;;;;
# ;
# ; enable : Set to true for system to be considered a miner.
# ;
# ; amdgpu : Set to true for installation of AMDGPU-Pro drivers on Ubuntu (20.04 preferred)
# ;
# ; nanominer : Set to true for installation of nanominer
# ;
# ; nanominer_cpu : Set to coin code that you'd like the CPU to work on
# ; Valid values: xmr
# ;
# ; nanominer_cpu_pool : Set to pool organization to use for CPU mining
# ; Valid values: nanopool
# ;
# ; nanominer_gpu : Set to coin code that you'd like the GPU to work on
# ; Valid values: eth
# ;
# ; nanominer_gpus : Set to comma list of GPU devices that should be used for nanominer
# ; Example: 0,2,3
# ;
# ; 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
# ;
# ; ethminer : Set to true for installation of ethminer
# ; UNFINISHED/UNTESTED
# ;
# ; nvidia : Set to true for NVidia support in ethminer.
# ; UNFINISHED/UNTESTED
# ;
# ; xmr_stak_cpu : Set to true for istallation
# ; UNFINISHED/UNTESTED
# ;
# [global]
# marker: '; {mark} MANAGED BY ANSIBLE | Miner Config'
# state: present
# create: yes
# backup: yes
#
#- name: General | Account Management | Provisioning Configuration | Miner | Load
# set_fact:
# miner: "{{ lookup('ini', 'enable file={{mnr_file}} default=false') }}"
# amdgpu: "{{ lookup('ini', 'amdgpu file={{mnr_file}} default=false') }}"
# nanominer: "{{ lookup('ini', 'nanominer file={{mnr_file}} default=false') }}"
# nanominer_cpu: "{{ lookup('ini', 'nanominer_cpu file={{mnr_file}} default=false') }}"
# nanominer_cpu_pool: "{{ lookup('ini', 'nanominer_cpu_pool file={{mnr_file}} default=false') }}"
# nanominer_gpu: "{{ lookup('ini', 'nanominer_gpu file={{mnr_file}} default=false') }}"
# nanominer_gpus: "{{ lookup('ini', 'nanominer_gpus file={{mnr_file}} default=false') }}"
# nanominer_gpu_pool: "{{ lookup('ini', 'nanominer_gpu_pool file={{mnr_file}} default=false') }}"
# eth_minhashrate: "{{ lookup('ini', 'eth_minhashrate file={{mnr_file}} default=false') }}"
# ethminer: "{{ lookup('ini', 'ethminer file={{mnr_file}} default=false') }}"
# nvidia: "{{ lookup('ini', 'nvidia file={{mnr_file}} default=false') }}"
# xmr_stak_cpu: "{{ lookup('ini', 'xmr_stak_cpu file={{mnr_file}} default=false') }}"
#
#- name: General | Account Management | Provisioning Configuration | Miner | List
# set_fact:
# provision_variables: "{{ provision_variables | combine(item) }}"
# loop:
# - { 'miner': "{{ miner }}" }
# - { 'amdgpu': "{{ amdgpu }}" }
# - { 'nanominer': "{{ nanominer }}" }
# - { 'nanominer_cpu': "{{ nanominer_cpu }}" }
# - { 'nanominer_cpu_pool': "{{ nanominer_cpu_pool }}" }
# - { 'nanominer_gpu': "{{ nanominer_gpu }}" }
# - { 'nanominer_gpus': "{{ nanominer_gpus }}" }
# - { 'nanominer_gpu_pool': "{{ nanominer_gpu_pool }}" }
# - { 'eth_minhashrate': "{{ eth_minhashrate }}" }
# - { 'ethminer': "{{ ethminer }}" }
# - { 'nvidia': "{{ nvidia }}" }
# - { 'xmr_stak_cpu': "{{ xmr_stak_cpu }}" }
## Server ##

View File

@ -2,11 +2,6 @@
# Tasks related to finishing ansible-pull
# EG: End timer, start conflicting jobs, etc
- name: General | Finish | Ansible Pull Report | Debug
debug:
var: leet_drive_details
when: leet_drive_details is defined
- name: General | Finish | Ansible Pull Report | Finish File
shell: "echo 'FINISH' >> {{ ansible_pull_report }}"
when: leet_drive_details.stat.exists

View File

@ -48,7 +48,7 @@
- "{{ locate }}"
- zsh
- "{{ opensshd }}"
- tar
- "{{ tar }}"
state: present
- name: General | Software | Services | Install CROND (Looking at you, Fedora)

View File

@ -4,7 +4,7 @@
## Variables ##
- name: Server | Software | Git | Check Config Variables
- name: Server | Software | HTTPS Git Server | Check Config Variables
debug:
var: "{{ item }}"
loop:
@ -13,14 +13,14 @@
- git_url
- git_sep
- name: Server | Software | Git | Split Config Variables To Array
- name: Server | Software | HTTPS Git Server | Split Config Variables To Array
set_fact:
git_names: "{{ git_name.split(git_sep) }}"
git_branches: "{{ git_branch.split(git_sep) }}"
git_urls: "{{ git_url.split(git_sep) }}"
git_projects: []
- name: Server | Software | Git | Check Arrays
- name: Server | Software | HTTPS Git Server | Check Arrays
debug:
var: "{{ item }}"
loop:
@ -28,29 +28,34 @@
- git_branches
- git_urls
- name: Server | Software | Git | Build Dictionary
- name: Server | Software | HTTPS Git Server | Build Dictionary
set_fact:
git_projects: "{{ git_projects + [{ 'name': git_names[item], 'branch': git_branches[item], 'url': git_urls[item] }] }}"
loop: "{{ range(0, git_names|length) | list }}"
- name: Server | Software | Git | Display Dictionary
- name: Server | Software | HTTPS Git Server | Display Dictionary
debug:
var: git_projects
- name: Server | Software | Git | Variables 1
- name: Server | Software | HTTPS Git Server | Variables 1
set_fact:
git_web_root: /var/www/html/git
git_config_file: /etc/nginx/conf.d/git.conf
git_nginx_user: www-data
git_ssl_dir: /usr/local/etc/ssl/private
git_ssl_cert_name: cert.pem
git_ssl_key_name: key.pem
- name: Server | Software | Git | Variables 2
- name: Server | Software | HTTPS Git Server | Variables 2
set_fact:
git_cron_commands: "git pull --rebase && cd {{ git_web_root }}/ && chown -R {{ git_nginx_user }} . && chmod -R 775 ."
git_ssl_cert: "{{ git_ssl_dir }}/{{ git_ssl_cert_name }}"
git_ssl_key: "{{ git_ssl_dir }}/{{ git_ssl_key_name }}"
## Pre-reqs ##
- name: Server | Software | Git | Install
- name: Server | Software | HTTPS Git Server | Install
package:
name:
- nginx
@ -60,26 +65,32 @@
- unzip
state: present
when: ansible_pkg_mgr == "apt"
- name: Server | Software | HTTPS Git Server | SSL Certificate
shell: "{{ item }}"
loop:
- mkdir -p {{ git_ssl_dir }}
- openssl req -newkey rsa:2048 -new -nodes -x509 -days 3650 -keyout {{ git_ssl_key }} -out {{ git_ssl_cert }} -subj "/C=XX/ST=STATELESS/L=HOMELAB/O={{ domain }}/OU=Git Server/CN={{ domain }}"
## Repositories ##
- name: Server | Software | Git | Delete
- name: Server | Software | HTTPS Git Server | Delete
file:
path: "{{ git_web_root }}"
state: absent
- name: Server | Software | Git | Download
- name: Server | Software | HTTPS Git Server | Download
git:
repo: "{{ item.url }}"
dest: "{{ git_web_root }}/{{ item.name }}.git"
version: "{{ item.branch }}"
clone: yes
force: yes
#ignore_errors: yes
ignore_errors: yes
loop: "{{ git_projects }}"
- name: Server | Software | Git | Permissions
- name: Server | Software | HTTPS Git Server | Permissions
file:
path: "{{ git_web_root }}/{{ item.name }}.git"
state: directory
@ -92,7 +103,7 @@
## NGINX ##
- name: Server | Software | Git | Index
- name: Server | Software | HTTPS Git Server | Index
blockinfile:
path: "{{ git_web_root }}/index.html"
block: |
@ -106,12 +117,16 @@
marker: "<!-- {mark} {{ item.name }} -->"
loop: "{{ git_projects }}"
- name: Server | Software | Git | Config
- name: Server | Software | HTTPS Git Server | Config
blockinfile:
path: "{{ git_config_file }}"
block: |
server {
listen 80;
listen 443;
server_name {{ ansible_hostname }}.{{ domain }};
ssl_certificate {{ git_ssl_cert }};
ssl_certificate_key {{ git_ssl_key }};
root {{ git_web_root }};
@ -119,8 +134,6 @@
index index.html;
#autoindex on;
server_name {{ ansible_hostname }}.{{ domain }};
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
@ -146,7 +159,7 @@
backup: yes
marker: "# {mark} Managed By Ansible Git Server Playbook -->"
- name: Server | Software | Git | Service
- name: Server | Software | HTTPS Git Server | Service
service:
name: nginx
pattern: nginx
@ -156,14 +169,14 @@
## Cron ##
- name: Server | Software | Git | Cron | Hourly
- name: Server | Software | HTTPS Git Server | Cron | Hourly
ansible.builtin.cron:
name: "{{ item.name }} hourly"
special_time: hourly
job: "cd {{ git_web_root }}/{{ item.name }}.git && {{ git_cron_commands }}"
loop: "{{ git_projects }}"
- name: Server | Software | Git | Cron | Reboot
- name: Server | Software | HTTPS Git Server | Cron | Reboot
ansible.builtin.cron:
name: "{{ item.name }} reboot"
special_time: reboot

View File

@ -0,0 +1,43 @@
---
# Provide FreeBSD with a DE.
- name: Workstation | FreeBSD | Software | GUI | Install UI Components
package:
name:
- xorg
- gnome3-lite
- "{{ firefox_esr }}"
- "{{ evolution }}"
- vscode
- gimp
- telegram-desktop
- lightdm
- lightdm-gtk-greeter
state: present
- name: Workstation | FreeBSD | Software | GUI | Create rc.conf Entries
blockinfile:
path: "{{ rc_conf }}"
marker: "# {mark} MANAGED BY ANSIBLE | GNOME Components"
block: |
dbus_enable="YES"
hald_enable="YES"
gnome_enable="YES"
#gdm_enable="YES"
lightdm_enable="YES"
create: yes
backup: yes
- name: Workstation | FreeBSD | Software | GUI | Create fstab Entries
blockinfile:
path: /etc/fstab
block: |
proc /proc procfs rw 0 0
marker: '# {mark} MANAGED BY ANSIBLE | GNOME Components'
state: present
backup: yes
- name: Workstation | FreeBSD | Software | GUI | Mount All
shell: mount -a
args:
warn: false

View File

@ -0,0 +1,17 @@
---
# Provide FreeBSD with GPU driver.
- name: Workstation | FreeBSD | Software | GPU Driver | Install
package:
name:
- drm-kmod
state: present
- name: Workstation | FreeBSD | Software | GPU Driver | Create rc.conf Entries
blockinfile:
path: "{{ rc_conf }}"
marker: "# {mark} MANAGED BY ANSIBLE | GPU Components"
block: |
kld_list="{{ freebsd_gpu }}"
create: yes
backup: yes

View File

@ -1,63 +0,0 @@
---
# Provide FreeBSD with a DE.
- name: Workstation | FreeBSD | GUI | Install UI Components
package:
name:
- xorg
- gnome3-lite
- "{{ firefox_esr }}"
- "{{ evolution }}"
- vscode
- gimp
- telegram-desktop
state: present
- name: Workstation | FreeBSD | GUI | Uninstall Bloat
package:
name:
- "{{ firefox }}"
- "{{ thunderbird }}"
state: absent
- name: Workstation | FreeBSD | GUI | Create rc.conf Entries
blockinfile:
path: "{{ rc_conf }}"
marker: "# {mark} MANAGED BY ANSIBLE | GUI Components"
block: |
dbus_enable="YES"
hald_enable="YES"
gnome_enable="YES"
gdm_enable="YES"
create: yes
backup: yes
- name: Workstation | FreeBSD | GUI | Create proc fstab Entry
lineinfile:
path: /etc/fstab
regexp: '^proc'
line: proc /proc procfs rw 0 0
state: absent
backup: yes
- name: Workstation | FreeBSD | GUI | Create proc fstab Comment
lineinfile:
path: /etc/fstab
regexp: '^# MANAGED BY ANSIBLE | Leet Share'
line: '# MANAGED BY ANSIBLE | Leet Share'
state: absent
insertbefore: '^proc'
- name: Workstation | FreeBSD | GUI | Create fstab Entries
blockinfile:
path: /etc/fstab
block: |
proc /proc procfs rw 0 0
marker: '# {mark} MANAGED BY ANSIBLE | GUI Components'
state: present
backup: yes
- name: Workstation | FreeBSD | GUI | Mount All
shell: mount -a
args:
warn: false

View File

@ -0,0 +1,4 @@
---
# Install LBRY desktop client.
# TODO: https://github.com/lbryio/lbry-desktop#install

View File

@ -0,0 +1,74 @@
---
# Packages for FreeBSD workstation.
# General #
- name: Workstation | FreeBSD | Software | Packages | General | Install
package:
name:
- "{{ firefox_esr }}"
- "{{ evolution }}"
- telegram-desktop
- libreoffice
state: present
- name: Workstation | FreeBSD | Software | Packages | General | Uninstall Bloat
package:
name:
- "{{ firefox }}"
- "{{ thunderbird }}"
state: absent
# Coding #
- name: Workstation | FreeBSD | Software | Packages | Coding | Install
package:
name:
- vscode
state: present
when: coding == true
- name: Workstation | FreeBSD | Software | Packages | Coding | Install
package:
name:
- vscode
state: absent
when: not coding == true
# Media Editors #
- name: Workstation | FreeBSD | Software | Packages | Editing | Install
package:
name:
- gimp
- shotcut
- obs-studio
state: present
when: editing == true
- name: Workstation | FreeBSD | Software | Packages | Editing | Install
package:
name:
- gimp
- shotcut
- obs-studio
state: absent
when: not editing == true
# Gaming #
- name: Workstation | FreeBSD | Software | Packages | Gaming | Install
package:
name:
- 0ad
- supertuxkart
state: present
when: gaming == true
- name: Workstation | FreeBSD | Software | Packages | Gaming | Install
package:
name:
- 0ad
- supertuxkart
state: absent
when: not gaming == true

View File

@ -40,126 +40,130 @@
## Dash to Dock Extension ##
# Note: Validate DtD by checking /org/gnome/shell/enabled-extensions for dash-to-dock@micxgx.gmail.com
- name: Workstation | Account Management | GNOME | Dash To Dock | Check
shell: "cd ~/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/"
become_user: "{{ user }}"
register: dash_to_dock_exists
- name: Workstation | Account Management | GNOME | Dash To Dock
block:
- name: Workstation | Account Management | GNOME | Dash To Dock | Check
shell: "cd ~/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/"
become_user: "{{ user }}"
register: dash_to_dock_exists
# Install #
# https://micheleg.github.io/dash-to-dock/download.html
- name: Workstation | Account Management | GNOME | Dash To Dock | Install | Clone Repo
git:
repo: https://github.com/micheleg/dash-to-dock.git
dest: "~/TRASH/dash-to-dock/"
clone: yes
force: no
version: master
become_user: "{{ user }}"
when: ansible_distribution not in ("Ubuntu") and dash_to_dock_exists.failed
- name: Workstation | Account Management | GNOME | Dash To Dock | Install | Dependencies
package:
name:
- "{{ make }}"
- "{{ msgfmt }}"
- "{{ sassc }}"
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"
become_user: "{{ user }}"
when: ansible_distribution not in ("Ubuntu") and dash_to_dock_exists.failed
- name: Workstation | Account Management | GNOME | Dash To Dock | Read Enabled Extension Array
dconf:
key: /org/gnome/shell/enabled-extensions
state: read
become_user: "{{ user }}"
register: gnome_enabled_extensions
when: ansible_distribution not in ("Ubuntu") and dash_to_dock_exists.failed
- name: Workstation | Account Management | GNOME | Dash To Dock | dconf Return Object
debug:
var: gnome_enabled_extensions
when: ansible_distribution not in ("Ubuntu") and dash_to_dock_exists.failed
# https://ansible-docs.readthedocs.io/zh/stable-2.0/rst/playbooks_filters.html#filters-for-formatting-data
- name: Workstation | Account Management | GNOME | Dash To Dock | Variables 1
set_fact:
gnome_enabled_extensions: "{{ gnome_enabled_extensions.value | replace('@as ', '') }}"
dash_to_dock_ext_comma: ""
when: ansible_distribution not in ("Ubuntu") and dash_to_dock_exists.failed
- name: Workstation | Account Management | GNOME | Dash To Dock | After replace()
debug:
var: gnome_enabled_extensions
when: ansible_distribution not in ("Ubuntu") and dash_to_dock_exists.failed
- name: Workstation | Account Management | GNOME | Dash To Dock | Variables 2
set_fact:
dash_to_dock_ext_comma: ", "
when: ansible_distribution not in ("Ubuntu") and dash_to_dock_exists.failed and gnome_enabled_extensions not in ("[]", [], "None")
- name: Workstation | Account Management | GNOME | Dash To Dock | Variables 3
set_fact:
dash_to_dock_ext_name: "{{ dash_to_dock_ext_comma }}'dash-to-dock@micxgx.gmail.com']"
when: ansible_distribution not in ("Ubuntu") and dash_to_dock_exists.failed
- name: Workstation | Account Management | GNOME | Dash To Dock | Variables 4
set_fact:
gnome_enabled_extensions: "[]"
when: ansible_distribution not in ("Ubuntu") and dash_to_dock_exists.failed and gnome_enabled_extensions == "None"
- name: Workstation | Account Management | GNOME | Dash To Dock | Print Value To Append With
debug:
var: dash_to_dock_ext_name
when: ansible_distribution not in ("Ubuntu") and dash_to_dock_exists.failed
- name: Workstation | Account Management | GNOME | Dash To Dock | Print Value To Append To
debug:
var: gnome_enabled_extensions
when: ansible_distribution not in ("Ubuntu") and dash_to_dock_exists.failed
- name: Workstation | Account Management | GNOME | Dash To Dock | Print Combined Value
debug:
msg: "{{ gnome_enabled_extensions | replace(']', dash_to_dock_ext_name) }}"
when: ansible_distribution not in ("Ubuntu") and dash_to_dock_exists.failed
- name: Workstation | Account Management | GNOME | Dash To Dock | Enable
dconf:
key: /org/gnome/shell/enabled-extensions
value: "{{ gnome_enabled_extensions | replace(']', dash_to_dock_ext_name) }}"
state: present
become_user: "{{ user }}"
when: ansible_distribution not in ("Ubuntu") and dash_to_dock_exists.failed
# Settings #
- name: Workstation | Account Management | GNOME | Dash To Dock | Dock Position
dconf:
key: /org/gnome/shell/extensions/dash-to-dock/dock-position
value: "'LEFT'"
state: present
become_user: "{{ user }}"
- name: Workstation | Account Management | GNOME | Dash To Dock | Dock Fixed
dconf:
key: /org/gnome/shell/extensions/dash-to-dock/dock-fixed
value: "true"
state: present
become_user: "{{ user }}"
- name: Workstation | Account Management | GNOME | Dash To Dock | Icon Size
dconf:
key: /org/gnome/shell/extensions/dash-to-dock/dash-max-icon-size
value: "32"
state: present
become_user: "{{ user }}"
ignore_errors: yes
# Install #
# https://micheleg.github.io/dash-to-dock/download.html
- name: Workstation | Account Management | GNOME | Dash To Dock | Install | Clone Repo
git:
repo: https://github.com/micheleg/dash-to-dock.git
dest: "~/TRASH/dash-to-dock/"
clone: yes
force: no
version: master
become_user: "{{ user }}"
when: ansible_distribution not in ("Ubuntu") and dash_to_dock_exists.failed
- name: Workstation | Account Management | GNOME | Dash To Dock | Install | Dependencies
package:
name:
- "{{ make }}"
- "{{ msgfmt }}"
- "{{ sassc }}"
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"
become_user: "{{ user }}"
when: ansible_distribution not in ("Ubuntu") and dash_to_dock_exists.failed
- name: Workstation | Account Management | GNOME | Dash To Dock | Read Enabled Extension Array
dconf:
key: /org/gnome/shell/enabled-extensions
state: read
become_user: "{{ user }}"
register: gnome_enabled_extensions
when: ansible_distribution not in ("Ubuntu") and dash_to_dock_exists.failed
- name: Workstation | Account Management | GNOME | Dash To Dock | dconf Return Object
debug:
var: gnome_enabled_extensions
when: ansible_distribution not in ("Ubuntu") and dash_to_dock_exists.failed
# https://ansible-docs.readthedocs.io/zh/stable-2.0/rst/playbooks_filters.html#filters-for-formatting-data
- name: Workstation | Account Management | GNOME | Dash To Dock | Variables 1
set_fact:
gnome_enabled_extensions: "{{ gnome_enabled_extensions.value | replace('@as ', '') }}"
dash_to_dock_ext_comma: ""
when: ansible_distribution not in ("Ubuntu") and dash_to_dock_exists.failed
- name: Workstation | Account Management | GNOME | Dash To Dock | After replace()
debug:
var: gnome_enabled_extensions
when: ansible_distribution not in ("Ubuntu") and dash_to_dock_exists.failed
- name: Workstation | Account Management | GNOME | Dash To Dock | Variables 2
set_fact:
dash_to_dock_ext_comma: ", "
when: ansible_distribution not in ("Ubuntu") and dash_to_dock_exists.failed and gnome_enabled_extensions not in ("[]", [], "None")
- name: Workstation | Account Management | GNOME | Dash To Dock | Variables 3
set_fact:
dash_to_dock_ext_name: "{{ dash_to_dock_ext_comma }}'dash-to-dock@micxgx.gmail.com']"
when: ansible_distribution not in ("Ubuntu") and dash_to_dock_exists.failed
- name: Workstation | Account Management | GNOME | Dash To Dock | Variables 4
set_fact:
gnome_enabled_extensions: "[]"
when: ansible_distribution not in ("Ubuntu") and dash_to_dock_exists.failed and gnome_enabled_extensions == "None"
- name: Workstation | Account Management | GNOME | Dash To Dock | Print Value To Append With
debug:
var: dash_to_dock_ext_name
when: ansible_distribution not in ("Ubuntu") and dash_to_dock_exists.failed
- name: Workstation | Account Management | GNOME | Dash To Dock | Print Value To Append To
debug:
var: gnome_enabled_extensions
when: ansible_distribution not in ("Ubuntu") and dash_to_dock_exists.failed
- name: Workstation | Account Management | GNOME | Dash To Dock | Print Combined Value
debug:
msg: "{{ gnome_enabled_extensions | replace(']', dash_to_dock_ext_name) }}"
when: ansible_distribution not in ("Ubuntu") and dash_to_dock_exists.failed
- name: Workstation | Account Management | GNOME | Dash To Dock | Enable
dconf:
key: /org/gnome/shell/enabled-extensions
value: "{{ gnome_enabled_extensions | replace(']', dash_to_dock_ext_name) }}"
state: present
become_user: "{{ user }}"
when: ansible_distribution not in ("Ubuntu") and dash_to_dock_exists.failed
# Settings #
- name: Workstation | Account Management | GNOME | Dash To Dock | Dock Position
dconf:
key: /org/gnome/shell/extensions/dash-to-dock/dock-position
value: "'LEFT'"
state: present
become_user: "{{ user }}"
- name: Workstation | Account Management | GNOME | Dash To Dock | Dock Fixed
dconf:
key: /org/gnome/shell/extensions/dash-to-dock/dock-fixed
value: "true"
state: present
become_user: "{{ user }}"
- name: Workstation | Account Management | GNOME | Dash To Dock | Icon Size
dconf:
key: /org/gnome/shell/extensions/dash-to-dock/dash-max-icon-size
value: "32"
state: present
become_user: "{{ user }}"
- name: Workstation | Account Management | GNOME | Favorites (Linux)
dconf:
key: /org/gnome/shell/favorite-apps

View File

@ -3,6 +3,11 @@
# https://dwm.suckless.org/
# https://sites.google.com/site/lazyboxx/-articles/dwm-a-newbie-s-guide#TOC-Status-Bar
#TODO: Move this to tasks/shared/ pasth rather than tasks/linux/.
#TODO: Generate files based on blockinfile.
#TODO: Fix config.mk for FreeBSD automatically (use /usr/local/ for libs not /usr/X11RC/)
#TODO: scm.sh to use bash variable so that FreeBSD correctly hits /usr/local/bin/bash.
## Pre-reqs ##
- name: Workstation | Linux | Software | DWM | Pre-Reqs