67 Commits

Author SHA1 Message Date
98573c0066 Add moonlight role for Windows
Role installs the [Moonlight](https://moonlight-stream.org/) game
streaming client.
2022-11-20 21:51:08 +00:00
d95f1f7e32 Switch to Ansible for managing neovim plugins 2022-11-16 18:37:42 +00:00
7da67aaed0 Add labels for improve zsh role output 2022-11-11 17:27:16 +00:00
7ec59f8c52 Add sudo role for Unix systems 2022-11-07 14:38:50 +00:00
bebe6de7cd Set gdb config file based on installed version 2022-11-06 19:47:36 +00:00
08af0f00b6 Add CAD software to Windows playbook
The `autodesk-fusion360` and `prusiaslicer` roles are added to the
`Windows.yaml` playbook but disabled by default behind the
`install_cad_apps` flag. To enable them create a `~/.config/local.yaml`
file with the following:

```yaml
- import_playbook: local/Windows.yaml
  vars:
    install_cad_apps: true
```
2022-11-06 15:54:54 +00:00
3864c0f35d Add PrusaSlicer role for Windows 2022-11-06 15:31:02 +00:00
3218722fcb Add AutoDesk Fusion 360 role for Windows 2022-11-06 15:26:16 +00:00
1895f1561d Ensure $(hostname).local is in hosts file on WSL 2022-11-06 10:56:19 +00:00
cee0c443a3 Add gdb role for Debian 2022-11-05 20:05:48 +00:00
bb945190f8 Add readline role for Unix like systems 2022-11-04 12:53:20 +00:00
4f5a2e6333 Fix htop not setting become: true 2022-11-03 11:47:39 +00:00
833f9a25ef Add powertoys role for Windows 2022-10-31 23:26:07 +00:00
1fbdcdd487 Include jq, yq, and jp in relevant playbooks 2022-10-30 23:23:48 +00:00
9efb5d6c15 Add role for jp on macOS and Debian 2022-10-30 23:23:23 +00:00
d99657e3b8 Fix type in jq task comment 2022-10-30 23:23:04 +00:00
b159445520 Ensure win_owner is recursive for win_git repos 2022-10-29 12:59:19 +01:00
6a4a182cf5 Add role for yq on Debina, macOS, and Windows 2022-10-28 19:41:16 +01:00
55cc3441be Add role for jq on Debina, macOS, and Windows 2022-10-28 18:56:01 +01:00
bd4e5f1941 Always install fzf from apt on Debian
`fzf` is in the `apt` repos for all distros used.
2022-10-08 13:56:03 +01:00
c9845be40c Fix tidy role on Debian 2022-10-06 18:13:51 +01:00
f47b45d82c Use op.exe on WSL for biometrics 2022-10-03 22:45:07 +01:00
854bf8d1e9 Add wget role for macOS & Debian 2022-09-20 22:51:54 +01:00
3272331f08 Add role for htop on macOS/Debian 2022-09-20 18:54:50 +01:00
8c9af58146 Include tasks from tmux config repo 2022-09-20 13:43:01 +01:00
e4a08c843c Fix ag/curl roles on macOS 2022-09-20 12:52:04 +01:00
c77b356968 Add tidy role for http://www.html-tidy.org/ 2022-09-16 10:43:00 +01:00
7404c0ae59 Add curl role 2022-09-10 16:29:27 +01:00
06b511d823 Set the owner of Git repos on Windows
The `win_git` module clones repos as the current user, which since its
an admin login is the admin. This patch adjusts the `win_owner` to so
that repos are owned by the correct user when being used in a non-admin
capacity.
2022-09-10 16:18:21 +01:00
9693194f7f Update powershell role to better handle first install 2022-09-10 15:34:18 +01:00
337237a6e8 Pin Git to v2.36.1 on Windows so win_git works
Git for Windows v2.37.3 (and probably all version in the v2.37 series)
cause the unofficial win_git module to hang. Downgrading the v2.36.1
works around this issue for the time being. The Chocolatey package for
Git also does not respect the version flag, so installation is now
performed manually by grabbing the v2.36.1 installer from the GitHub
release asset and running it manually when installation is required.
2022-09-10 15:04:54 +01:00
31eba75038 On Windows move git role to the beginning 2022-09-10 11:52:07 +01:00
5728aba7df Don't include system-info role in WSL 2022-08-27 17:44:22 +01:00
76b6d63064 Improve bat role 2022-08-27 17:40:00 +01:00
189371d7f2 Fix macOS playbook import 2022-08-12 21:16:29 +01:00
491a9a07b5 Merge op role into 1password role
Additionally:

* Stop using Chocolatey packages for 1password as they are not up to
  date, instead download and install directly.
* Switch to apt repository on Debian.
* Add zsh completions for macOS and Dabian.
* Add powershell completions for Windows.
2022-08-12 21:16:29 +01:00
c4e87f2022 Implement system-info role on Debian 2022-07-29 18:01:03 +01:00
09e7ec3ad4 Merge op role into 1password role
Additionally:

* Stop using Chocolatey packages for 1password as they are not up to
  date, instead download and install directly.
* Switch to apt repository on Debian.
* Add zsh completions for macOS and Dabian.
* Add powershell completions for Windows.
2022-07-03 11:25:05 +01:00
c596fcb87a Split out fzf from zsh into its own role 2022-06-18 22:09:56 +01:00
441343fd7c Add coc-yaml config 2022-06-18 21:18:02 +01:00
1184062dc7 Add hosts template for wsl role
For setting up an ssh connection to the Windows host to manage it.
2022-06-11 16:58:58 +01:00
d172e171b2 Fix directory creation in nodejs role 2022-06-11 12:31:34 +01:00
651909ff71 Add op role for Linux, macOS, and Windows 2022-06-05 20:38:48 +01:00
60a147124f Use ~/.local/src/node for tidyness 2022-06-05 20:37:42 +01:00
3aa7bcfa2e Add python3-venv for make coc.nvim work 2022-06-05 19:59:25 +01:00
01c1ca74a3 Add WSL playbook to run Unix and Windows 2022-06-03 21:13:01 +01:00
f4bcbbbe09 Use chocolatey instead of choco in names 2022-06-03 20:58:33 +01:00
69cb941a85 Update llvm role to support all Ubuntu LTS 2022-06-03 20:30:13 +01:00
f7a5e3728f Fix zsh role to set zsh as default shell 2022-05-27 20:15:41 +01:00
d1cfa8c98e Add obsidian role for macOS and Windows 2022-05-24 20:41:34 +01:00
64ecd88c93 Fix whitespace in powershell role 2022-05-24 19:05:36 +01:00
7642c62ecf Add windows-terminal role for Windows 2022-05-23 21:11:21 +01:00
1117ca00f7 Add system-info role for Windows 2022-05-22 14:05:05 +01:00
de8c0a119d Add macOS.ahk scheduled task 2022-05-22 10:07:33 +01:00
2eaf11b8a5 Add distrobox role for Debian 2022-05-21 23:34:02 +01:00
bcbaa9dfcf Change nvim-qt Windows shortcut working directory 2022-05-12 21:02:53 +01:00
d6e09f2317 Add firefox role for Windows 2022-05-12 20:50:03 +01:00
179273c22b Add git chocolatey package install 2022-05-12 20:29:45 +01:00
51d48f7f49 Actually use llvm role 2022-05-12 20:10:09 +01:00
c2f1cd3201 Add bat role for Debian and macOS 2022-05-12 19:58:43 +01:00
c9d2e66438 Add tree role for Debina, macOS, and Windows 2022-05-12 19:58:15 +01:00
f6e60b8417 Remove macOS duplication 2022-05-11 22:43:44 +01:00
e1745bd162 Fix python Debian package install 2022-05-11 22:43:25 +01:00
44c1e5ccff Add nodejs role for Debian, macOS, and Windows 2022-05-11 22:33:18 +01:00
5dfb92522e Add ag role for Debian, macOS, and Windows 2022-05-11 22:27:18 +01:00
14c14353f8 Add llvm role for Debian sid, Ubuntu 18.04, macOS, and Windows 2022-05-08 19:59:07 +01:00
3061ade54f Don't install llvm (and related) with neovim 2022-05-07 15:05:20 +01:00
109 changed files with 1520 additions and 166 deletions

12
.vim/coc-settings.json Normal file
View File

@@ -0,0 +1,12 @@
{
"yaml.schemas": {
"https://raw.githubusercontent.com/ansible-community/schemas/main/f/ansible.json#/$defs/playbook": [
"./*.yaml"
],
"https://raw.githubusercontent.com/ansible-community/schemas/main/f/ansible.json#/$defs/tasks": [
"./roles/*/handlers/*.yaml",
"./roles/*/tasks/*.yaml",
"./tasks.yaml"
]
}
}

34
Unix.yaml Normal file
View File

@@ -0,0 +1,34 @@
---
- hosts: localhost
roles:
- role: sudo
when: ansible_user_id != "root"
- role: zsh
- role: neovim
- role: tmux
- role: system-info
when: '"WSL" not in ansible_kernel'
- role: ag
- role: bat
- role: curl
- role: fzf
- role: git
- role: htop
- role: jp
- role: jq
- role: readline
- role: tidy
- role: tree
- role: yq
- role: llvm
- role: nodejs
- role: python
- role: 1password
- role: wsl
when: '"WSL" in ansible_kernel'

3
WSL.yaml Normal file
View File

@@ -0,0 +1,3 @@
---
- import_playbook: Unix.yaml
- import_playbook: Windows.yaml

35
Windows.yaml Normal file
View File

@@ -0,0 +1,35 @@
---
- hosts: windows
vars:
install_cad_apps: false
roles:
- role: git
- role: powershell
- role: neovim
- role: system-info
- role: ag
- role: bat
- role: curl
- role: fzf
- role: tree
- role: jq
- role: yq
- role: llvm
- role: nodejs
- role: python
- role: 1password
- role: autohotkey
- role: firefox
- role: obsidian
- role: powertoys
- role: windows-terminal
- role: autodesk-fusion360
when: install_cad_apps
- role: prusaslicer
when: install_cad_apps

7
macOS.yaml Normal file
View File

@@ -0,0 +1,7 @@
---
- import_playbook: Unix.yaml
- hosts: localhost
roles:
- role: obsidian

View File

@@ -1,5 +1,9 @@
---
- name: install homebrew package
homebrew_cask:
name: 1password
name:
- 1password
- 1password-cli
state: latest
- include_tasks: zsh-completion.yaml

View File

@@ -1 +1,48 @@
# TODO: https://support.1password.com/install-linux/#debian-or-ubuntu
---
- name: add apt signing key
when: '"WSL" not in ansible_kernel'
become: true
apt_key:
url: https://downloads.1password.com/linux/keys/1password.asc
keyring: /etc/apt/trusted.gpg.d/1password-archive-keyring.gpg
state: present
- when: ansible_machine == 'x86_64'
set_fact:
arch: amd64
- assert:
that: arch is defined
fail_msg: 'Architecture not currently supported: {{ansible_machine}}'
- name: add apt repository
when: '"WSL" not in ansible_kernel'
become: true
apt_repository:
repo: >-
deb [arch={{arch}}
signed-by=/etc/apt/trusted.gpg.d/1password-archive-keyring.gpg]
https://downloads.1password.com/linux/debian/{{arch}} stable main
- name: install gui package
when: '"WSL" not in ansible_kernel'
become: true
apt:
name: 1password
state: latest
- name: install cli package
when: '"WSL" not in ansible_kernel'
become: true
apt:
name: 1password-cli
state: latest
- name: create symlink to op.exe
when: '"WSL" in ansible_kernel'
file:
state: link
src: /mnt/c/Users/Benie/AppData/Local/1Password/cli/op.exe
dest: ~/.local/bin/op
- include_tasks: zsh-completion.yaml

View File

@@ -1,12 +1,111 @@
---
- name: install chocolatey package
win_chocolatey:
name:
- 1password
state: latest
# NOTE: The 1Password chocolatey packages are not up to date.
# GUI
- set_fact:
app_exe: '{{ansible_env.LOCALAPPDATA}}/1Password/app/8/1Password.exe'
installer_exe: '{{ansible_env.TEMP}}/1PasswordSetup-latest.exe'
- name: check if already installed
win_stat:
path: '{{app_exe}}'
register: app_stat
- name: get installed version
when: app_stat.stat.exists == True
win_command: '{{app_exe}} --version'
register: app_version
changed_when: false
- when: app_stat.stat.exists == True
set_fact:
installed_version: '{{app_version.stdout.strip()}}'
- name: download latest installer
win_get_url:
url: https://downloads.1password.com/win/1PasswordSetup-latest.exe
dest: '{{installer_exe}}'
- name: get installer version
win_shell: |
(Get-ItemProperty {{installer_exe}}).VersionInfo.ProductVersion
register: installer_product_version
changed_when: false
# FIXME: The [5:] is to account for a mystery "\e[6 q" prefix, not sure if this
# is consistent across machines or some other oddity.
- set_fact:
installer_version: '{{installer_product_version.stdout.strip()[5:]}}'
- name: run installer
when: installed_version is not defined or installed_version != installer_version
win_command: '{{installer_exe}}'
- name: create start menu shortcut
win_shortcut:
src: '{{ansible_env.LOCALAPPDATA}}/1Password/app/7/1Password.exe'
src: '{{app_exe}}'
dest: '{{ansible_env.ProgramData}}/Microsoft/Windows/Start Menu/Programs/1Password.lnk'
icon: '{{ansible_env.LOCALAPPDATA}}/1Password/app/7/1Password.exe,0'
icon: '{{app_exe}},0'
# CLI
- set_fact:
cli_dir: '{{ansible_env.LOCALAPPDATA}}\1Password\cli'
cli_zip: '{{ansible_env.TEMP}}/op_windows_amd64.zip'
- set_fact:
cli_exe: '{{cli_dir}}\op.exe'
- name: check if op already installed
win_stat:
path: '{{cli_exe}}'
register: cli_stat
- name: get installed op version
when: cli_stat.stat.exists == True
win_command: '{{cli_exe}} --version'
register: cli_version
changed_when: false
- when: cli_stat.stat.exists == True
set_fact:
cli_installed_version: '{{cli_version.stdout.strip()}}'
- name: get list of op releases
win_uri:
url: https://raw.githubusercontent.com/kbenzie/op-release-scraper/main/op-releases.json
return_content: true
register: releases
- set_fact:
latest: '{{releases.json[0]}}'
- name: download latest op zip archive
when: cli_installed_version is not defined or cli_installed_version != latest.version
win_get_url:
url: '{{latest.downloads.Windows.amd64}}'
dest: '{{cli_zip}}'
- name: unzip op zip archive
when: cli_installed_version is not defined or cli_installed_version != latest.version
win_unzip:
src: '{{cli_zip}}'
dest: '{{cli_dir}}'
- name: add op install directory to user PATH
win_path:
scope: user
name: Path
elements: '{{cli_dir}}'
- name: get op powershell completion script
win_command:
argv:
- '{{ansible_env.LOCALAPPDATA}}/1Password/cli/op.exe'
- completion
- powershell
register: powershell_completion_script
changed_when: false
- name: create op powershell completion file
win_copy:
content: '{{powershell_completion_script.stdout}}'
dest: '{{cli_dir}}/opProfile.psm1'

View File

@@ -0,0 +1,10 @@
---
- name: get op zsh completion script
command: op completion zsh
register: zsh_completion_script
changed_when: false
- name: create op zsh completion file
copy:
content: '{{zsh_completion_script.stdout}}'
dest: ~/.local/share/zsh/site-functions/_op

View File

@@ -0,0 +1,5 @@
---
- name: install homebrew package
homebrew:
name: the_silver_searcher
state: latest

View File

@@ -0,0 +1,6 @@
---
- name: install apt package
become: true
apt:
name: silversearcher-ag
state: latest

View File

@@ -0,0 +1,5 @@
---
- name: install chocolatey package
win_chocolatey:
name: ag
state: latest

2
roles/ag/tasks/main.yaml Normal file
View File

@@ -0,0 +1,2 @@
---
- include_tasks: '{{ansible_os_family}}.yaml'

View File

@@ -0,0 +1,8 @@
---
- assert:
that: ansible_os_family == "Windows"
- name: install chocolatey package
win_chocolatey:
name: autodesk-fusion360
state: latest

View File

@@ -7,8 +7,31 @@
- name: clone config repo
win_git:
repo: git@code.infektor.net:config/AutoHotKey.git
dest: '{{ansible_env.LOCALAPPDATA}}/AutoHotKey'
dest: '{{autohotkey_repo_dir}}'
branch: master
- win_owner:
path: '{{autohotkey_repo_dir}}'
user: Benie
recurse: true
# TODO: - name: create scheduled task
# win_scheduled_task:
- name: create scheduled task
win_scheduled_task:
path: Benie
name: macOS.ahk
state: present
enable: true
triggers:
- type: logon
enabled: true
- type: registration
enabled: true
actions:
- path: '{{autohotkey_repo_dir}}/macOS.ahk'
disallow_start_if_on_batteries: false
stop_if_going_on_batteries: false
execution_time_limit: PT0S
logon_type: interactive_token
multiple_instances: 3
run_level: highest
start_when_available: true
wake_to_run: false

View File

@@ -0,0 +1,2 @@
---
autohotkey_repo_dir: '{{ansible_env.LOCALAPPDATA}}/AutoHotKey'

View File

@@ -0,0 +1,5 @@
---
- name: install homebrew package
homebrew:
name: bat
state: latest

View File

@@ -0,0 +1,13 @@
---
- set_fact:
use_github: '{{
ansible_distribution == "Ubuntu" and
ansible_distribution_version == "18.04"
}}'
- debug: msg={{use_github}}
- when: use_github
include_tasks: deb.yaml
- when: not use_github
include_tasks: apt.yaml

