Files
env-ansible/tasks/general/acct_mgmt/provision_config.yml
T

700 lines
32 KiB
YAML

---
# Set up directory and files for specifying software needs rather than using hosts file.
- name: General | Account Management | Provisioning Configuration | Variables 1
ansible.builtin.set_fact:
prov_dir: "/usr/local/etc/hyperling-scm"
provision_variables: []
- name: General | Account Management | Provisioning Configuration | Variables 2
ansible.builtin.set_fact:
gen_file: "{{ prov_dir }}/general.ini"
wrk_file: "{{ prov_dir }}/workstation.ini"
mnr_file: "{{ prov_dir }}/miner.ini"
srv_file: "{{ prov_dir }}/server.ini"
- name: General | Account Management | Provisioning Configuration | Create Directory
ansible.builtin.file:
path: "{{ prov_dir }}"
state: directory
mode: '0755'
## General ##
- name: General | Account Management | Provisioning Configuration | General | Create
ansible.builtin.blockinfile:
path: "{{ gen_file }}"
marker: '; {mark} MANAGED BY ANSIBLE | Generic Config'
block: |
[global]
;;;;;;;;;;;;;;;;;;;; Basic Options ;;;;;;;;;;;;;;;;;;;;
;
; enable : Provide true for the provision to occur.
; Default: false
;
; user : Provide the name of the user account.
; Example: tom, jerry, kim, sarah
; Default: user
;
; user_desc : Provide the description of the user account.
; Example: Thomas, Jerry, Kimberly, Sarah
; Default: User
;
; sshd_port : Determine the port which SSHD should listen on.
; Example: 12345
; Default: 22
;
; pentesting : Set to true to install tools such as metasploit.
; nmap is already provided for reporting
; Default: false
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
state: present
create: true
backup: true
mode: "0644"
- name: General | Account Management | Provisioning Configuration | General | Create | Git Polling
ansible.builtin.blockinfile:
path: "{{ gen_file }}"
marker: '; {mark} MANAGED BY ANSIBLE | Generic Config | Git Polling'
block: |
;;;;;;;;;;;;;;;;;;;; Git Polling ;;;;;;;;;;;;;;;;;;;;
;
; For syncing this machine to a Git repository of this Ansible project
; in this fashion: ssh://git@GIT_HOST:GIT_SSH_PORT/GIT_USER/GIT_PROJECT
;
; branch : Branch to use on this machine.
; Example: main, dev, prod
; Default: main
;
; git_host : Provide the git host that the machine should poll.
; Example: github.com, gitlab.com. gitea.com
; Default: git.hyperling.com
;
; git_ssh_port : Port of the server host to use for SSH requests.
; Example: 22, 222, 2222
; Default: 22
;
; git_user : Provide the git user which projects are found under.
; Example: Hyperling, JimBobMcGeeJr
; Default: me
;
; git_project : Name of this project on the server host.
; Example: Ansible, ansible-setup, my-env
; Default: env-ansible
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
state: present
create: true
backup: true
mode: "0644"
- name: General | Account Management | Provisioning Configuration | General | Create | Swap File
ansible.builtin.blockinfile:
path: "{{ gen_file }}"
marker: '; {mark} MANAGED BY ANSIBLE | Generic Config | Swap File'
block: |
;;;;;;;;;;;;;;;;;;;; Swap File ;;;;;;;;;;;;;;;;;;;;
;
; swap_block : Set to the block size if dd should create a swapfile.
; Preferably keep this under 2G for integrity sakes, the
; value is multiplied by count if you need a larger file.
; Example: 500M, 512MB, 1G
; Default: false
;
; swap_count : Set to the number of blocks to multiply the file size by.
; Example: 8
; Default: 1
;
; swap_file : Set to the name and location of where the file should be.
; Example: /usr/local/swap
; Default: /swapfile
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
state: present
create: true
backup: true
mode: "0644"
- name: General | Account Management | Provisioning Configuration | General | Create | Sync Frequency
ansible.builtin.blockinfile:
path: "{{ gen_file }}"
marker: '; {mark} MANAGED BY ANSIBLE | Generic Config | Sync Frequency'
block: |
;;;;;;;;;;;;;;;;;;;; Sync Frequency ;;;;;;;;;;;;;;;;;;;;
;
; no_telem : Set to true to avoid setting up telemetry services.
; Disables GitHub updates to this project.
; Disables all telegraf pings.
; Default: false
;
; battery : Set to true to attempt to save battery life.
; Slows down the rate of services such as telegraf and cron.
; Default: false
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
state: present
create: true
backup: true
mode: "0644"
- name: General | Account Management | Provisioning Configuration | General | Create | Server Shortcuts
ansible.builtin.blockinfile:
path: "{{ gen_file }}"
marker: '; {mark} MANAGED BY ANSIBLE | Generic Config | Server Shortcuts'
block: |
;;;;;;;;;;;;;;;;;;;; Server Shortcuts ;;;;;;;;;;;;;;;;;;;;
;
; For typing `prod` and getting straight to a server, like in env-termux.
;
; Imagine the command:
; `ssh prod_user@prod_host:prod_port`
;
; prod_host : Hostname for the production server.
; Example: myserver.com, mywebhost.net
; Default: hyperling.com
;
; prod_port : Port for the production server.
; Example: 22, 222, 2222
; Default: 22
;
; prod_user : Username for accessing the production server.
; Example: jim, bob, jeff, anne
; Default: user
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
state: present
create: true
backup: true
mode: "0644"
- name: General | Account Management | Provisioning Configuration | General | Create | Sync Shortcuts
ansible.builtin.blockinfile:
path: "{{ gen_file }}"
marker: '; {mark} MANAGED BY ANSIBLE | Generic Config | Sync Shortcuts'
block: |
;;;;;;;;;;;;;;;;;;;;; Sync Shortcuts ;;;;;;;;;;;;;;;;;;;;;
;
; Imagine the command:
; `rsync -auPhz --delete -e 'ssh -p prod_data_port' ./mydata-MASTER/ \
; prod_data_user@prod_data_host:/prod_data_dir/mydata-clone
; `
;
; prod_data_host : Branch to use on this machine.
; Example: sftp.myserver.com, sftp.mywebhost.net
; Default: hyperling.com
;
; prod_data_port : Provide the git host that the machine should poll.
; Example: 22, 222, 2222
; Default: 22
;
; prod_data_user : Port of the server host to use for SSH requests.
; Example: jim, bob, jeff, anne
; Default: user
;
; prod_data_dir : Port of the server host to use for SSH requests.
; Example: /srv/sftp/
; Default: /srv/sftp/
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
state: present
create: true
backup: true
mode: "0644"
- name: General | Account Management | Provisioning Configuration | General | Create | Tunnel
ansible.builtin.blockinfile:
path: "{{ gen_file }}"
marker: '; {mark} MANAGED BY ANSIBLE | Generic Config | Tunnel'
block: |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Tunnel ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Create a runit script which maintains an SSH tunnel to a remote server.
;
; ssh -v -H -R tunnel_remote_port:localhost:tunnel_local_port \
; [-p tunnel_ssh_port] tunnel_remote_host
;
; tunnel_local_port (default=8080)
; Local HTTP port which need forwarded to a remote server.
; Example: http://localhost:8080
;
; tunnel_remote_host (default=false)
; Remote server including username (such as user@example.com) which will
; serve the port. Server should preferably have a reverse proxy in order
; to encrypt the traffic, otherwise the local server should use HTTPS.
;
; tunnel_remote_port (default=8080)
; Port which should host the service on the remote server. This is what
; will get typed into web browsers or used by the reverse proxy. Should
; be > 1024. Also, /etc/ssh/sshd_config will need AllowTcpForwarding and
; GatewayPorts set to yes, then sshd will need to be reloaded.
; Example: http://example.com:8080
;
; tunnel_ssh_port (default=22)
; Port which the remote server exposes ssh.
; Example: ssh -p 2222 user@example.com
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
state: present
create: true
backup: true
mode: "0644"
- name: General | Account Management | Provisioning Configuration | General | Load
ansible.builtin.set_fact:
provision: "{{ lookup('ini', 'enable file={{gen_file}} default=false') | bool }}"
user: "{{ lookup('ini', 'user file={{gen_file}} default=user' ) }}"
user_desc: "{{ lookup('ini', 'user_desc file={{gen_file}} default=User' ) }}"
branch: "{{ lookup('ini', 'branch file={{gen_file}} default=main' ) }}"
pentesting: "{{ lookup('ini', 'pentesting file={{gen_file}} default=false') | bool }}"
no_telem: "{{ lookup('ini', 'no_telem file={{gen_file}} default=false') | bool }}"
battery: "{{ lookup('ini', 'battery file={{gen_file}} default=false') | bool }}"
swap_block: "{{ lookup('ini', 'swap_block file={{gen_file}} default=false') }}"
swap_count: "{{ lookup('ini', 'swap_count file={{gen_file}} default=1' ) | int }}"
swap_file: "{{ lookup('ini', 'swap_file file={{gen_file}} default=/swapfile') }}"
sshd_port: "{{ lookup('ini', 'sshd_port file={{gen_file}} default=22' ) | int }}"
git_host: "{{ lookup('ini', 'git_host file={{gen_file}} default=git.hyperling.com') }}"
git_user: "{{ lookup('ini', 'git_user file={{gen_file}} default=me') }}"
git_project: "{{ lookup('ini', 'git_project file={{gen_file}} default=env-ansible') }}"
git_ssh_port: "{{ lookup('ini', 'git_ssh_port file={{gen_file}} default=22') | int }}"
prod_host: "{{ lookup('ini', 'prod_host file={{gen_file}} default=hyperling.com') }}"
prod_port: "{{ lookup('ini', 'prod_port file={{gen_file}} default=22') | int }}"
prod_user: "{{ lookup('ini', 'prod_user file={{gen_file}} default=user') }}"
prod_data_host: "{{ lookup('ini', 'prod_data_host file={{gen_file}} default=hyperling.com') }}"
prod_data_port: "{{ lookup('ini', 'prod_data_port file={{gen_file}} default=22') | int }}"
prod_data_user: "{{ lookup('ini', 'prod_data_user file={{gen_file}} default=user') }}"
prod_data_dir: "{{ lookup('ini', 'prod_data_dir file={{gen_file}} default=/srv/sftp') }}"
tunnel_local_port: "{{ lookup('ini', 'tunnel_local_port file={{gen_file}} default=8080' ) | int }}"
tunnel_remote_host: "{{ lookup('ini', 'tunnel_remote_host file={{gen_file}} default=false') }}"
tunnel_remote_port: "{{ lookup('ini', 'tunnel_remote_port file={{gen_file}} default=8080' ) | int }}"
tunnel_ssh_port: "{{ lookup('ini', 'tunnel_ssh_port file={{gen_file}} default=22' ) | int }}"
- name: General | Account Management | Provisioning Configuration | General | Boolean Check | swap_block
ansible.builtin.set_fact:
swap_block: "{{ swap_block | bool }}"
when: swap_block in ("false")
- name: General | Account Management | Provisioning Configuration | General | List
ansible.builtin.set_fact:
provision_variables: "{{ provision_variables | combine(item) }}"
loop:
- { 'provision': "{{ provision }}" }
- { 'user': "{{ user }}" }
- { 'user_desc': "{{ user_desc }}" }
- { 'branch': "{{ branch }}" }
- { 'pentesting': "{{ pentesting }}" }
- { 'no_telem': "{{ no_telem }}" }
- { 'battery': "{{ battery }}" }
- { 'swap_block': "{{ swap_block }}" }
- { 'swap_count': "{{ swap_count }}" }
- { 'swap_file': "{{ swap_file }}" }
- { 'sshd_port': "{{ sshd_port }}" }
- { 'git_host': "{{ git_host }}" }
- { 'git_user': "{{ git_user }}" }
- { 'git_project': "{{ git_project }}" }
- { 'git_ssh_port': "{{ git_ssh_port }}" }
- { 'prod_host': "{{ prod_host }}" }
- { 'prod_port': "{{ prod_port }}" }
- { 'prod_user': "{{ prod_user }}" }
- { 'prod_data_host': "{{ prod_data_host }}" }
- { 'prod_data_port': "{{ prod_data_port }}" }
- { 'prod_data_user': "{{ prod_data_user }}" }
- { 'prod_data_dir': "{{ prod_data_dir }}" }
- { 'tunnel_local_port': "{{ tunnel_local_port }}" }
- { 'tunnel_remote_host': "{{ tunnel_remote_host }}" }
- { 'tunnel_remote_port': "{{ tunnel_remote_port }}" }
- { 'tunnel_ssh_port': "{{ tunnel_ssh_port }}" }
## Workstation ##
- name: General | Account Management | Provisioning Configuration | Workstation | Create | Main Options
ansible.builtin.blockinfile:
path: "{{ wrk_file }}"
marker: '; {mark} MANAGED BY ANSIBLE | Workstation Config'
block: |
[global]
;;;;;;;;;;;;;;;;;;;;;;;;;; Main Options ;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; enable : Set to true for system to be considered a workstation.
;
; coding : Set to true for installation of code editors (VSCode, PyCharm, Android Studio)
; - sdks : Set to true to download additional SDKs to test against.
;
; editing : Set to true for installation of Audio/Video editors (Shotcut, Audacity, OBS Stdio, GIMP)
; Set to video for only the video related portions.
; - Shotcut, OpenShot, OBS Studio, etc.
; Set to audio for only the music related portions.
; - Audacity (or similar), LMMS, VMPK, etc.
;
; gaming : Set to true for installation of gaming software (Steam, Lutris)
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
state: present
create: true
backup: true
mode: "0644"
- name: General | Account Management | Provisioning Configuration | Workstation | Create | LLMs
ansible.builtin.blockinfile:
path: "{{ wrk_file }}"
marker: '; {mark} MANAGED BY ANSIBLE | Workstation Config | LLMs'
block: |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; LLMs ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; ollama (default=true)
; Install and enable the ollama LLM manager.
; API: http://127.0.0.1:11434
;
; manage_models (default=true)
; Automatically choose and pull the models to use based on system
; resources. Otherwise leaves images alone but still handles config.
;
; hf_token (default=false)
; Token from Hugging Face which allows faster download speeds than anon.
; May help with ollama and also supposed to help with open-webui. Token
; needs set to something like hf_kjBCCLABEEABUVAKbjadbvkaksvBAVKBkjsDVK.
;
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
state: present
create: true
backup: true
mode: "0644"
- name: General | Account Management | Provisioning Configuration | Workstation | Create | LLMs | GUIs
ansible.builtin.blockinfile:
path: "{{ wrk_file }}"
marker: '; {mark} MANAGED BY ANSIBLE | Workstation Config | LLMs | GUIs'
block: |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; LLMs: GUIs ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; zeroclaw (default=true)
; Install and enable the Zeroclaw web daemon, a minimalistic interface
; for many models and providers with negligible resource usage. Also
; installs the CLI tool zerocode as an alternative to the web GUI.
; URL: http://127.0.0.1:42617
;
; open_webui (default=false)
; Install and enable open-webui as a Docker container. Very polished web
; frontend for ollama and also handles other web LLMs through API calls.
; Container is over 1GB in size and consumes substantial resources!
; URL: http://localhost:3000
;
; open_webui_port (default=3000)
; Port on which to run the open-webui Docker instance.
;
; open_webui_key (default=PleaseEnsureTheKeyIsAtLeast32To64Characters)
; Secret key, allows persistence between runs. If not a public-facing
; system, then not critical. Use `openssl rand -hex 32` to create one.
;
; codium_config (default=true)
; Manage the config files for and Codium plugins. Cline and Continue are
; the recommended Codium extensions but need installed through the GUI.
; Currently handles:
; ~/.continue/config.yml
;
; qwen_code (default=true)
; Install and enable qwen-code as a daemon.
; URL: http://127.0.0.1:4170
;
; qwen_code_key (default='')
; API key for accessing the web GUI. Optional, not used if left blank.
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
state: present
create: true
backup: true
mode: "0644"
- name: General | Account Management | Provisioning Configuration | Workstation | Create | LLMs | GUIs
ansible.builtin.blockinfile:
path: "{{ wrk_file }}"
marker: '; {mark} MANAGED BY ANSIBLE | Workstation Config | LLMs | GUIs'
block: |
;;;;;;;;;;;;;;;;;;;;;;;;; LLMs: MCPs / Sandboxes ;;;;;;;;;;;;;;;;;;;;;;;;;
;
; open_terminal (default=false)
; Docker container to be used with GUIs like open-webui so that agents
; have somewhere safe to execute commands. Also allows file read/writes.
; URL: http://127.0.0.1:8000
;
; open_terminal_port (default=8000)
; Port on which to run the open-terminal Docker instance.
;
; open_terminal_key (default=open-terminal-key)
; API key, needed in order to access the server. Required.
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
state: present
create: true
backup: true
mode: "0644"
- name: General | Account Management | Provisioning Configuration | Workstation | Create | Other Options
ansible.builtin.blockinfile:
path: "{{ wrk_file }}"
marker: '; {mark} MANAGED BY ANSIBLE | Workstation Config | Other Options'
block: |
;;;;;;;;;;;;;;;;;;;;;;;;;; Other Options ;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; rdp : Set to true for installation of RDP protocol
; CURRENTLY FREEBSD-ONLY
;
; vnc : Set to true for installation of VNC protocol
; UNFINISHED/UNTESTED
;
; bsd_gpu : Set to [] to install GPU driver
; Example: amdgpu
;
; mobile : Set to true if not using an amd64 processor.
; Also used to disable tasks not helpful for Pinephone.
;
; redmode : Set to true/false for automatially using Night Light in GNOME.
; Default: true
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
state: present
create: true
backup: true
mode: "0644"
- name: General | Account Management | Provisioning Configuration | Workstation | Load
ansible.builtin.set_fact:
# Main
workstation: "{{ lookup('ini', 'enable file={{wrk_file}} default=false') | bool }}"
coding: "{{ lookup('ini', 'coding file={{wrk_file}} default=false') | bool }}"
sdks: "{{ lookup('ini', 'sdks file={{wrk_file}} default=false') | bool }}"
editing: "{{ lookup('ini', 'editing file={{wrk_file}} default=false') }}"
gaming: "{{ lookup('ini', 'gaming file={{wrk_file}} default=false') | bool }}"
# Other
rdp: "{{ lookup('ini', 'rdp file={{wrk_file}} default=false') | bool }}"
vnc: "{{ lookup('ini', 'vnc file={{wrk_file}} default=false') | bool }}"
bsd_gpu: "{{ lookup('ini', 'bsd_gpu file={{wrk_file}} default=false') | bool }}"
mobile: "{{ lookup('ini', 'mobile file={{wrk_file}} default=false') | bool }}"
redmode: "{{ lookup('ini', 'redmode file={{wrk_file}} default=true' ) | bool }}"
# LLMs
ollama_enabled: "{{ lookup('ini', 'ollama file={{wrk_file}} default=true' ) | bool }}"
manage_models: "{{ lookup('ini', 'manage_models file={{wrk_file}} default=true' ) | bool }}"
hf_token: "{{ lookup('ini', 'hf_token file={{wrk_file}} default=false') }}"
# LLM GUIs
zeroclaw_enabled: "{{ lookup('ini', 'zeroclaw file={{wrk_file}} default=true ') | bool }}"
open_webui_enabled: "{{ lookup('ini', 'open_webui file={{wrk_file}} default=false') | bool }}"
open_webui_port: "{{ lookup('ini', 'open_webui_port file={{wrk_file}} default=3000' ) | int }}"
open_webui_key: "{{ lookup('ini', 'open_webui_key file={{wrk_file}} default=PleaseEnsureTheKeyIsAtLeast32To64Characters') }}"
codium_config: "{{ lookup('ini', 'codium_config file={{wrk_file}} default=true' ) | bool }}"
qwen_code_enabled: "{{ lookup('ini', 'qwen_code file={{wrk_file}} default=true' ) | bool }}"
qwen_code_key : "{{ lookup('ini', 'qwen_code_key file={{wrk_file}} default=false') }}"
# LLM MCPs
open_terminal_enabled: "{{ lookup('ini', 'open_terminal file={{wrk_file}} default=false') | bool }}"
open_terminal_port: "{{ lookup('ini', 'open_terminal_port file={{wrk_file}} default=8000' ) | int }}"
open_terminal_key: "{{ lookup('ini', 'open_terminal_key file={{wrk_file}} default=false') }}"
- name: General | Account Management | Provisioning Configuration | Workstation | Boolean Check | editing
ansible.builtin.set_fact:
editing: "{{ editing | bool }}"
when: editing in ("true", "false")
- name: General | Account Management | Provisioning Configuration | Workstation | Boolean Check | qwen_code_key
ansible.builtin.set_fact:
qwen_code_key: "{{ qwen_code_key | bool }}"
when: qwen_code_key in ("false")
- name: General | Account Management | Provisioning Configuration | Workstation | Boolean Check | open_terminal_key
ansible.builtin.set_fact:
open_terminal_key: "{{ open_terminal_key | bool }}"
when: open_terminal_key in ("false")
- name: General | Account Management | Provisioning Configuration | Workstation | List
ansible.builtin.set_fact:
provision_variables: "{{ provision_variables | combine(item) }}"
loop:
- { 'workstation': "{{ workstation }}" }
- { 'coding': "{{ coding }}" }
- { 'sdks': "{{ sdks }}" }
- { 'editing': "{{ editing }}" }
- { 'gaming': "{{ gaming }}" }
- { 'rdp': "{{ rdp }}" }
- { 'vnc': "{{ vnc }}" }
- { 'bsd_gpu': "{{ bsd_gpu }}" }
- { 'mobile': "{{ mobile }}" }
- { 'redmode': "{{ redmode }}" }
- { 'ollama_enabled': "{{ ollama_enabled }}" }
- { 'manage_models': "{{ manage_models }}" }
- { 'hf_token': "{{ hf_token }}" }
- { 'zeroclaw_enabled': "{{ zeroclaw_enabled }}" }
- { 'open_webui_enabled': "{{ open_webui_enabled }}" }
- { 'open_webui_port': "{{ open_webui_port }}" }
- { 'open_webui_key': "{{ open_webui_key }}" }
- { 'codium_config': "{{ codium_config }}" }
- { 'qwen_code_enabled': "{{ qwen_code_enabled }}" }
- { 'qwen_code_key': "{{ qwen_code_key }}" }
- { 'open_terminal_enabled': "{{ open_terminal_enabled }}" }
- { 'open_terminal_port': "{{ open_terminal_port }}" }
- { 'open_terminal_key': "{{ open_terminal_key }}" }
# No longer mining, this is now considered deprecated.
### Miner ##
#
#- name: General | Account Management | Provisioning Configuration | Miner | Create
# ansible.builtin.blockinfile:
# path: "{{ mnr_file }}"
# block: |
# [global]
# ;;;;;;; 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
# ;
# ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
# marker: '; {mark} MANAGED BY ANSIBLE | Miner Config'
# state: present
# create: true
# backup: true
# mode: "0644"
#
#- name: General | Account Management | Provisioning Configuration | Miner | Load
# ansible.builtin.set_fact:
# miner: "{{ lookup('ini', 'enable file={{mnr_file}} default=false') | bool }}"
# amdgpu: "{{ lookup('ini', 'amdgpu file={{mnr_file}} default=false') | bool }}"
# nanominer: "{{ lookup('ini', 'nanominer file={{mnr_file}} default=false') | bool }}"
# nanominer_cpu: "{{ lookup('ini', 'nanominer_cpu file={{mnr_file}} default=false') | bool }}"
# nanominer_cpu_pool: "{{ lookup('ini', 'nanominer_cpu_pool file={{mnr_file}} default=false') | bool }}"
# nanominer_gpu: "{{ lookup('ini', 'nanominer_gpu file={{mnr_file}} default=false') | bool }}"
# nanominer_gpus: "{{ lookup('ini', 'nanominer_gpus file={{mnr_file}} default=false') | bool }}"
# nanominer_gpu_pool: "{{ lookup('ini', 'nanominer_gpu_pool file={{mnr_file}} default=false') | bool }}"
# eth_minhashrate: "{{ lookup('ini', 'eth_minhashrate file={{mnr_file}} default=false') | bool }}"
# ethminer: "{{ lookup('ini', 'ethminer file={{mnr_file}} default=false') | bool }}"
# nvidia: "{{ lookup('ini', 'nvidia file={{mnr_file}} default=false') | bool }}"
# xmr_stak_cpu: "{{ lookup('ini', 'xmr_stak_cpu file={{mnr_file}} default=false') | bool }}"
#
#- name: General | Account Management | Provisioning Configuration | Miner | List
# ansible.builtin.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 ##
- name: General | Account Management | Provisioning Configuration | Server | Create
ansible.builtin.blockinfile:
path: "{{ srv_file }}"
marker: '; {mark} MANAGED BY ANSIBLE | Server Config'
block: |
[global]
;;;;;;; Parameters ;;;;;;
;
; enable : Set to true for system to be considered a server.
;
; domain : Set to the domain which gives the server its FQDN.
; Example: hyperling.com
;
; onlyoffice : Set to true for this server to be configured as an OnlyOffice server.
;
; grafana : Set to true for this server to be configured as an Grafana web server.
;
; influxdb1 : Set to true for this server to be configured as an Influx 1 DB server.
;
; influxdb2 : Set to true for this server to be configured as an Influx 2 DB + web server.
;
; certbot : Set to true to add cron job for `certbot renew`.
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Never got these fully working or did not understand how to use them.
;
; hugo : Set to true to install HUGO static website generator.
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
state: present
create: true
backup: true
mode: "0644"
- name: General | Account Management | Provisioning Configuration | Server | Load
ansible.builtin.set_fact:
server: "{{ lookup('ini', 'enable file={{srv_file}} default=false') | bool }}"
domain: "{{ lookup('ini', 'domain file={{srv_file}} default=hyperling.com') }}"
onlyoffice: "{{ lookup('ini', 'onlyoffice file={{srv_file}} default=false') | bool }}"
grafana: "{{ lookup('ini', 'grafana file={{srv_file}} default=false') | bool }}"
influxdb1: "{{ lookup('ini', 'influxdb1 file={{srv_file}} default=false') | bool }}"
influxdb2: "{{ lookup('ini', 'influxdb2 file={{srv_file}} default=false') | bool }}"
certbot: "{{ lookup('ini', 'certbot file={{srv_file}} default=false') | bool }}"
hugo: "{{ lookup('ini', 'hugo file={{srv_file}} default=false') | bool }}"
- name: General | Account Management | Provisioning Configuration | Server | List
ansible.builtin.set_fact:
provision_variables: "{{ provision_variables | combine(item) }}"
loop:
- { 'server': "{{ server }}" }
- { 'domain': "{{ domain }}" }
- { 'onlyoffice': "{{ onlyoffice }}" }
- { 'grafana': "{{ grafana }}" }
- { 'influxdb1': "{{ influxdb1 }}" }
- { 'influxdb2': "{{ influxdb2 }}" }
- { 'certbot': "{{ certbot }}" }
- { 'hugo': "{{ hugo }}" }
## Exit if not turned on yet ##
- name: General | Account Management | Provisioning Configuration | Exit Check
block:
- name: General | Account Management | Provisioning Configuration | Exit Check | Message
ansible.builtin.debug:
msg: "Please configure the config files in {{ prov_dir }} then try again."
- name: General | Account Management | Provisioning Configuration | Exit Check | Exit
ansible.builtin.meta: end_play
when: not provision
## Display values ##
- name: General | Account Management | Provisioning Configuration | Print
ansible.builtin.debug:
var: provision_variables