Compare commits
30 Commits
18.04
...
webcatalog
| Author | SHA1 | Date | |
|---|---|---|---|
| 356cf58e74 | |||
| 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"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
22
Unix.yaml
Normal file
22
Unix.yaml
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
---
|
||||||
|
- hosts: localhost
|
||||||
|
|
||||||
|
roles:
|
||||||
|
- role: zsh
|
||||||
|
- role: neovim
|
||||||
|
- role: tmux
|
||||||
|
- role: system-info
|
||||||
|
|
||||||
|
- role: ag
|
||||||
|
- role: bat
|
||||||
|
- role: fzf
|
||||||
|
- role: git
|
||||||
|
- role: op
|
||||||
|
- role: tree
|
||||||
|
|
||||||
|
- role: llvm
|
||||||
|
- role: nodejs
|
||||||
|
- role: python
|
||||||
|
|
||||||
|
- 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: fzf
|
||||||
|
- role: git
|
||||||
|
- role: op
|
||||||
|
- 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
|
||||||
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
|
- name: clone config repo
|
||||||
win_git:
|
win_git:
|
||||||
repo: git@code.infektor.net:config/AutoHotKey.git
|
repo: git@code.infektor.net:config/AutoHotKey.git
|
||||||
dest: '{{ansible_env.LOCALAPPDATA}}/AutoHotKey'
|
dest: '{{autohotkey_repo_dir}}'
|
||||||
branch: master
|
branch: master
|
||||||
|
|
||||||
# TODO: - name: create scheduled task
|
- name: create scheduled task
|
||||||
# win_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 @@
|
|||||||
|
---
|
||||||
|
- 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
|
||||||
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
|
- name: install fzf binaries
|
||||||
command:
|
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
|
- name: clone config repos
|
||||||
win_git:
|
win_git:
|
||||||
repo: '{{item.repo}}'
|
repo: '{{item.repo}}'
|
||||||
@@ -6,4 +17,7 @@
|
|||||||
version: master
|
version: master
|
||||||
with_items: '{{git_config_repos}}'
|
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
|
||||||
@@ -1,11 +1,13 @@
|
|||||||
---
|
---
|
||||||
- name: install Debian-unstable apt packages
|
- name: install apt packages
|
||||||
become: true
|
become: true
|
||||||
apt:
|
apt:
|
||||||
name:
|
name:
|
||||||
- neovim
|
- clang
|
||||||
- clang-format
|
- clang-format
|
||||||
- clang-tidy
|
- clang-tidy
|
||||||
|
- clang-tools
|
||||||
- clangd
|
- clangd
|
||||||
- silversearcher-ag
|
- llvm
|
||||||
state: latest
|
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,11 +1,7 @@
|
|||||||
---
|
---
|
||||||
- name: install homebrew packages
|
- name: install homebrew packages
|
||||||
homebrew:
|
homebrew:
|
||||||
name:
|
name: neovim
|
||||||
- neovim
|
|
||||||
- llvm
|
|
||||||
- node
|
|
||||||
- the_silver_searcher
|
|
||||||
state: latest
|
state: latest
|
||||||
|
|
||||||
- include_tasks: unix.yaml
|
- include_tasks: unix.yaml
|
||||||
|
|||||||
@@ -1,31 +1,8 @@
|
|||||||
---
|
---
|
||||||
- include_tasks: '{{ansible_distribution}}-{{ansible_distribution_version}}.yaml'
|
- name: install apt package
|
||||||
- include_tasks: 'unix.yaml'
|
become: true
|
||||||
|
apt:
|
||||||
|
name: neovim
|
||||||
|
state: latest
|
||||||
|
|
||||||
- name: nodejs get json containing latest version
|
- include_tasks: unix.yaml
|
||||||
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]
|
|
||||||
|
|||||||
@@ -1,34 +0,0 @@
|
|||||||
---
|
|
||||||
- name: get releases json from github
|
|
||||||
uri:
|
|
||||||
url: https://api.github.com/repos/neovim/neovim/releases
|
|
||||||
register: releases
|
|
||||||
- name: query the latest stable release
|
|
||||||
set_fact:
|
|
||||||
stable: '{{releases.json | json_query("[?tag_name==`stable`]")}}'
|
|
||||||
- name: query the nvim-linux64.deb.sha256sum asset
|
|
||||||
set_fact:
|
|
||||||
sha_asset: '{{stable[0].assets | json_query("[?name==`nvim-linux64.deb.sha256sum`]")}}'
|
|
||||||
- name: query the nvim-linux64.deb asset
|
|
||||||
set_fact:
|
|
||||||
deb_asset: '{{stable[0].assets | json_query("[?name==`nvim-linux64.deb`]")}}'
|
|
||||||
- name: create directory for downloads
|
|
||||||
file:
|
|
||||||
state: directory
|
|
||||||
path: ~/.cache/nvim/deb
|
|
||||||
- name: download nvim-linux64.deb with checksum
|
|
||||||
get_url:
|
|
||||||
url: '{{deb_asset[0].browser_download_url}}'
|
|
||||||
dest: ~/.cache/nvim/deb/nvim-linux64.deb
|
|
||||||
checksum: 'sha256:{{sha_asset[0].browser_download_url}}'
|
|
||||||
|
|
||||||
- name: install nvim-linux64.deb package
|
|
||||||
become: true
|
|
||||||
apt:
|
|
||||||
deb: ~/.cache/nvim/deb/nvim-linux64.deb
|
|
||||||
# TODO: clangd, clang-format, clang-tidy
|
|
||||||
- name: install Ubuntu-18.04 apt packages
|
|
||||||
become: true
|
|
||||||
apt:
|
|
||||||
name:
|
|
||||||
- silversearcher-ag
|
|
||||||
@@ -1,11 +1,7 @@
|
|||||||
---
|
---
|
||||||
- name: install choco packages
|
- name: install chocolatey packages
|
||||||
win_chocolatey:
|
win_chocolatey:
|
||||||
name:
|
name: neovim
|
||||||
- neovim
|
|
||||||
- ag
|
|
||||||
- llvm
|
|
||||||
- nodejs
|
|
||||||
state: latest
|
state: latest
|
||||||
|
|
||||||
- name: clone config repo
|
- name: clone config repo
|
||||||
@@ -14,9 +10,9 @@
|
|||||||
dest: '{{ansible_env.LOCALAPPDATA}}/nvim'
|
dest: '{{ansible_env.LOCALAPPDATA}}/nvim'
|
||||||
version: master
|
version: master
|
||||||
|
|
||||||
# TODO: - name: neovim set repo email
|
# - TODO: neovim set repo email
|
||||||
# win_git_config:
|
# win_git_config:
|
||||||
# TODO: - name: neovim install pip packages
|
# - TODO: neovim install pip packages
|
||||||
# win_pip:
|
# win_pip:
|
||||||
# name: '{{neovim_pip_packages}}'
|
# name: '{{neovim_pip_packages}}'
|
||||||
# state: latest
|
# state: latest
|
||||||
@@ -24,5 +20,6 @@
|
|||||||
- name: create nvim start menu shortcut
|
- name: create nvim start menu shortcut
|
||||||
win_shortcut:
|
win_shortcut:
|
||||||
src: '{{ansible_env.ChocolateyToolsLocation}}/neovim/nvim-win64/bin/nvim-qt.exe'
|
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'
|
icon: '{{ansible_env.ChocolateyToolsLocation}}/neovim/nvim-win64/bin/nvim-qt.exe,0'
|
||||||
|
directory: '{{ansible_env.USERPROFILE}}'
|
||||||
|
|||||||
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'
|
||||||
5
roles/op/tasks/Darwin.yaml
Normal file
5
roles/op/tasks/Darwin.yaml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
- name: install homebrew package
|
||||||
|
homebrew_cask:
|
||||||
|
name: 1password-cli
|
||||||
|
state: latest
|
||||||
38
roles/op/tasks/Debian.yaml
Normal file
38
roles/op/tasks/Debian.yaml
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
---
|
||||||
|
- name: get html of latest versions
|
||||||
|
uri:
|
||||||
|
url: https://raw.githubusercontent.com/kbenzie/op-release-scraper/main/op-releases.json
|
||||||
|
register: op_releases
|
||||||
|
|
||||||
|
- when: ansible_machine == "x86"
|
||||||
|
set_fact: {op_arch: '386'}
|
||||||
|
- when: ansible_machine == "x86_64"
|
||||||
|
set_fact: {op_arch: 'amd64'}
|
||||||
|
- when: ansible_machine == "arm"
|
||||||
|
set_fact: {op_arch: 'arm'}
|
||||||
|
- when: ansible_machine == "arm64"
|
||||||
|
set_fact: {op_arch: 'arm64'}
|
||||||
|
|
||||||
|
- set_fact:
|
||||||
|
op_zip_url: '{{op_releases.json[0].downloads.Linux[op_arch]}}'
|
||||||
|
|
||||||
|
- name: create directory for downloaded package
|
||||||
|
file:
|
||||||
|
state: directory
|
||||||
|
dest: ~/.local/src/op
|
||||||
|
|
||||||
|
- name: download latest release package
|
||||||
|
get_url:
|
||||||
|
url: '{{op_zip_url}}'
|
||||||
|
dest: ~/.local/src/op/op.zip
|
||||||
|
|
||||||
|
- name: extract zip package
|
||||||
|
unarchive:
|
||||||
|
src: ~/.local/src/op/op.zip
|
||||||
|
dest: ~/.local/src/op
|
||||||
|
|
||||||
|
- name: create symbolic links
|
||||||
|
file:
|
||||||
|
src: ~/.local/src/op/op
|
||||||
|
dest: ~/.local/bin/op
|
||||||
|
state: link
|
||||||
5
roles/op/tasks/Windows.yaml
Normal file
5
roles/op/tasks/Windows.yaml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
- name: install chocolatey package
|
||||||
|
win_chocolatey:
|
||||||
|
name: op
|
||||||
|
state: latest
|
||||||
2
roles/op/tasks/main.yaml
Normal file
2
roles/op/tasks/main.yaml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
---
|
||||||
|
- include_tasks: '{{ansible_os_family}}.yaml'
|
||||||
@@ -1,8 +1,10 @@
|
|||||||
---
|
---
|
||||||
- name: install apt packages
|
- name: install apt packages
|
||||||
|
become: true
|
||||||
apt:
|
apt:
|
||||||
name:
|
name:
|
||||||
|
- python-is-python3
|
||||||
- python3
|
- python3
|
||||||
- python3-pip
|
- python3-pip
|
||||||
|
- python3-venv
|
||||||
- python3-virtualenv
|
- 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
|
||||||
5
roles/system-info/tasks/Debian.yaml
Normal file
5
roles/system-info/tasks/Debian.yaml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
# TODO:
|
||||||
|
# cp $script_dir/system-info.service ~/.config/systemd/user/system-info.service
|
||||||
|
# systemctl --user enable system-info
|
||||||
|
# systemctl --user start system-info
|
||||||
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'
|
||||||
3
roles/webcatalog/tasks/Darwin.yaml
Normal file
3
roles/webcatalog/tasks/Darwin.yaml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
- set_fact:
|
||||||
|
download_url: https://cdn-2.webcatalog.io/webcatalog/WebCatalog-{{latest.version}}-universal.dmg
|
||||||
31
roles/webcatalog/tasks/Debian.yaml
Normal file
31
roles/webcatalog/tasks/Debian.yaml
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
---
|
||||||
|
- assert: {that: [ansible_machine == 'x86_64']}
|
||||||
|
|
||||||
|
- set_fact:
|
||||||
|
filename: 'WebCatalog-{{latest.version}}.AppImage'
|
||||||
|
# TODO: Support arm64: 'WebCatalog-{{latest.version}}-arm64.AppImage'
|
||||||
|
|
||||||
|
- name: create directory for download
|
||||||
|
file:
|
||||||
|
state: directory
|
||||||
|
dest: ~/.local/src/webcatalog
|
||||||
|
|
||||||
|
- name: download AppImage
|
||||||
|
get_url:
|
||||||
|
url: 'https://cdn-2.webcatalog.io/webcatalog/{{filename}}'
|
||||||
|
dest: '~/.local/src/webcatalog/{{filename}}'
|
||||||
|
|
||||||
|
- name: make AppImage executable
|
||||||
|
file:
|
||||||
|
dest: '~/.local/src/webcatalog/{{filename}}'
|
||||||
|
mode: a+x
|
||||||
|
|
||||||
|
- name: create symbolic link
|
||||||
|
file:
|
||||||
|
src: '~/.local/src/webcatalog/{{filename}}'
|
||||||
|
dest: '~/.local/bin/WebCatalog'
|
||||||
|
state: link
|
||||||
|
|
||||||
|
- name: create desktop file
|
||||||
|
template:
|
||||||
|
dest: io.webcatalog.WebCatalog.desktop
|
||||||
5
roles/webcatalog/tasks/Windows.yaml
Normal file
5
roles/webcatalog/tasks/Windows.yaml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
- set_fact:
|
||||||
|
filename: WebCatalog%20Setup%20{{latest.version}}.exe
|
||||||
|
|
||||||
|
- name: download
|
||||||
19
roles/webcatalog/tasks/main.yaml
Normal file
19
roles/webcatalog/tasks/main.yaml
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
---
|
||||||
|
- name: get latest releases
|
||||||
|
uri:
|
||||||
|
url: https://raw.githubusercontent.com/kbenzie/webcatalog-release-scraper/main/webcatalog-releases.json
|
||||||
|
register: releases
|
||||||
|
|
||||||
|
- set_fact:
|
||||||
|
latest: '{{releases.json[0]}}'
|
||||||
|
|
||||||
|
- include_tasks: '{{ansible_os_family}}.yaml'
|
||||||
|
|
||||||
|
# TODO: Generate these links from the changelog from 42.0.0 up
|
||||||
|
|
||||||
|
- debug: msg=https://cdn-2.webcatalog.io/webcatalog/WebCatalog-{{latest.version}}-universal.dmg
|
||||||
|
- debug: msg=https://cdn-2.webcatalog.io/webcatalog/WebCatalog%20Setup%20{{latest.version}}.exe
|
||||||
|
- debug: msg=https://cdn-2.webcatalog.io/webcatalog/WebCatalog-{{latest.version}}.AppImage
|
||||||
|
- debug: msg=https://cdn-2.webcatalog.io/webcatalog/WebCatalog-{{latest.version}}-arm64.AppImage
|
||||||
|
|
||||||
|
# NOTE: Otherwise use https://github.com/webcatalog/webcatalog-legacy/releases
|
||||||
11
roles/webcatalog/templates/webcatalog.desktop.j2
Normal file
11
roles/webcatalog/templates/webcatalog.desktop.j2
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
[Desktop Entry]
|
||||||
|
Name=WebCatalog
|
||||||
|
Exec={{command}}
|
||||||
|
Terminal=false
|
||||||
|
Type=Application
|
||||||
|
Icon=webcatalog
|
||||||
|
StartupWMClass=WebCatalog
|
||||||
|
X-AppImage-Version={{latest.version}}
|
||||||
|
Comment=Turn Any Websites Into Real Desktop Apps
|
||||||
|
MimeType=x-scheme-handler/webcatalog;
|
||||||
|
Categories=Utility;
|
||||||
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
|
- name: create external directory
|
||||||
file:
|
file:
|
||||||
dest: external
|
dest: external
|
||||||
state: directory
|
state: directory
|
||||||
|
|
||||||
- name: clone ansible win_git module
|
- name: clone ansible win_git module
|
||||||
git:
|
git:
|
||||||
repo: https://github.com/tivrobo/ansible-win_git.git
|
repo: https://github.com/tivrobo/ansible-win_git.git
|
||||||
dest: external/ansible-win_git
|
dest: external/ansible-win_git
|
||||||
version: master
|
version: master
|
||||||
|
|
||||||
- name: create ansible modules directory
|
- name: create ansible modules directory
|
||||||
file:
|
file:
|
||||||
dest: ~/.ansible/plugins/modules
|
dest: ~/.ansible/plugins/modules
|
||||||
state: directory
|
state: directory
|
||||||
|
|
||||||
- name: copy win_git files to ansible modules directory
|
- name: copy win_git files to ansible modules directory
|
||||||
copy:
|
copy:
|
||||||
src: '~/.config/local/external/ansible-win_git/{{item}}'
|
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
|
- repo: https://github.com/zsh-users/zsh-completions.git
|
||||||
dest: ~/.config/zsh/zsh-completions
|
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
|
- name: create directories
|
||||||
file:
|
file:
|
||||||
state: directory
|
state: directory
|
||||||
@@ -62,10 +55,6 @@
|
|||||||
dest: ~/.local/share/zsh/site-functions/_layout
|
dest: ~/.local/share/zsh/site-functions/_layout
|
||||||
- src: ~/.config/zsh/notes/_note
|
- src: ~/.config/zsh/notes/_note
|
||||||
dest: ~/.local/share/zsh/site-functions/_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
|
- src: ~/.config/zsh/cmake-uninstall
|
||||||
dest: ~/.local/bin/cmake-uninstall
|
dest: ~/.local/bin/cmake-uninstall
|
||||||
- src: ~/.config/zsh/$
|
- src: ~/.config/zsh/$
|
||||||
@@ -78,6 +67,6 @@
|
|||||||
|
|
||||||
- name: set default shell
|
- name: set default shell
|
||||||
user:
|
user:
|
||||||
name: '{{lookup("env", "USER")}}'
|
name: '{{ansible_user_id}}'
|
||||||
shell: '{{zsh.stdout}}'
|
shell: '{{zsh.stdout}}'
|
||||||
become: true
|
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