View File

@@ -0,0 +1,5 @@
---
- name: install chocolatey package
win_chocolatey:
name: Bat
state: latest

13
roles/bat/tasks/apt.yaml Normal file
View File

@@ -0,0 +1,13 @@
---
- name: install apt package
become: true
apt:
name: bat
state: latest
- name: update bat alternative
become: true
alternatives:
name: bat
path: /usr/bin/batcat
link: /usr/local/bin/bat

65
roles/bat/tasks/deb.yaml Normal file
View File

@@ -0,0 +1,65 @@
---
- name: get latest github release
uri:
url: https://api.github.com/repos/sharkdp/bat/releases/latest
register: latest
- set_fact:
latest_version: '{{latest.json.tag_name[1:]}}'
bat_exe: '/usr/bin/bat'
- name: check if already installed
stat:
path: '{{bat_exe}}'
register: bat_stat
- name: get installed version
when: bat_stat.stat.exists == True
command: '{{bat_exe}} --version'
register: bat_version
changed_when: false
- when: bat_stat.stat.exists == True
set_fact:
installed_version:
'{{bat_version.stdout.strip() | regex_replace("^.*(\d+\.\d+\.\d+).*$", "\1")}}'
- when: ansible_machine == "x86_64"
set_fact:
arch: amd64
- assert:
that: arch is defined
fail_msg: 'Architecture not currently supported: {{ansible_machine}}'
- set_fact:
assets: '{{latest.json.assets}}'
asset_query: '[?contains(name, `bat-musl_`)] | [?contains(name, `amd64.deb`)] | [0]'
pkg_dir: '{{ansible_env.HOME}}/.local/pkg/bat'
- set_fact:
asset: '{{assets | to_json | from_json | json_query(asset_query)}}'
bat_deb: '{{pkg_dir}}/bat.deb'
- name: create directory for deb file download
file:
state: directory
path: '{{pkg_dir}}'
- name: download .deb file
when: installed_version is not defined or installed_version != latest_version
get_url:
url: '{{asset.browser_download_url}}'
dest: '{{bat_deb}}'
- name: install .deb file
when: installed_version is not defined or installed_version != latest_version
become: true
apt:
deb: '{{bat_deb}}'
- name: remove .deb file
when: installed_version is not defined or installed_version != latest_version
file:
state: absent
path: '{{bat_deb}}'
changed_when: false

