Compare commits
35 Commits
18.04
...
5728aba7df
| Author | SHA1 | Date | |
|---|---|---|---|
| 5728aba7df | |||
| 76b6d63064 | |||
| 189371d7f2 | |||
| 491a9a07b5 | |||
| c4e87f2022 | |||
| 09e7ec3ad4 | |||
| c596fcb87a | |||
| 441343fd7c | |||
| 1184062dc7 | |||
| d172e171b2 | |||
| 651909ff71 | |||
| 60a147124f | |||
| 3aa7bcfa2e | |||
| 01c1ca74a3 | |||
| f4bcbbbe09 | |||
| 69cb941a85 | |||
| f7a5e3728f | |||
| d1cfa8c98e | |||
| 64ecd88c93 | |||
| 7642c62ecf | |||
| 1117ca00f7 | |||
| de8c0a119d | |||
| 2eaf11b8a5 | |||
| bcbaa9dfcf | |||
| d6e09f2317 | |||
| 179273c22b | |||
| 51d48f7f49 | |||
| c2f1cd3201 | |||
| c9d2e66438 | |||
| f6e60b8417 | |||
| e1745bd162 | |||
| 44c1e5ccff | |||
| 5dfb92522e | |||
| 14c14353f8 | |||
| 3061ade54f |
12
.vim/coc-settings.json
Normal file
12
.vim/coc-settings.json
Normal 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"
|
||||
]
|
||||
}
|
||||
}
|
||||
24
Unix.yaml
Normal file
24
Unix.yaml
Normal file
@@ -0,0 +1,24 @@
|
||||
---
|
||||
- hosts: localhost
|
||||
|
||||
roles:
|
||||
- role: zsh
|
||||
- role: neovim
|
||||
- role: tmux
|
||||
- role: system-info
|
||||
when: '"WSL" not in ansible_kernel'
|
||||
|
||||
- role: ag
|
||||
- role: bat
|
||||
- role: fzf
|
||||
- role: git
|
||||
- role: tree
|
||||
|
||||
- role: llvm
|
||||
- role: nodejs
|
||||
- role: python
|
||||
|
||||
- role: 1password
|
||||
|
||||
- role: wsl
|
||||
when: '"WSL" in ansible_kernel'
|
||||
3
WSL.yaml
Normal file
3
WSL.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
---
|
||||
- import_playbook: Unix.yaml
|
||||
- import_playbook: Windows.yaml
|
||||
23
Windows.yaml
Normal file
23
Windows.yaml
Normal file
@@ -0,0 +1,23 @@
|
||||
---
|
||||
- hosts: windows
|
||||
|
||||
roles:
|
||||
- role: powershell
|
||||
- role: neovim
|
||||
- role: system-info
|
||||
|
||||
- role: ag
|
||||
- role: bat
|
||||
- role: fzf
|
||||
- role: git
|
||||
- role: tree
|
||||
|
||||
- role: llvm
|
||||
- role: nodejs
|
||||
- role: python
|
||||
|
||||
- role: 1password
|
||||
- role: autohotkey
|
||||
- role: firefox
|
||||
- role: obsidian
|
||||
- role: windows-terminal
|
||||
7
macOS.yaml
Normal file
7
macOS.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
- import_playbook: Unix.yaml
|
||||
|
||||
- hosts: localhost
|
||||
|
||||
roles:
|
||||
- role: obsidian
|
||||
@@ -1,5 +1,9 @@
|
||||
---
|
||||
- name: install homebrew package
|
||||
homebrew_cask:
|
||||
name: 1password
|
||||
name:
|
||||
- 1password
|
||||
- 1password-cli
|
||||
state: latest
|
||||
|
||||
- include_tasks: zsh-completion.yaml
|
||||
|
||||
@@ -1 +1,38 @@
|
||||
# TODO: https://support.1password.com/install-linux/#debian-or-ubuntu
|
||||
---
|
||||
- name: add apt signing key
|
||||
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
|
||||
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
|
||||
become: true
|
||||
apt:
|
||||
name: 1password-cli
|
||||
state: latest
|
||||
|
||||
- include_tasks: zsh-completion.yaml
|
||||
|
||||
@@ -1,12 +1,107 @@
|
||||
---
|
||||
- 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: op 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'
|
||||
|
||||
10
roles/1password/tasks/zsh-completion.yaml
Normal file
10
roles/1password/tasks/zsh-completion.yaml
Normal 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
|
||||
5
roles/ag/tasks/Darwin.yaml
Normal file
5
roles/ag/tasks/Darwin.yaml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
- name: install homebrew package
|
||||
apt:
|
||||
name: the_silver_searcher
|
||||
state: latest
|
||||
6
roles/ag/tasks/Debian.yaml
Normal file
6
roles/ag/tasks/Debian.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
- name: install apt package
|
||||
become: true
|
||||
apt:
|
||||
name: silversearcher-ag
|
||||
state: latest
|
||||
5
roles/ag/tasks/Windows.yaml
Normal file
5
roles/ag/tasks/Windows.yaml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
- name: install chocolatey package
|
||||
win_chocolatey:
|
||||
name: ag
|
||||
state: latest
|
||||
2
roles/ag/tasks/main.yaml
Normal file
2
roles/ag/tasks/main.yaml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
- include_tasks: '{{ansible_os_family}}.yaml'
|
||||
@@ -7,8 +7,27 @@
|
||||
- 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
|
||||
|
||||
# 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
|
||||
|
||||
2
roles/autohotkey/vars/main.yaml
Normal file
2
roles/autohotkey/vars/main.yaml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
autohotkey_repo_dir: '{{ansible_env.LOCALAPPDATA}}/AutoHotKey'
|
||||
5
roles/bat/tasks/Darwin.yaml
Normal file
5
roles/bat/tasks/Darwin.yaml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
- name: install homebrew package
|
||||
homebrew:
|
||||
name: bat
|
||||
state: latest
|
||||
13
roles/bat/tasks/Debian.yaml
Normal file
13
roles/bat/tasks/Debian.yaml
Normal 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
|
||||
5
roles/bat/tasks/Windows.yaml
Normal file
5
roles/bat/tasks/Windows.yaml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
- name: install chocolatey package
|
||||
win_chocolatey:
|
||||
name: Bat
|
||||
state: latest
|
||||
13
roles/bat/tasks/apt.yaml
Normal file
13
roles/bat/tasks/apt.yaml
Normal 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
65
roles/bat/tasks/deb.yaml
Normal 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
|
||||
2
roles/bat/tasks/main.yaml
Normal file
2
roles/bat/tasks/main.yaml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
- include_tasks: '{{ansible_os_family}}.yaml'
|
||||
100
roles/distrobox/files/_distrobox
Normal file
100
roles/distrobox/files/_distrobox
Normal 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 "$@"
|
||||
15
roles/distrobox/tasks/main.yaml
Normal file
15
roles/distrobox/tasks/main.yaml
Normal 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'
|
||||
14
roles/firefox/tasks/Windows.yaml
Normal file
14
roles/firefox/tasks/Windows.yaml
Normal 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
|
||||
2
roles/firefox/tasks/main.yaml
Normal file
2
roles/firefox/tasks/main.yaml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
- include_tasks: '{{ansible_os_family}}.yaml'
|
||||
@@ -1,4 +1,4 @@
|
||||
---
|
||||
- name: install fzf binaries
|
||||
command:
|
||||
cmd: ~/.config/zsh/fzf/install --bin
|
||||
cmd: ~/.local/src/fzf/install --bin
|
||||
5
roles/fzf/tasks/Darwin.yaml
Normal file
5
roles/fzf/tasks/Darwin.yaml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
- name: install homebrew package
|
||||
homebrew:
|
||||
name: fzf
|
||||
state: latest
|
||||
13
roles/fzf/tasks/Debian-old.yaml
Normal file
13
roles/fzf/tasks/Debian-old.yaml
Normal 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
|
||||
12
roles/fzf/tasks/Debian.yaml
Normal file
12
roles/fzf/tasks/Debian.yaml
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
- name: install apt package
|
||||
when: ansible_distribution == "Debian" and
|
||||
ansible_distribution_version == "unstable"
|
||||
become: true
|
||||
apt:
|
||||
name: fzf
|
||||
state: latest
|
||||
|
||||
- include_tasks: Debian-old.yaml
|
||||
when: not (ansible_distribution == "Debian" and
|
||||
ansible_distribution_version == "unstable")
|
||||
5
roles/fzf/tasks/Windows.yaml
Normal file
5
roles/fzf/tasks/Windows.yaml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
- name: install chocolatey package
|
||||
win_chocolatey:
|
||||
name: fzf
|
||||
state: latest
|
||||
2
roles/fzf/tasks/main.yaml
Normal file
2
roles/fzf/tasks/main.yaml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
- include_tasks: '{{ansible_os_family}}.yaml'
|
||||
@@ -1,4 +1,15 @@
|
||||
---
|
||||
- name: install chocolatey package
|
||||
win_chocolatey:
|
||||
name: git
|
||||
package_params: >-
|
||||
/GitAndUnixToolsOnPath
|
||||
/NoShellIntegration
|
||||
/NoGuiHereIntegration
|
||||
/NoCredentialManager
|
||||
/NoOpenSSH
|
||||
state: latest
|
||||
|
||||
- name: clone config repos
|
||||
win_git:
|
||||
repo: '{{item.repo}}'
|
||||
@@ -6,4 +17,7 @@
|
||||
version: master
|
||||
with_items: '{{git_config_repos}}'
|
||||
|
||||
# TODO: - name: install pip packages
|
||||
# - TODO: install pip packages
|
||||
# win_pip:
|
||||
# name: '{{git_pip_packages}}'
|
||||
# state: latest
|
||||
|
||||
5
roles/llvm/tasks/Darwin.yaml
Normal file
5
roles/llvm/tasks/Darwin.yaml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
- name: install homebrew package
|
||||
homebrew:
|
||||
name: llvm
|
||||
state: latest
|
||||
13
roles/llvm/tasks/Debian.yaml
Normal file
13
roles/llvm/tasks/Debian.yaml
Normal 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
|
||||
66
roles/llvm/tasks/Ubuntu.yaml
Normal file
66
roles/llvm/tasks/Ubuntu.yaml
Normal 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
|
||||
5
roles/llvm/tasks/Windows.yaml
Normal file
5
roles/llvm/tasks/Windows.yaml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
- name: install chocolatey package
|
||||
win_chocolatey:
|
||||
name: llvm
|
||||
state: latest
|
||||
5
roles/llvm/tasks/main.yaml
Normal file
5
roles/llvm/tasks/main.yaml
Normal 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']
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
---
|
||||
- name: install choco packages
|
||||
- name: install chocolatey packages
|
||||
win_chocolatey:
|
||||
name:
|
||||
- neovim
|
||||
- ag
|
||||
- llvm
|
||||
- nodejs
|
||||
name: neovim
|
||||
state: latest
|
||||
|
||||
- name: clone config repo
|
||||
@@ -14,15 +10,16 @@
|
||||
dest: '{{ansible_env.LOCALAPPDATA}}/nvim'
|
||||
version: master
|
||||
|
||||
# TODO: - name: neovim set repo email
|
||||
# win_git_config:
|
||||
# TODO: - name: neovim install pip packages
|
||||
# win_pip:
|
||||
# name: '{{neovim_pip_packages}}'
|
||||
# state: latest
|
||||
# - 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}}'
|
||||
|
||||
14
roles/neovim/tasks/unix.yaml
Normal file
14
roles/neovim/tasks/unix.yaml
Normal file
@@ -0,0 +1,14 @@
|
||||
---
|
||||
- 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
|
||||
5
roles/nodejs/tasks/Darwin.yaml
Normal file
5
roles/nodejs/tasks/Darwin.yaml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
- name: install homebrew package
|
||||
homebrew:
|
||||
name: node
|
||||
state: latest
|
||||
28
roles/nodejs/tasks/Debian.yaml
Normal file
28
roles/nodejs/tasks/Debian.yaml
Normal 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]
|
||||
5
roles/nodejs/tasks/Windows.yaml
Normal file
5
roles/nodejs/tasks/Windows.yaml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
- name: install chocolatey package
|
||||
win_chocolatey:
|
||||
name: nodejs
|
||||
state: latest
|
||||
2
roles/nodejs/tasks/main.yaml
Normal file
2
roles/nodejs/tasks/main.yaml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
- include_tasks: '{{ansible_os_family}}.yaml'
|
||||
11
roles/obsidian/tasks/Darwin.yaml
Normal file
11
roles/obsidian/tasks/Darwin.yaml
Normal 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
|
||||
11
roles/obsidian/tasks/Windows.yaml
Normal file
11
roles/obsidian/tasks/Windows.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
---
|
||||
- name: install chocolatey package
|
||||
win_chocolatey:
|
||||
name: obsidian
|
||||
state: latest
|
||||
|
||||
- name: clone notes repository
|
||||
win_git:
|
||||
repo: git@github.com:kbenzie/notes.git
|
||||
dest: '{{ansible_env.USERPROFILE}}/Documents/Notes'
|
||||
branch: main
|
||||
2
roles/obsidian/tasks/main.yaml
Normal file
2
roles/obsidian/tasks/main.yaml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
- include_tasks: '{{ansible_os_family}}.yaml'
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
- name: install chocolatey package
|
||||
win_chocolatey:
|
||||
name: Cmder
|
||||
name: Cmder
|
||||
state: latest
|
||||
|
||||
- name: install PsReadline module
|
||||
|
||||
@@ -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
|
||||
|
||||
4
roles/system-info/tasks/Darwin.yaml
Normal file
4
roles/system-info/tasks/Darwin.yaml
Normal 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
|
||||
25
roles/system-info/tasks/Debian.yaml
Normal file
25
roles/system-info/tasks/Debian.yaml
Normal 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
|
||||
58
roles/system-info/tasks/Windows.yaml
Normal file
58
roles/system-info/tasks/Windows.yaml
Normal 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
|
||||
2
roles/system-info/tasks/main.yaml
Normal file
2
roles/system-info/tasks/main.yaml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
- include_tasks: '{{ansible_os_family}}.yaml'
|
||||
5
roles/system-info/vars/main.yaml
Normal file
5
roles/system-info/vars/main.yaml
Normal 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'
|
||||
5
roles/tree/tasks/Darwin.yaml
Normal file
5
roles/tree/tasks/Darwin.yaml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
- name: install homebrew pacakge
|
||||
homebrew:
|
||||
name: tree
|
||||
state: latest
|
||||
6
roles/tree/tasks/Debian.yaml
Normal file
6
roles/tree/tasks/Debian.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
- name: install apt package
|
||||
become: true
|
||||
apt:
|
||||
name: tree
|
||||
state: latest
|
||||
5
roles/tree/tasks/Windows.yaml
Normal file
5
roles/tree/tasks/Windows.yaml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
- name: install chocolatey package
|
||||
win_chocolatey:
|
||||
name: tree
|
||||
state: latest
|
||||
2
roles/tree/tasks/main.yaml
Normal file
2
roles/tree/tasks/main.yaml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
- include_tasks: '{{ansible_os_family}}.yaml'
|
||||
31
roles/windows-terminal/tasks/actions.yaml
Normal file
31
roles/windows-terminal/tasks/actions.yaml
Normal 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})}}'
|
||||
17
roles/windows-terminal/tasks/main.yaml
Normal file
17
roles/windows-terminal/tasks/main.yaml
Normal 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}}'
|
||||
5
roles/windows-terminal/tasks/profiles.yaml
Normal file
5
roles/windows-terminal/tasks/profiles.yaml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
# TODO: defaults
|
||||
# TODO: modify powershell commandline
|
||||
# TODO: modify command prompt commandline
|
||||
# TODO: modify debian icon
|
||||
5
roles/windows-terminal/vars/main.yaml
Normal file
5
roles/windows-terminal/vars/main.yaml
Normal 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'
|
||||
@@ -1,17 +1,38 @@
|
||||
---
|
||||
- name: install apt packages
|
||||
become: true
|
||||
apt:
|
||||
name: sshpass
|
||||
state: latest
|
||||
|
||||
- name: create /etc/ansible
|
||||
become: true
|
||||
file:
|
||||
dest: /etc/ansible
|
||||
state: directory
|
||||
|
||||
- name: create hosts file
|
||||
become: true
|
||||
template:
|
||||
src: templates/hosts.j2
|
||||
dest: /etc/ansible/hosts
|
||||
|
||||
- name: create external directory
|
||||
file:
|
||||
dest: external
|
||||
state: directory
|
||||
|
||||
- name: clone ansible win_git module
|
||||
git:
|
||||
repo: https://github.com/tivrobo/ansible-win_git.git
|
||||
dest: external/ansible-win_git
|
||||
version: master
|
||||
|
||||
- name: create ansible modules directory
|
||||
file:
|
||||
dest: ~/.ansible/plugins/modules
|
||||
state: directory
|
||||
|
||||
- name: copy win_git files to ansible modules directory
|
||||
copy:
|
||||
src: '~/.config/local/external/ansible-win_git/{{item}}'
|
||||
|
||||
9
roles/wsl/templates/hosts.j2
Normal file
9
roles/wsl/templates/hosts.j2
Normal file
@@ -0,0 +1,9 @@
|
||||
---
|
||||
all:
|
||||
children:
|
||||
windows:
|
||||
hosts:
|
||||
{{ansible_hostname}}.local:
|
||||
ansible_user: {{ansible_user_id}}
|
||||
ansible_connection: ssh
|
||||
ansible_shell_type: cmd
|
||||
@@ -21,13 +21,6 @@
|
||||
- repo: https://github.com/zsh-users/zsh-completions.git
|
||||
dest: ~/.config/zsh/zsh-completions
|
||||
|
||||
- name: clone fzf repo
|
||||
git:
|
||||
repo: https://github.com/junegunn/fzf.git
|
||||
dest: ~/.config/zsh/fzf
|
||||
notify: install fzf binaries
|
||||
- meta: flush_handlers
|
||||
|
||||
- name: create directories
|
||||
file:
|
||||
state: directory
|
||||
@@ -62,10 +55,6 @@
|
||||
dest: ~/.local/share/zsh/site-functions/_layout
|
||||
- src: ~/.config/zsh/notes/_note
|
||||
dest: ~/.local/share/zsh/site-functions/_note
|
||||
- src: ~/.config/zsh/fzf/bin/fzf
|
||||
dest: ~/.local/bin/fzf
|
||||
- src: ~/.config/zsh/fzf/bin/fzf-tmux
|
||||
dest: ~/.local/bin/fzf-tmux
|
||||
- src: ~/.config/zsh/cmake-uninstall
|
||||
dest: ~/.local/bin/cmake-uninstall
|
||||
- src: ~/.config/zsh/$
|
||||
@@ -78,6 +67,6 @@
|
||||
|
||||
- name: set default shell
|
||||
user:
|
||||
name: '{{lookup("env", "USER")}}'
|
||||
name: '{{ansible_user_id}}'
|
||||
shell: '{{zsh.stdout}}'
|
||||
become: true
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
---
|
||||
- hosts: localhost
|
||||
|
||||
roles:
|
||||
- role: zsh
|
||||
- role: tmux
|
||||
- role: neovim
|
||||
- role: git
|
||||
- role: python
|
||||
20
windows.yaml
20
windows.yaml
@@ -1,20 +0,0 @@
|
||||
---
|
||||
- import_playbook: unix.yaml
|
||||
|
||||
- hosts: localhost
|
||||
|
||||
# FIXME: Roles which depend on the win_git module can't be in the same
|
||||
# playbook on the first run because the wsl role hasn't added the win_git
|
||||
# module to the modules path yet.
|
||||
roles:
|
||||
- role: wsl
|
||||
|
||||
- hosts: windows
|
||||
|
||||
roles:
|
||||
- role: powershell
|
||||
- role: neovim
|
||||
- role: git
|
||||
- role: python
|
||||
- role: autohotkey
|
||||
- role: 1password
|
||||
Reference in New Issue
Block a user