View File

@@ -0,0 +1,2 @@
---
- include_tasks: '{{ansible_os_family}}.yaml'

View File

@@ -0,0 +1,5 @@
---
- name: install homebrew package
homebrew:
name: curl
state: latest

View File

@@ -0,0 +1,6 @@
---
- name: install apt package
become: true
apt:
name: curl
state: latest

View File

@@ -0,0 +1,5 @@
---
- name: install chocolatey package
win_chocolatey:
name: curl
state: latest

View File

@@ -0,0 +1,2 @@
---
- include_tasks: '{{ansible_os_family}}.yaml'

View File

@@ -0,0 +1,100 @@
#compdef distrobox
_distrobox() {
local context curcontext="$curcontext" state line ret=1
typeset -A opt_args
_arguments -C \
'(-h --help)'{-h,--help}'[show help]' \
'(-V --version)'{-V,--version}'[show version]' \
'1: :->command' \
'*:: :->arguments'
case $state in;
(command)
local commands;
commands=(
'create:create the distrobox'
'enter:enter the distrobox'
'export:application and service exporting'
'list:list containers'
'rm:remove containers'
'stop:stop containers'
)
_describe -t commands 'distrobox command' commands "$@" \
&& ret=0 ;;
(arguments)
case $line[1] in
(create)
_arguments \
'(-h --help)'{-h,--help}'[show this message]' \
'(-v --verbose)'{-v,--verbose}'[show more verbosity]' \
'(-V --version)'{-V,--version}'[show version]' \
'(-i --image)'{-i,--image}'[image to use for the container]: :' \
'(-n --name)'{-n,--name}'[name for the distrobox]: :' \
'(-H --home)'{-H,--home}'[select a custom HOME directory for the container]: :' \
'*--volume[additional volumes to add to the container]: :_directories' \
'(-a --additional-flags)'{-a,--additional-flags}'[additional flags to pass to the container manager command]: :' \
'(-I --init)'{-I,--init}'[use init system (like systemd) inside the container]: :' \
'(-d --dry-run)'{-d,--dry-run}'[only print the container manager command generated]' \
&& ret=0 ;;
(enter)
_arguments -S \
'(-h --help)'{-h,--help}'[show this message]' \
'(-v --verbose)'{-v,--verbose}'[show more verbosity]' \
'(-V --version)'{-V,--version}'[show version]' \
'(-n --name)'{-n,--name}'[name for the distrobox]: :' \
'(-T --no-tty)'{-T,--no-tty}'[do not instantiate a tty]' \
'(-a --additional-flags)'{-a,--additional-flags}'[additional flags to pass to the container manager command]: :' \
'(-d --dry-run)'{-d,--dry-run}'[only print the container manager command generated]' \
'(-e --)'{-e,--}'[end arguments execute the rest as command to execute at login]:*:' \
&& ret=0 ;;
(export)
_arguments -S \
'(-h --help)'{-h,--help}'[show this message]' \
'(-v --verbose)'{-v,--verbose}'[show more verbosity]' \
'(-V --version)'{-V,--version}'[show version]' \
'(-a --app)'{-a,--app}'[name of the application to export]: :' \
'(-b --bin)'{-b,--bin}'[absolute path of the binary to export]: :' \
'(-s --service)'{-s,--service}'[name of the service to export]: :' \
'(-d --delete)'{-d,--delete}'[delete exported application or service]: :' \
'(-el --export-label)'{-el,--export-label}'[label to add to exported application name]: :' \
'(-ep --export-path)'{-ep,--export-path}'[path where to export the binary]: :' \
'(-ef --extra-flags)'{-ef,--export-flags}'[extra flags to add to the command]: :' \
'(-S --sudo)'{-S,--sudo}'[specify if the exported item should be run as sudo]' \
&& ret=0 ;;
(list)
_arguments -S \
'(-h --help)'{-h,--help}'[show this message]' \
'(-v --verbose)'{-v,--verbose}'[show more verbosity]' \
'(-V --version)'{-V,--version}'[show version]' \
&& ret=0 ;;
(rm)
_arguments -S \
'(-h --help)'{-h,--help}'[show this message]' \
'(-v --verbose)'{-v,--verbose}'[show more verbosity]' \
'(-V --version)'{-V,--version}'[show version]' \
'(-n --name)'{-n,--name}'[name for the distrobox]: :' \
'(-f --force)'{-f,--force}'[force deletion]' \
&& ret=0 ;;
(stop)
_arguments -S \
'(-h --help)'{-h,--help}'[show this message]' \
'(-v --verbose)'{-v,--verbose}'[show more verbosity]' \
'(-V --version)'{-V,--version}'[show version]' \
'(-n --name)'{-n,--name}'[name for the distrobox]: :' \
'(-Y --yes)'{-Y,--yes}'[non-interactive, stop without asking]' \
&& ret=0 ;;
esac ;;
esac
return $ret
}
_distrobox "$@"

View File

@@ -0,0 +1,15 @@
---
- name: install apt package
when: ansible_distribution == "Debian" and
ansible_distribution_version == "unstable"
become: true
apt:
name: distrobox
state: latest
- name: install distrobox zsh completions
when: ansible_distribution == "Debian" and
ansible_distribution_version == "unstable"
copy:
src: _distrobox
dest: '{{ansible_env.HOME}}/.local/share/zsh/site-functions/_distrobox'

View File

@@ -0,0 +1,14 @@
---
- name: install chocolatey package
win_chocolatey:
name: firefox
package_params: >-
/l:en-GB
/NoDesktopShortcut
/NoAutoUpdate
state: latest
# - TODO: create extensions directory
# file:
# path: '{{ansible_env.ProgramFiles}}/Mozilla Firefox/distribution/extensions'
# state: directory

View File

@@ -0,0 +1,2 @@
---
- include_tasks: '{{ansible_os_family}}.yaml'

View File

@@ -1,4 +1,4 @@
---
- name: install fzf binaries
command:
cmd: ~/.config/zsh/fzf/install --bin
cmd: ~/.local/src/fzf/install --bin

View File

@@ -0,0 +1,5 @@
---
- name: install homebrew package
homebrew:
name: fzf
state: latest

View File

@@ -0,0 +1,13 @@
---
- name: clone fzf repo
git:
repo: https://github.com/junegunn/fzf.git
dest: ~/.local/src/fzf
notify: install fzf binaries
- meta: flush_handlers
- name: create symbolic links
file:
state: link
src: ~/.local/src/fzf/bin/fzf
dest: ~/.local/bin/fzf

View File

@@ -0,0 +1,6 @@
---
- name: install apt package
become: true
apt:
name: fzf
state: latest

View File

@@ -0,0 +1,5 @@
---
- name: install chocolatey package
win_chocolatey:
name: fzf
state: latest

View File

@@ -0,0 +1,2 @@
---
- include_tasks: '{{ansible_os_family}}.yaml'

View File

@@ -0,0 +1,6 @@
---
- name: install apt package
become: true
apt:
name: gdb
state: latest

View File

@@ -0,0 +1,11 @@
---
- set_fact:
gdb_config_dir: '{{ansible_env.HOME}}/.config/gdb'
- name: create config directory
file:
path: '{{gdb_config_dir}}'
state: directory
- set_fact:
gdb_config_file: '{{gdb_config_dir}}/gdbinit'

34
roles/gdb/tasks/main.yaml Normal file
View File

@@ -0,0 +1,34 @@
---
- include_tasks: '{{ansible_os_family}}.yaml'
# gdb 11.1 introduced support for config files that respect the XDG base
# directory spec, handle the boths paths dependant on the gdb version install.
- name: get installed version
command: gdb --version
register: gdb_version_output
changed_when: false
- set_fact:
gdb_version: '{{gdb_version_output.stdout | regex_search("(\d+)\.(\d+)", "\1", "\2")}}'
- set_fact:
gdb_xdg_base_dir_check:
gdb_version[0] | int > 11 or (
gdb_version[0] | int == 11 and gdb_version[1] | int == 1
)
- set_fact:
gdb_config_file: '{{ansible_env.HOME}}/.gdbinit'
gdb_state_dir: '{{ansible_env.HOME}}/.local/state/gdb'
- when: gdb_xdg_base_dir_check
include_tasks: gdb-11.1-config.yaml
- name: create config file
template:
src: gdbinit
dest: '{{gdb_config_file}}'
- name: create state directory
file:
path: '{{gdb_state_dir}}'
state: directory

View File

@@ -0,0 +1,3 @@
# Enable saving command history
set history filename {{gdb_state_dir}}/history
set history save on

View File

@@ -0,0 +1,34 @@
---
- name: get json containing all releases
win_uri:
url: 'https://api.github.com/repos/git-for-windows/git/releases/tags/v{{git_version}}.windows.1'
return_content: true
register: git_release
- set_fact:
git_installer_exe: 'Git-{{git_version}}-64-bit.exe'
- set_fact:
git_asset_query: '[?contains(name, `{{git_installer_exe}}`)] | [0]'
git_installer_path: '{{ansible_env.TEMP}}/{{git_installer_exe}}'
- name: select asset from release
set_fact:
git_asset: '{{git_release.json.assets | json_query(git_asset_query)}}'
- name: download installer
win_get_url:
url: '{{git_asset.browser_download_url}}'
dest: '{{git_installer_path}}'
- name: run installer command
win_command:
argv:
- '{{git_installer_path}}'
- '/GitAndUnixToolsOnPath'
- '/NoShellIntegration'
- '/NoGuiHereIntegration'
- '/NoCredentialManager'
- '/NoOpenSSH'
- '/Silent'
- '/SuppressMsgBoxes'
- '/NoCancel'
- '/NoRestart'

View File

@@ -1,9 +1,49 @@
---
# Pinned to 2.36.1 because the unofficial win_git module hangs when using
# 2.37.3, this is either a breaking change in 2.37.x or an incompatibility with
# the win_git module. The git chocolatey package does not respect the version
# argument and always installs the most recent version, so instead download the
# installer from GitHub and install manually.
- set_fact:
git_version: 2.36.1
git_cli_exe: '{{ansible_env.ProgramFiles}}/Git/cmd/git.exe'
git_run_installer: false
- name: detect if Git for Windows is installed
win_stat:
path: '{{git_cli_exe}}'
register: git_cli_stat
- when: not git_cli_stat.stat.exists
set_fact:
git_run_installer: true
- name: check installed version
when: git_cli_stat.stat.exists
win_command: '"{{git_cli_exe}}" --version'
register: git_cli_version
changed_when: false
- when: git_cli_stat.stat.exists and git_version not in git_cli_version.stdout
set_fact:
git_run_installer: true
- include_tasks: Windows-installer.yaml
when: git_run_installer
- name: clone config repos
win_git:
repo: '{{item.repo}}'
dest: '{{ansible_env.USERPROFILE}}/.config/{{item.name}}'
version: master
with_items: '{{git_config_repos}}'
- win_owner:
path: '{{ansible_env.USERPROFILE}}/.config/{{item.name}}'
user: Benie
recurse: true
with_items: '{{git_config_repos}}'
# TODO: - name: install pip packages
# - TODO: install pip packages
# win_pip:
# name: '{{git_pip_packages}}'
# state: latest

View File

@@ -0,0 +1,5 @@
---
- name: install homebrew package
homebrew:
name: htop
state: latest

View File

@@ -0,0 +1,6 @@
---
- name: install apt package
become: true
apt:
name: htop
state: latest

View File

@@ -0,0 +1,2 @@
---
- include_tasks: '{{ansible_os_family}}.yaml'

View File

@@ -0,0 +1,38 @@
---
- name: get latest github release
uri:
url: https://api.github.com/repos/jmespath/jp/releases/latest
register: latest
# TODO: Support arm64
- set_fact:
asset_query: '[?contains(name, `jp-darwin-amd64`)] | [0]'
assets: '{{latest.json.assets}}'
latest_version: '{{latest.json.tag_name}}'
jp_exe: '{{ansible_env.HOME}}/.local/bin/jp'
- name: check if already installed
stat:
path: '{{jp_exe}}'
register: jp_exe
- name: get installed version
when: jp_stat.stat.exists == True
command: '{{jp_exe}} --version'
register: jp_version_output
changed_when: false
- when: jp_stat.stat.exists == True
set_fact:
installed_version:
'{{jp_version_output.stdout.strip() | regex_replace("^.*(\d+\.\d+\.\d+).*$", "\1")}}'
- set_fact:
asset: '{{assets | to_json | from_json | json_query(asset_query)}}'
- name: download executable
when: installed_version is not defined or installed_version != latest_version
get_url:
url: '{{asset.browser_download_url}}'
dest: '{{jp_exe}}'
mode: +x

View File

@@ -0,0 +1,6 @@
---
- name: install apt package
become: true
apt:
name: jp
state: latest

4
roles/jp/tasks/main.yaml Normal file
View File

@@ -0,0 +1,4 @@
---
- assert:
that: ansible_os_family != "Windows"
- include_tasks: '{{ansible_os_family}}.yaml'

View File

@@ -0,0 +1,5 @@
---
- name: install homebrew package
homebrew:
name: jq
state: latest

View File

@@ -0,0 +1,5 @@
---
- name: install apt package
apt:
name: jq
state: latest

View File

@@ -0,0 +1,5 @@
---
- name: install chocolatey package
win_chocolatey:
name: jq
state: latest

2
roles/jq/tasks/main.yaml Normal file
View File

@@ -0,0 +1,2 @@
---
- include_tasks: '{{ansible_os_family}}.yaml'

View File

@@ -0,0 +1,5 @@
---
- name: install homebrew package
homebrew:
name: llvm
state: latest

View File

@@ -0,0 +1,13 @@
---
- name: install apt packages
become: true
apt:
name:
- clang
- clang-format
- clang-tidy
- clang-tools
- clangd
- llvm
state: latest
install_recommends: true

View File

@@ -0,0 +1,66 @@
---
- name: get latest stable github release
uri:
url: https://api.github.com/repos/llvm/llvm-project/releases/latest
register: llvm_latest
- set_fact:
llvm_major_version:
'{{llvm_latest.json.tag_name[8:llvm_latest.json.tag_name.find(".")]}}'
- set_fact:
llvm_apt_repo_url:
'http://apt.llvm.org/{{ansible_distribution_release}}/'
llvm_apt_category:
'llvm-toolchain-{{ansible_distribution_release}}-{{llvm_major_version}}'
- name: add upstream deb repository
become: true
apt_repository:
repo: 'deb {{llvm_apt_repo_url}} {{llvm_apt_category}} main'
state: present
filename: llvm
update_cache: false
- name: add upstream deb-src repository
become: true
apt_repository:
repo: 'deb-src {{llvm_apt_repo_url}} {{llvm_apt_category}} main'
state: present
filename: llvm
update_cache: false
- name: add apt repository key
become: true
apt_key:
url: https://apt.llvm.org/llvm-snapshot.gpg.key
id: 6084F3CF814B57C1CF12EFD515CF4D18AF4F7421
state: present
- name: update apt cache
become: true
apt:
update_cache: true
- name: install apt packages
become: true
apt:
name:
- clang-{{llvm_major_version}}
- clang-format-{{llvm_major_version}}
- clang-tidy-{{llvm_major_version}}
- clang-tools-{{llvm_major_version}}
- clangd-{{llvm_major_version}}
- llvm-{{llvm_major_version}}
state: latest
install_recommends: true
- name: update alternatives
become: true
alternatives:
link: '/usr/bin/{{item}}'
name: '{{item}}'
path: '/usr/bin/{{item}}-{{llvm_major_version}}'
priority: '{{llvm_major_version}}0'
with_items:
- clang-format
- clangd

View File

@@ -0,0 +1,5 @@
---
- name: install chocolatey package
win_chocolatey:
name: llvm
state: latest

View File

@@ -0,0 +1,5 @@
---
- include_tasks: '{{ansible_os_family}}.yaml'
when: ansible_os_family in ['Darwin', 'Windows']
- include_tasks: '{{ansible_distribution}}.yaml'
when: ansible_os_family not in ['Darwin', 'Windows']

View File

@@ -0,0 +1,5 @@
---
- name: install chocolatey package
win_chocolatey:
name: moonlight-qt
state: latest

View File

@@ -0,0 +1,2 @@
---
- include_tasks: '{{ansible_os_family}}.yaml'

View File

@@ -1,23 +1,7 @@
---
- name: install homebrew packages
homebrew:
name:
- neovim
- llvm
- node
- the_silver_searcher
name: neovim
state: latest
- name: clone config repo
git:
repo: git@code.infektor.net:config/vim.git
dest: ~/.config/nvim
version: master
# TODO: - name: set repo email
- name: install pip packages
pip:
name: '{{neovim_pip_packages}}'
state: latest
extra_args: --user
- include_tasks: Unix.yaml

View File

@@ -2,52 +2,7 @@
- name: install apt package
become: true
apt:
name:
- neovim
- clang-format
- clang-tidy
- clangd
- silversearcher-ag
name: neovim
state: latest
- name: clone config repo
git:
repo: git@code.infektor.net:config/vim.git
dest: ~/.config/nvim
version: master
# TODO: - name: set repo email
- name: install pip packages
pip:
name: '{{neovim_pip_packages}}'
state: latest
extra_args: --user
- name: nodejs get json containing latest version
uri:
url: https://nodejs.org/dist/index.json
register: latest
- name: nodejs create directory for downloaded package
file:
state: directory
dest: ~/.local/src
- name: nodejs download latest package
get_url:
url: 'https://nodejs.org/dist/{{latest.json[0].version}}/node-{{latest.json[0].version}}-linux-x64.tar.gz'
dest: ~/.local/src/node.tar.gz
- name: nodejs extract downloaded package
unarchive:
src: ~/.local/src/node.tar.gz
dest: ~/.local/src
remote_src: true
- name: nodejs create symlink links
file:
state: link
src: '~/.local/src/node-{{latest.json[0].version}}-linux-x64/bin/{{item}}'
dest: '~/.local/bin/{{item}}'
with_items: [corepack, node, npm, npx]
- include_tasks: Unix.yaml

View File

@@ -0,0 +1,36 @@
---
- name: clone plugin repos
git:
repo: 'https://github.com/{{item.repo}}.git'
dest: '{{plugin_dir}}/{{item.mode | default("start")}}/{{item.repo | regex_replace("^.*\/(.*)$", "\1")}}'
version: '{{item.branch | default("HEAD")}}'
with_items: '{{plugins}}'
- name: get list of managed plugin paths
set_fact:
managed_plugins: >-
{{
managed_plugins | default([]) + [
plugin_dir + "/" +
item.mode | default("start") + "/" +
item.repo | regex_replace("^.*\/(.*)$", "\1")
]
}}
with_items: '{{plugins}}'
- name: find all installed plugin directories
find:
paths:
- '{{plugin_dir}}/start'
- '{{plugin_dir}}/opt'
file_type: directory
register: found_plugins
- name: remove found plugins which are not in the managed list
file:
path: '{{item.path}}'
state: absent
with_items: '{{found_plugins.files}}'
when: item.path not in managed_plugins
loop_control:
label: '{{item.path}}'

View File

@@ -0,0 +1,28 @@
---
- set_fact:
vim_config_dir: '{{ansible_env.HOME}}/.config/nvim'
- name: clone config repo
git:
repo: git@code.infektor.net:config/vim.git
dest: '{{vim_config_dir}}'
version: master
# TODO: - name: set repo email
- name: install pip packages
pip:
name: '{{neovim_pip_packages}}'
state: latest
extra_args: --user
- name: check for config repo tasks.yaml
stat:
path: '{{vim_config_dir}}/tasks.yaml'
register: config_repo_tasks
- when: config_repo_tasks.stat.exists
include_tasks: '{{vim_config_dir}}/tasks.yaml'
- when: plugin_dir is defined and plugins is defined
include_tasks: 'Unix-plugins.yaml'

View File

@@ -0,0 +1,36 @@
---
- name: clone plugin repos
win_git:
repo: 'https://github.com/{{item.repo}}.git'
dest: '{{plugin_dir}}/{{item.mode | default("start")}}/{{item.repo | regex_replace("^.*\/(.*)$", "\1")}}'
branch: '{{item.branch | default("HEAD")}}'
with_items: '{{plugins}}'
- name: get list of managed plugin paths
set_fact:
managed_plugins: >-
{{
managed_plugins | default([]) + [
plugin_dir + "/" +
item.mode | default("start") + "/" +
item.repo | regex_replace("^.*\/(.*)$", "\1")
]
}}
with_items: '{{plugins}}'
- name: find all start plugin directories
win_find:
paths:
- '{{plugin_dir}}/start'
- '{{plugin_dir}}/opt'
file_type: directory
register: found_plugins
- name: remove found plugins which are not in the managed list
win_file:
path: '{{item.path}}'
state: absent
with_items: '{{found_plugins.files}}'
when: item.path not in managed_plugins
loop_control:
label: '{{item.path}}'

View File

@@ -1,28 +1,62 @@
---
- name: install choco packages
- name: install chocolatey packages
win_chocolatey:
name:
- neovim
- ag
- llvm
- nodejs
name: neovim
state: latest
- set_fact:
vim_config_dir: '{{ansible_env.LOCALAPPDATA}}\nvim'
- name: clone config repo
win_git:
repo: git@code.infektor.net:config/vim.git
dest: '{{ansible_env.LOCALAPPDATA}}/nvim'
version: master
dest: '{{vim_config_dir}}'
branch: master
# clone: false
update: true
- win_owner:
path: '{{vim_config_dir}}'
user: Benie
recurse: true
# TODO: - name: neovim set repo email
# win_git_config:
# TODO: - name: neovim install pip packages
# win_pip:
# name: '{{neovim_pip_packages}}'
# state: latest
- assert:
that: False
# - TODO: neovim set repo email
# win_git_config:
# - TODO: neovim install pip packages
# win_pip:
# name: '{{neovim_pip_packages}}'
# state: latest
- name: create nvim start menu shortcut
win_shortcut:
src: '{{ansible_env.ChocolateyToolsLocation}}/neovim/nvim-win64/bin/nvim-qt.exe'
dest: '{{ansible_env.ProgramData}}/Microsoft/Windows/Start Menu/Programs/nvim.lnk'
dest: '{{ansible_env.ProgramData}}/Microsoft/Windows/Start Menu/Programs/nvim-qt.lnk'
icon: '{{ansible_env.ChocolateyToolsLocation}}/neovim/nvim-win64/bin/nvim-qt.exe,0'
directory: '{{ansible_env.USERPROFILE}}'
- name: check for config repo tasks.yaml
win_stat:
path: '{{vim_config_dir}}/tasks.yaml'
register: config_repo_tasks
# TODO: this doesn't work for non localhost setups
# probably need to copy the tasks.yaml and plugins.yaml to the controller in a
# temporary directory then include them
- when: config_repo_tasks.stat.exists
fetch:
src: '{{vim_config_dir}}/tasks.yaml'
dest: vim_config_tasks.yaml
flat: true
- when: config_repo_tasks.stat.exists
include_tasks: vim_config_tasks.yaml
- when: ansible_os_family != "Windows" and
plugin_dir is defined and plugins is defined
include_tasks: 'Unix-plugins.yaml'
- when: ansible_os_family == "Windows" and
plugin_dir is defined and plugins is defined
include_tasks: 'Windows-plugins.yaml'

View File

@@ -0,0 +1,5 @@
---
- name: install homebrew package
homebrew:
name: node
state: latest

View File

@@ -0,0 +1,28 @@
---
- name: get json containing latest version
uri:
url: https://nodejs.org/dist/index.json
register: latest
- name: create directory for downloaded package
file:
state: directory
dest: ~/.local/src/node
- name: download latest package
get_url:
url: 'https://nodejs.org/dist/{{latest.json[0].version}}/node-{{latest.json[0].version}}-linux-x64.tar.gz'
dest: ~/.local/src/node/node.tar.gz
- name: extract downloaded package
unarchive:
src: ~/.local/src/node/node.tar.gz
dest: ~/.local/src/node
remote_src: true
- name: create symbolic links
file:
state: link
src: '~/.local/src/node/node-{{latest.json[0].version}}-linux-x64/bin/{{item}}'
dest: '~/.local/bin/{{item}}'
with_items: [corepack, node, npm, npx]

View File

@@ -0,0 +1,5 @@
---
- name: install chocolatey package
win_chocolatey:
name: nodejs
state: latest

View File

@@ -0,0 +1,2 @@
---
- include_tasks: '{{ansible_os_family}}.yaml'

View File

@@ -0,0 +1,11 @@
---
- name: install homebrew package
homebrew:
name: obsidian
state: latest
- name: clone notes repository
git:
repo: git@github.com:kbenzie/notes.git
dest: '{{ansible_env.HOME}}/Documents/Notes'
branch: main

View File

@@ -0,0 +1,18 @@
---
- set_fact:
obsidian_notes_repo: '{{ansible_env.USERPROFILE}}/Documents/Notes'
- name: install chocolatey package
win_chocolatey:
name: obsidian
state: latest
- name: clone notes repository
win_git:
repo: git@github.com:kbenzie/notes.git
dest: '{{obsidian_notes_repo}}'
branch: main
- win_owner:
path: '{{obsidian_notes_repo}}'
user: Benie
recurse: true

View File

@@ -0,0 +1,2 @@
---
- include_tasks: '{{ansible_os_family}}.yaml'

View File

@@ -1,16 +1,44 @@
---
- set_fact:
powershell_config_dir:
'{{ansible_env.USERPROFILE}}/Documents/WindowsPowerShell'
- name: clone config repos
win_git:
repo: git@code.infektor.net:config/WindowsPowerShell.git
dest: '{{ansible_env.USERPROFILE}}/Documents/WindowsPowerShell'
dest: '{{powershell_config_dir}}'
branch: master
- win_owner:
path: '{{powershell_config_dir}}'
user: Benie
recurse: true
- name: install chocolatey package
win_chocolatey:
name: Cmder
name: Cmder
state: latest
- name: get NuGet package provider
ansible.windows.win_powershell:
script:
Get-PackageProvider -Name NuGet
changed_when: false
register: nuget_package_provider
- name: install NuGet package provider
when: nuget_package_provider.error | length > 0
ansible.windows.win_powershell:
script: |
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
- name: install PsReadline module
win_psmodule:
name: PsReadline
state: latest
accept_license: true
- name: install posh-git module
win_psmodule:
name: posh-git
state: latest
accept_license: true

View File

@@ -0,0 +1,8 @@
---
- assert:
that: ansible_os_family == 'Windows'
- name: install chocolatey package
win_chocolatey:
name: powertoys
state: present

View File

@@ -0,0 +1,8 @@
---
- assert:
that: ansible_os_family == "Windows"
- name: install chocolatey package
win_chocolatey:
name: prusaslicer
state: latest

View File

@@ -1,8 +1,10 @@
---
- name: install apt packages
become: true
apt:
name:
- python-is-python3
- python3
- python3-pip
- python3-venv
- python3-virtualenv
- python-is-python3

View File

@@ -0,0 +1,5 @@
---
- name: create .inputrc config file
template:
src: inputrc
dest: '{{ansible_env.HOME}}/.inputrc'

View File

@@ -0,0 +1,11 @@
# Enable vi mode
set editing-mode vi
# Insert mode mappings
set keymap vi-insert
"\C-[": vi-movement-mode
# Change cursor shape on vi mode change
set show-mode-in-prompt on
set vi-cmd-mode-string "\1\e[2 q\2"
set vi-ins-mode-string "\1\e[6 q\2"

View File

@@ -0,0 +1,12 @@
---
- assert:
that: ansible_user_id != "root"
- name: create /etc/sudoers.d/{user} config file
become: true
template:
src: sudoers
dest: '/etc/sudoers.d/{{ansible_user_id}}'
owner: root
group: root
mode: '0440'

View File

@@ -0,0 +1 @@
{{ansible_user_id}} ALL=(ALL) NOPASSWD:ALL

View File

@@ -0,0 +1,4 @@
---
# TODO:
# cp $script_dir/system-info.plist ~/Library/LaunchAgents/system-info.plist
# launchctl load -w ~/Library/LaunchAgents/system-info.plist

View File

@@ -0,0 +1,25 @@
---
- name: install apt packages
become: true
apt:
name:
- gawk
- sysstat
state: latest
- name: create systemd user unit directory
file:
state: directory
dest: ~/.config/systemd/user
- name: install system-info systemd unit
copy:
src: ~/.config/tmux/system-info/system-info.service
dest: ~/.config/systemd/user/system-info.service
- name: enable system-info service
systemd:
name: system-info
scope: user
enabled: true
state: started

View File

@@ -0,0 +1,58 @@
---
- name: install chocolatey packages
win_chocolatey:
name: openhardwaremonitor
state: latest
# - TODO: update config file
# C:\ProgramData\chocolatey\lib\OpenHardwareMonitor\tools\OpenHardwareMonitor\OpenHardwareMonitor.config
- name: create OpenHardwareMonitor scheduled task
win_scheduled_task:
path: Benie
name: OpenHardwareMonitor
state: present
enable: true
triggers:
- type: logon
enabled: true
- type: registration
enabled: true
actions:
- path: '{{openhardwaremonitor_exe}}'
working_directory: '{{openhardwaremonitor_install_dir}}'
disallow_start_if_on_batteries: false
stop_if_going_on_batteries: false
execution_time_limit: PT0S
logon_type: interactive_token
multiple_instances: 3
run_level: highest
start_when_available: true
wake_to_run: false
- name: create system-info-WSL.sh scheduled task
win_scheduled_task:
path: Benie
name: system-info-WSL.sh
state: present
enable: true
triggers:
- type: logon
enabled: true
- type: registration
enabled: true
actions:
- path: '{{wsl_exe}}'
arguments: '-d Debian -e /home/benie/.config/tmux/system-info/system-info-WSL.sh'
disallow_start_if_on_batteries: false
stop_if_going_on_batteries: false
execution_time_limit: PT0S
logon_type: password
username: '{{ansible_user}}'
password: '{{ansible_password}}'
multiple_instances: 3
run_level: limited
start_when_available: true
wake_to_run: false
# - TODO: configure firewall

View File

@@ -0,0 +1,2 @@
---
- include_tasks: '{{ansible_os_family}}.yaml'

View File

@@ -0,0 +1,5 @@
---
openhardwaremonitor_exe: 'OpenHardwareMonitor.exe'
openhardwaremonitor_install_dir: '{{ansible_env.ProgramData}}\chocolatey\lib\OpenHardwareMonitor\tools\OpenHardwareMonitor'
wsl_exe: '{{ansible_env.SystemRoot}}/System32/wsl.exe'

View File

@@ -0,0 +1,5 @@
---
- name: install homebrew package
homebrew:
name: tidy-html5
state: latest

View File

@@ -0,0 +1,6 @@
---
- name: install apt package
become: true
apt:
name: tidy
state: latest

View File

@@ -0,0 +1,2 @@
---
- include_tasks: '{{ansible_os_family}}.yaml'

View File

@@ -9,31 +9,4 @@
# TODO: - name: set repo email
- name: create layouts directory
file:
state: directory
dest: ~/.local/share/tmux/layouts
- name: create symbolic links
file:
state: link
src: '{{item.src}}'
dest: '{{item.dest}}'
with_items:
- src: ~/.config/tmux/tmux.conf
dest: ~/.tmux.conf
- src: ~/.config/tmux/layouts/session-main
dest: ~/.local/share/tmux/layouts/session-main
- src: ~/.config/tmux/layouts/window-tall
dest: ~/.local/share/tmux/layouts/window-tall
- src: ~/.config/tmux/layouts/window-wide-left
dest: ~/.local/share/tmux/layouts/window-wide-left
- src: ~/.config/tmux/layouts/window-wide-right
dest: ~/.local/share/tmux/layouts/window-wide-right
# TODO: - name: Enable tmux system-info service
# command: system-info/install.sh
# TODO: WSL2 system-info
# when: '"WSL" in ansible_kernel'
# figure out best way to run daemon...
- include_tasks: ~/.config/tmux/tasks.yaml

View File

@@ -0,0 +1,5 @@
---
- name: install homebrew pacakge
homebrew:
name: tree
state: latest

View File

@@ -0,0 +1,6 @@
---
- name: install apt package
become: true
apt:
name: tree
state: latest

View File

@@ -0,0 +1,5 @@
---
- name: install chocolatey package
win_chocolatey:
name: tree
state: latest

View File

@@ -0,0 +1,2 @@
---
- include_tasks: '{{ansible_os_family}}.yaml'

View File

@@ -0,0 +1,5 @@
---
- name: install homebrew package
homebrew:
name: wget
state: latest

View File

@@ -0,0 +1,5 @@
---
- name: install apt package
apt:
name: wget
state: latest

View File

@@ -0,0 +1,16 @@
---
- include_tasks: '{{ansible_os_family}}.yaml'
- name: create directories
file:
state: directory
dest: '{{item}}'
with_items:
- ~/.config/wget
- ~/.cache/wget
- name: create config file
copy:
content: |
hsts-file = {{ansible_env.HOME}}/.cache/wget/hsts
dest: ~/.config/wget/rc

View File

@@ -0,0 +1,31 @@
---
- name: get list of existing actions
set_fact:
actions: '{{settings.actions}}'
action_keys: '{{settings.actions | json_query("[].keys")}}'
- name: add next tab action key mapping
when: '"alt+shift+]" not in action_keys'
set_fact:
actions: >-
{{
actions + [{
"command": {"action": "nextTab", "tabSwitcherMode": "disabled"},
"keys": "alt+shift+]"
}]
}}
- name: add previous tab action key mapping
when: '"alt+shift+[" not in action_keys'
set_fact:
actions: >-
{{
actions + [{
"command": {"action": "prevTab", "tabSwitcherMode": "disabled"},
"keys": "alt+shift+["
}]
}}
- name: set actions in settings
set_fact:
settings: '{{settings | combine({"actions": actions})}}'

View File

@@ -0,0 +1,17 @@
---
- name: read settings.json file
slurp:
src: '{{windows_terminal_settings_json}}'
register: slurped_settings
- name: decode settings into fact
set_fact:
settings: '{{slurped_settings.content | b64decode | from_json}}'
- import_tasks: actions.yaml
# TODO: - import_tasks: profiles.yaml
- name: write settings.json file
copy:
content: '{{settings | to_nice_json}}'
dest: '{{windows_terminal_settings_json}}'

View File

@@ -0,0 +1,5 @@
---
# TODO: defaults
# TODO: modify powershell commandline
# TODO: modify command prompt commandline
# TODO: modify debian icon

View File

@@ -0,0 +1,5 @@
---
windows_terminal_local_app_data:
'{{ansible_env.LOCALAPPDATA}}/Packages/Microsoft.WindowsTerminal_8wekyb3d8bbwe'
windows_terminal_settings_json:
'{{windows_terminal_local_app_data}}/LocalState/settings.json'

Some files were not shown because too many files have changed in this diff Show More