Compare commits
77 Commits
webcatalog
...
f2d678ab01
| Author | SHA1 | Date | |
|---|---|---|---|
| f2d678ab01 | |||
| 910be1641d | |||
| d4393851b1 | |||
| 8fae111d0e | |||
| 5b62791bf6 | |||
| ad9d1fbe4f | |||
| c4d4f5395a | |||
| 5ac1081f90 | |||
| a80d8e1574 | |||
| dbd8af4648 | |||
| 23f0fd7f23 | |||
| bdbb6a3f3b | |||
| 7148f492b0 | |||
| 03de2224f8 | |||
| d4d37fb6bc | |||
| 1608987eef | |||
| b4d4bd0664 | |||
| 39268ae7aa | |||
| 368982b8fa | |||
| b3cd84e181 | |||
| b0d2fd212e | |||
| f7ee7af25c | |||
| 50a9cc97b6 | |||
| e2d1414c3b | |||
| 576eb2ae41 | |||
| 69bcd75f7b | |||
| d32588dbfd | |||
| 4783803a77 | |||
| 1ad397771d | |||
| 6ff50854e0 | |||
| 5cba48f632 | |||
| 7e9166cb48 | |||
| 747f1a6992 | |||
| db3d146dc9 | |||
| 91839b927d | |||
| c5e2a76d2e | |||
| baa0206937 | |||
| 2abc38f696 | |||
| 63ff47c3b2 | |||
| da4b8858d3 | |||
| d95f1f7e32 | |||
| 7da67aaed0 | |||
| 7ec59f8c52 | |||
| bebe6de7cd | |||
| 08af0f00b6 | |||
| 3864c0f35d | |||
| 3218722fcb | |||
| 1895f1561d | |||
| cee0c443a3 | |||
| bb945190f8 | |||
| 4f5a2e6333 | |||
| 833f9a25ef | |||
| 1fbdcdd487 | |||
| 9efb5d6c15 | |||
| d99657e3b8 | |||
| b159445520 | |||
| 6a4a182cf5 | |||
| 55cc3441be | |||
| bd4e5f1941 | |||
| c9845be40c | |||
| f47b45d82c | |||
| 854bf8d1e9 | |||
| 3272331f08 | |||
| 8c9af58146 | |||
| e4a08c843c | |||
| c77b356968 | |||
| 7404c0ae59 | |||
| 06b511d823 | |||
| 9693194f7f | |||
| 337237a6e8 | |||
| 31eba75038 | |||
| 5728aba7df | |||
| 76b6d63064 | |||
| 189371d7f2 | |||
| 491a9a07b5 | |||
| c4e87f2022 | |||
| 09e7ec3ad4 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +1,2 @@
|
|||||||
external
|
external
|
||||||
|
modules/win_git*
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
{
|
|
||||||
"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"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
5
ansible.cfg
Normal file
5
ansible.cfg
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
[defaults]
|
||||||
|
collections_path = collections
|
||||||
|
library = modules
|
||||||
|
roles_path = roles
|
||||||
|
stdout_callback = yaml
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
---
|
|
||||||
- import_playbook: unix.yaml
|
|
||||||
|
|
||||||
- hosts: localhost
|
|
||||||
|
|
||||||
roles:
|
|
||||||
- role: obsidian
|
|
||||||
@@ -1,22 +1,33 @@
|
|||||||
---
|
---
|
||||||
- hosts: localhost
|
- hosts: localhost
|
||||||
|
|
||||||
roles:
|
roles:
|
||||||
|
- role: sudo
|
||||||
|
when: ansible_user_id != "root"
|
||||||
|
- role: python
|
||||||
|
|
||||||
- role: zsh
|
- role: zsh
|
||||||
- role: neovim
|
- role: neovim
|
||||||
- role: tmux
|
- role: tmux
|
||||||
- role: system-info
|
- role: system-info
|
||||||
|
when: '"WSL" not in ansible_kernel'
|
||||||
|
|
||||||
- role: ag
|
- role: ag
|
||||||
- role: bat
|
- role: bat
|
||||||
|
- role: curl
|
||||||
- role: fzf
|
- role: fzf
|
||||||
|
- role: gh
|
||||||
- role: git
|
- role: git
|
||||||
- role: op
|
- role: htop
|
||||||
|
- role: jp
|
||||||
|
- role: jq
|
||||||
|
- role: readline
|
||||||
|
- role: tidy
|
||||||
- role: tree
|
- role: tree
|
||||||
|
- role: yq
|
||||||
|
- role: watch
|
||||||
|
|
||||||
- role: llvm
|
- role: llvm
|
||||||
- role: nodejs
|
- role: nodejs
|
||||||
- role: python
|
|
||||||
|
|
||||||
- role: wsl
|
- role: wsl
|
||||||
when: '"WSL" in ansible_kernel'
|
when: '"WSL" in ansible_kernel'
|
||||||
5
playbooks/UnixGUI.yaml
Normal file
5
playbooks/UnixGUI.yaml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
- import_playbook: UnixCLI.yaml
|
||||||
|
- hosts: localhost
|
||||||
|
roles:
|
||||||
|
- role: 1password
|
||||||
@@ -1,23 +1,36 @@
|
|||||||
---
|
---
|
||||||
- hosts: windows
|
- hosts: windows
|
||||||
|
|
||||||
|
vars:
|
||||||
|
install_cad_apps: false
|
||||||
|
|
||||||
roles:
|
roles:
|
||||||
|
- role: python
|
||||||
|
- role: git
|
||||||
- role: powershell
|
- role: powershell
|
||||||
- role: neovim
|
- role: neovim
|
||||||
- role: system-info
|
- role: system-info
|
||||||
|
|
||||||
- role: ag
|
- role: ag
|
||||||
|
- role: bat
|
||||||
|
- role: curl
|
||||||
- role: fzf
|
- role: fzf
|
||||||
- role: git
|
- role: gh
|
||||||
- role: op
|
- role: jq
|
||||||
- role: tree
|
- role: tree
|
||||||
|
- role: yq
|
||||||
|
|
||||||
- role: llvm
|
- role: llvm
|
||||||
- role: nodejs
|
- role: nodejs
|
||||||
- role: python
|
|
||||||
|
|
||||||
- role: 1password
|
- role: 1password
|
||||||
- role: autohotkey
|
- role: autohotkey
|
||||||
- role: firefox
|
- role: firefox
|
||||||
- role: obsidian
|
- role: obsidian
|
||||||
|
- role: powertoys
|
||||||
- role: windows-terminal
|
- role: windows-terminal
|
||||||
|
|
||||||
|
- role: autodesk-fusion360
|
||||||
|
when: install_cad_apps
|
||||||
|
- role: prusaslicer
|
||||||
|
when: install_cad_apps
|
||||||
13
playbooks/macOS.yaml
Normal file
13
playbooks/macOS.yaml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
---
|
||||||
|
- import_playbook: UnixGUI.yaml
|
||||||
|
- hosts: localhost
|
||||||
|
roles:
|
||||||
|
- role: fonts
|
||||||
|
- role: mas
|
||||||
|
|
||||||
|
- role: iterm
|
||||||
|
- role: magnet
|
||||||
|
- role: microsoft-remote-desktop
|
||||||
|
- role: obsidian
|
||||||
|
- role: viscosity
|
||||||
|
- role: webcatalog
|
||||||
@@ -1,5 +1,9 @@
|
|||||||
---
|
---
|
||||||
- name: install homebrew package
|
- name: install homebrew package
|
||||||
homebrew_cask:
|
homebrew_cask:
|
||||||
name: 1password
|
name:
|
||||||
|
- 1password
|
||||||
|
- 1password-cli
|
||||||
state: latest
|
state: latest
|
||||||
|
|
||||||
|
- include_tasks: zsh-completion.yaml
|
||||||
|
|||||||
@@ -1 +1,51 @@
|
|||||||
# TODO: https://support.1password.com/install-linux/#debian-or-ubuntu
|
---
|
||||||
|
- set_fact:
|
||||||
|
keyring: /etc/apt/trusted.gpg.d/1password-archive-keyring.gpg
|
||||||
|
|
||||||
|
- 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: '{{keyring}}'
|
||||||
|
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={{keyring}}]
|
||||||
|
https://downloads.1password.com/linux/debian/{{arch}} stable main
|
||||||
|
filename: 1password
|
||||||
|
|
||||||
|
- 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
|
||||||
|
|||||||
@@ -1,12 +1,111 @@
|
|||||||
---
|
---
|
||||||
- name: install chocolatey package
|
# NOTE: The 1Password chocolatey packages are not up to date.
|
||||||
win_chocolatey:
|
|
||||||
name:
|
# GUI
|
||||||
- 1password
|
- set_fact:
|
||||||
state: latest
|
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
|
- name: create start menu shortcut
|
||||||
win_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'
|
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'
|
||||||
|
|||||||
15
roles/1password/tasks/zsh-completion.yaml
Normal file
15
roles/1password/tasks/zsh-completion.yaml
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
---
|
||||||
|
- name: get op zsh completion script
|
||||||
|
command: op completion zsh
|
||||||
|
register: zsh_completion_script
|
||||||
|
changed_when: false
|
||||||
|
|
||||||
|
- name: create local zsh site functions directory
|
||||||
|
file:
|
||||||
|
state: directory
|
||||||
|
path: ~/.local/share/zsh/site-functions
|
||||||
|
|
||||||
|
- name: create op zsh completion file
|
||||||
|
copy:
|
||||||
|
content: '{{zsh_completion_script.stdout}}'
|
||||||
|
dest: ~/.local/share/zsh/site-functions/_op
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
- name: install homebrew package
|
- name: install homebrew package
|
||||||
apt:
|
homebrew:
|
||||||
name: the_silver_searcher
|
name: the_silver_searcher
|
||||||
state: latest
|
state: latest
|
||||||
|
|||||||
8
roles/autodesk-fusion360/tasks/main.yaml
Normal file
8
roles/autodesk-fusion360/tasks/main.yaml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
- assert:
|
||||||
|
that: ansible_os_family == "Windows"
|
||||||
|
|
||||||
|
- name: install chocolatey package
|
||||||
|
win_chocolatey:
|
||||||
|
name: autodesk-fusion360
|
||||||
|
state: latest
|
||||||
@@ -9,6 +9,10 @@
|
|||||||
repo: git@code.infektor.net:config/AutoHotKey.git
|
repo: git@code.infektor.net:config/AutoHotKey.git
|
||||||
dest: '{{autohotkey_repo_dir}}'
|
dest: '{{autohotkey_repo_dir}}'
|
||||||
branch: master
|
branch: master
|
||||||
|
- win_owner:
|
||||||
|
path: '{{autohotkey_repo_dir}}'
|
||||||
|
user: Benie
|
||||||
|
recurse: true
|
||||||
|
|
||||||
- name: create scheduled task
|
- name: create scheduled task
|
||||||
win_scheduled_task:
|
win_scheduled_task:
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
---
|
---
|
||||||
- name: install apt package
|
- set_fact:
|
||||||
become: true
|
use_github: '{{
|
||||||
apt:
|
ansible_distribution == "Ubuntu" and
|
||||||
name: bat
|
ansible_distribution_version == "18.04"
|
||||||
state: latest
|
}}'
|
||||||
|
- debug: msg={{use_github}}
|
||||||
|
|
||||||
- name: update bat alternative
|
- when: use_github
|
||||||
become: true
|
include_tasks: deb.yaml
|
||||||
alternatives:
|
|
||||||
name: bat
|
- when: not use_github
|
||||||
path: /usr/bin/batcat
|
include_tasks: apt.yaml
|
||||||
link: /usr/local/bin/bat
|
|
||||||
|
|||||||
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
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
- name: install homebrew package
|
- name: install homebrew package
|
||||||
homebrew_cask:
|
homebrew:
|
||||||
name: 1password-cli
|
name: curl
|
||||||
state: latest
|
state: latest
|
||||||
6
roles/curl/tasks/Debian.yaml
Normal file
6
roles/curl/tasks/Debian.yaml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
- name: install apt package
|
||||||
|
become: true
|
||||||
|
apt:
|
||||||
|
name: curl
|
||||||
|
state: latest
|
||||||
5
roles/curl/tasks/Windows.yaml
Normal file
5
roles/curl/tasks/Windows.yaml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
- name: install chocolatey package
|
||||||
|
win_chocolatey:
|
||||||
|
name: curl
|
||||||
|
state: latest
|
||||||
5
roles/editline/tasks/main.yaml
Normal file
5
roles/editline/tasks/main.yaml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
- name: create .editrc config file
|
||||||
|
template:
|
||||||
|
src: editrc
|
||||||
|
dest: '{{ansible_env.HOME}}/.editrc'
|
||||||
3
roles/editline/templates/editrc
Normal file
3
roles/editline/templates/editrc
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Enable vi mode
|
||||||
|
lldb:bind -v
|
||||||
|
lldb:bind ^I lldb_complete
|
||||||
9
roles/fonts/tasks/Darwin.yaml
Normal file
9
roles/fonts/tasks/Darwin.yaml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
- name: enable homebrew tap
|
||||||
|
homebrew_tap:
|
||||||
|
name: homebrew/cask-fonts
|
||||||
|
|
||||||
|
- name: install Caskaydia Cove Nerd Font
|
||||||
|
homebrew_cask:
|
||||||
|
name: font-caskaydia-cove-nerd-font
|
||||||
|
state: latest
|
||||||
2
roles/fonts/tasks/main.yaml
Normal file
2
roles/fonts/tasks/main.yaml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
---
|
||||||
|
- include_tasks: '{{ansible_os_family}}.yaml'
|
||||||
6
roles/fzf/tasks/Debian-apt.yaml
Normal file
6
roles/fzf/tasks/Debian-apt.yaml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
- name: install apt package
|
||||||
|
become: true
|
||||||
|
apt:
|
||||||
|
name: fzf
|
||||||
|
state: latest
|
||||||
@@ -1,12 +1,8 @@
|
|||||||
---
|
---
|
||||||
- name: install apt package
|
- when: ansible_distribution == 'Ubuntu' and
|
||||||
when: ansible_distribution == "Debian" and
|
ansible_distribution_version is version('22.04', '<=')
|
||||||
ansible_distribution_version == "unstable"
|
include_tasks: Debian-old.yaml
|
||||||
become: true
|
|
||||||
apt:
|
|
||||||
name: fzf
|
|
||||||
state: latest
|
|
||||||
|
|
||||||
- include_tasks: Debian-old.yaml
|
- when: not (ansible_distribution == 'Ubuntu' and
|
||||||
when: not (ansible_distribution == "Debian" and
|
ansible_distribution_version is version('22.04', '<='))
|
||||||
ansible_distribution_version == "unstable")
|
include_tasks: Debian-apt.yaml
|
||||||
|
|||||||
6
roles/gdb/tasks/Debian.yaml
Normal file
6
roles/gdb/tasks/Debian.yaml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
- name: install apt package
|
||||||
|
become: true
|
||||||
|
apt:
|
||||||
|
name: gdb
|
||||||
|
state: latest
|
||||||
11
roles/gdb/tasks/gdb-11.1-config.yaml
Normal file
11
roles/gdb/tasks/gdb-11.1-config.yaml
Normal 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
34
roles/gdb/tasks/main.yaml
Normal 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
|
||||||
3
roles/gdb/templates/gdbinit
Normal file
3
roles/gdb/templates/gdbinit
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Enable saving command history
|
||||||
|
set history filename {{gdb_state_dir}}/history
|
||||||
|
set history save on
|
||||||
5
roles/gh/tasks/Darwin.yaml
Normal file
5
roles/gh/tasks/Darwin.yaml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
- name: install homebrew package
|
||||||
|
homebrew:
|
||||||
|
name: gh
|
||||||
|
state: latest
|
||||||
37
roles/gh/tasks/Debian.yaml
Normal file
37
roles/gh/tasks/Debian.yaml
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
---
|
||||||
|
- set_fact:
|
||||||
|
arch_map:
|
||||||
|
aarch64: arm64
|
||||||
|
armv6l: armhf
|
||||||
|
armv7l: armhf
|
||||||
|
i386: i386
|
||||||
|
x86_64: amd64
|
||||||
|
- set_fact:
|
||||||
|
arch: '{{ [ansible_architecture] | map("extract", arch_map) | first }}'
|
||||||
|
|
||||||
|
- name: download apt repository key
|
||||||
|
become: true
|
||||||
|
get_url:
|
||||||
|
url: https://cli.github.com/packages/githubcli-archive-keyring.gpg
|
||||||
|
dest: /usr/share/keyrings/githubcli-archive-keyring.gpg
|
||||||
|
mode: 0644
|
||||||
|
|
||||||
|
- name: add apt repository list
|
||||||
|
become: true
|
||||||
|
apt_repository:
|
||||||
|
filename: github-cli
|
||||||
|
repo: 'deb [arch={{arch}} signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main'
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: install apt package
|
||||||
|
become: true
|
||||||
|
apt:
|
||||||
|
name: gh
|
||||||
|
state: latest
|
||||||
|
update_cache: true
|
||||||
|
register: gh_apt
|
||||||
|
|
||||||
|
- name: install zsh completions
|
||||||
|
when: gh_apt.changed
|
||||||
|
become: true
|
||||||
|
shell: gh completion -s zsh > /usr/local/share/zsh/site-functions/_gh
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
- name: install chocolatey package
|
- name: install chocolatey package
|
||||||
win_chocolatey:
|
win_chocolatey:
|
||||||
name: op
|
name: gh
|
||||||
state: latest
|
state: latest
|
||||||
2
roles/gh/tasks/main.yaml
Normal file
2
roles/gh/tasks/main.yaml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
---
|
||||||
|
- include_tasks: '{{ansible_os_family}}.yaml'
|
||||||
34
roles/git/tasks/Windows-installer.yaml
Normal file
34
roles/git/tasks/Windows-installer.yaml
Normal 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'
|
||||||
@@ -1,14 +1,35 @@
|
|||||||
---
|
---
|
||||||
- name: install chocolatey package
|
# Pinned to 2.36.1 because the unofficial win_git module hangs when using
|
||||||
win_chocolatey:
|
# 2.37.3, this is either a breaking change in 2.37.x or an incompatibility with
|
||||||
name: git
|
# the win_git module. The git chocolatey package does not respect the version
|
||||||
package_params: >-
|
# argument and always installs the most recent version, so instead download the
|
||||||
/GitAndUnixToolsOnPath
|
# installer from GitHub and install manually.
|
||||||
/NoShellIntegration
|
- set_fact:
|
||||||
/NoGuiHereIntegration
|
git_version: 2.36.1
|
||||||
/NoCredentialManager
|
git_cli_exe: '{{ansible_env.ProgramFiles}}/Git/cmd/git.exe'
|
||||||
/NoOpenSSH
|
git_run_installer: false
|
||||||
state: latest
|
|
||||||
|
- 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
|
- name: clone config repos
|
||||||
win_git:
|
win_git:
|
||||||
@@ -16,6 +37,11 @@
|
|||||||
dest: '{{ansible_env.USERPROFILE}}/.config/{{item.name}}'
|
dest: '{{ansible_env.USERPROFILE}}/.config/{{item.name}}'
|
||||||
version: master
|
version: master
|
||||||
with_items: '{{git_config_repos}}'
|
with_items: '{{git_config_repos}}'
|
||||||
|
- win_owner:
|
||||||
|
path: '{{ansible_env.USERPROFILE}}/.config/{{item.name}}'
|
||||||
|
user: Benie
|
||||||
|
recurse: true
|
||||||
|
with_items: '{{git_config_repos}}'
|
||||||
|
|
||||||
# - TODO: install pip packages
|
# - TODO: install pip packages
|
||||||
# win_pip:
|
# win_pip:
|
||||||
|
|||||||
@@ -18,8 +18,4 @@
|
|||||||
extra_args: --user
|
extra_args: --user
|
||||||
state: latest
|
state: latest
|
||||||
|
|
||||||
- name: create symbolic links
|
- include_tasks: ~/.config/git/tasks.yaml
|
||||||
file:
|
|
||||||
state: link
|
|
||||||
src: ~/.config/git/_git-changes
|
|
||||||
dest: ~/.local/share/zsh/site-functions/_git-changes
|
|
||||||
|
|||||||
5
roles/glab/tasks/Darwin.yaml
Normal file
5
roles/glab/tasks/Darwin.yaml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
- name: install homebrew package
|
||||||
|
homebrew:
|
||||||
|
name: glab
|
||||||
|
state: latest
|
||||||
67
roles/glab/tasks/Debian.yaml
Normal file
67
roles/glab/tasks/Debian.yaml
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
---
|
||||||
|
- set_fact:
|
||||||
|
glab: /usr/bin/glab
|
||||||
|
- name: stat the executable
|
||||||
|
stat:
|
||||||
|
path: '{{glab}}'
|
||||||
|
register: stat_glab
|
||||||
|
|
||||||
|
- name: get instlal version
|
||||||
|
when: stat_glab.stat.exists
|
||||||
|
command: '{{glab}} --version'
|
||||||
|
register: glab_version_output
|
||||||
|
changed_when: false
|
||||||
|
|
||||||
|
- when: stat_glab.stat.exists
|
||||||
|
set_fact:
|
||||||
|
glab_version: '{{glab_version_output.stdout | replace("glab version ", "v")}}'
|
||||||
|
|
||||||
|
- set_fact:
|
||||||
|
gitlab_api: 'https://gitlab.com/api/v4'
|
||||||
|
project_id: 'gitlab-org%2Fcli'
|
||||||
|
|
||||||
|
- name: get list of gitlab releases
|
||||||
|
uri:
|
||||||
|
url:
|
||||||
|
'{{gitlab_api}}/projects/{{project_id}}/releases'
|
||||||
|
register: releases
|
||||||
|
|
||||||
|
- set_fact:
|
||||||
|
latest: '{{releases.json[0]}}'
|
||||||
|
latest_version: '{{releases.json[0].tag_name}}'
|
||||||
|
query: >
|
||||||
|
[?contains(name, `glab`)] |
|
||||||
|
[?contains(name, `Linux`)] |
|
||||||
|
[?contains(name, `{{ansible_machine}}.deb`)] | [0]
|
||||||
|
- set_fact:
|
||||||
|
asset: '{{latest.assets.links|json_query(query)}}'
|
||||||
|
|
||||||
|
- name: create download directory
|
||||||
|
when: glab_version is not defined or glab_version != latest_version
|
||||||
|
tempfile:
|
||||||
|
state: directory
|
||||||
|
suffix: glab
|
||||||
|
register: tempdir
|
||||||
|
|
||||||
|
- name: download .deb file
|
||||||
|
when: glab_version is not defined or glab_version != latest_version
|
||||||
|
get_url:
|
||||||
|
url: '{{asset.url}}'
|
||||||
|
dest: '{{tempdir.path}}/glab.deb'
|
||||||
|
|
||||||
|
- name: install .deb file
|
||||||
|
when: glab_version is not defined or glab_version != latest_version
|
||||||
|
become: true
|
||||||
|
apt:
|
||||||
|
deb: '{{tempdir.path}}/glab.deb'
|
||||||
|
|
||||||
|
- name: remove download directory
|
||||||
|
when: glab_version is not defined or glab_version != latest_version
|
||||||
|
file:
|
||||||
|
state: absent
|
||||||
|
path: '{{tempdir.path}}'
|
||||||
|
|
||||||
|
- name: install zsh completions
|
||||||
|
when: glab_version is not defined or glab_version != latest_version
|
||||||
|
command:
|
||||||
|
glab completion -s zsh > ~/.local/share/zsh/site-functions/_glab
|
||||||
5
roles/glab/tasks/Windows.yaml
Normal file
5
roles/glab/tasks/Windows.yaml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
- name: install chocolatey package
|
||||||
|
win_chocolatey:
|
||||||
|
name: glab
|
||||||
|
state: latest
|
||||||
2
roles/glab/tasks/main.yaml
Normal file
2
roles/glab/tasks/main.yaml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
---
|
||||||
|
- include_tasks: '{{ansible_os_family}}.yaml'
|
||||||
5
roles/htop/tasks/Darwin.yaml
Normal file
5
roles/htop/tasks/Darwin.yaml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
- name: install homebrew package
|
||||||
|
homebrew:
|
||||||
|
name: htop
|
||||||
|
state: latest
|
||||||
6
roles/htop/tasks/Debian.yaml
Normal file
6
roles/htop/tasks/Debian.yaml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
- name: install apt package
|
||||||
|
become: true
|
||||||
|
apt:
|
||||||
|
name: htop
|
||||||
|
state: latest
|
||||||
2
roles/htop/tasks/main.yaml
Normal file
2
roles/htop/tasks/main.yaml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
---
|
||||||
|
- include_tasks: '{{ansible_os_family}}.yaml'
|
||||||
10
roles/iterm/tasks/main.yaml
Normal file
10
roles/iterm/tasks/main.yaml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
---
|
||||||
|
- assert:
|
||||||
|
that: ansible_os_family == "Darwin"
|
||||||
|
|
||||||
|
- name: install homebrew package
|
||||||
|
homebrew_cask:
|
||||||
|
name: iterm2
|
||||||
|
state: latest
|
||||||
|
|
||||||
|
# TODO: Configure stuff, somehow?
|
||||||
41
roles/jp/tasks/Darwin.yaml
Normal file
41
roles/jp/tasks/Darwin.yaml
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
---
|
||||||
|
- name: get latest github release
|
||||||
|
uri:
|
||||||
|
url: https://api.github.com/repos/jmespath/jp/releases/latest
|
||||||
|
register: latest
|
||||||
|
|
||||||
|
- set_fact:
|
||||||
|
arch: '{{ [ansible_architecture] |
|
||||||
|
map("extract", { "arm64": "arm64", "x86_64": "amd64" }) | first }}'
|
||||||
|
|
||||||
|
- set_fact:
|
||||||
|
asset_query: '[?contains(name, `jp-darwin-{{arch}}`)] | [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_stat
|
||||||
|
|
||||||
|
- 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
|
||||||
6
roles/jp/tasks/Debian.yaml
Normal file
6
roles/jp/tasks/Debian.yaml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
- name: install apt package
|
||||||
|
become: true
|
||||||
|
apt:
|
||||||
|
name: jp
|
||||||
|
state: latest
|
||||||
4
roles/jp/tasks/main.yaml
Normal file
4
roles/jp/tasks/main.yaml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
- assert:
|
||||||
|
that: ansible_os_family != "Windows"
|
||||||
|
- include_tasks: '{{ansible_os_family}}.yaml'
|
||||||
5
roles/jq/tasks/Darwin.yaml
Normal file
5
roles/jq/tasks/Darwin.yaml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
- name: install homebrew package
|
||||||
|
homebrew:
|
||||||
|
name: jq
|
||||||
|
state: latest
|
||||||
6
roles/jq/tasks/Debian.yaml
Normal file
6
roles/jq/tasks/Debian.yaml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
- name: install apt package
|
||||||
|
become: true
|
||||||
|
apt:
|
||||||
|
name: jq
|
||||||
|
state: latest
|
||||||
5
roles/jq/tasks/Windows.yaml
Normal file
5
roles/jq/tasks/Windows.yaml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
- name: install chocolatey package
|
||||||
|
win_chocolatey:
|
||||||
|
name: jq
|
||||||
|
state: latest
|
||||||
2
roles/jq/tasks/main.yaml
Normal file
2
roles/jq/tasks/main.yaml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
---
|
||||||
|
- include_tasks: '{{ansible_os_family}}.yaml'
|
||||||
2
roles/llvm/tasks/Linux Mint.yaml
Normal file
2
roles/llvm/tasks/Linux Mint.yaml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
---
|
||||||
|
- include_tasks: Ubuntu.yaml
|
||||||
2
roles/llvm/tasks/Pop!_OS.yaml
Normal file
2
roles/llvm/tasks/Pop!_OS.yaml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
---
|
||||||
|
- include_tasks: Ubuntu.yaml
|
||||||
@@ -4,14 +4,27 @@
|
|||||||
url: https://api.github.com/repos/llvm/llvm-project/releases/latest
|
url: https://api.github.com/repos/llvm/llvm-project/releases/latest
|
||||||
register: llvm_latest
|
register: llvm_latest
|
||||||
|
|
||||||
|
- name: read /etc/os-release
|
||||||
|
slurp:
|
||||||
|
src: /etc/os-release
|
||||||
|
register: os_release_b64
|
||||||
|
- name: extract UBUNTU_CODENAME=<name> to support dirivitive distros
|
||||||
|
set_fact:
|
||||||
|
ubuntu_codename: >-
|
||||||
|
{{
|
||||||
|
os_release_b64.content | b64decode |
|
||||||
|
regex_search('UBUNTU_CODENAME=.*') |
|
||||||
|
replace('UBUNTU_CODENAME=', '')
|
||||||
|
}}
|
||||||
|
|
||||||
- set_fact:
|
- set_fact:
|
||||||
llvm_major_version:
|
llvm_major_version:
|
||||||
'{{llvm_latest.json.tag_name[8:llvm_latest.json.tag_name.find(".")]}}'
|
'{{llvm_latest.json.tag_name[8:llvm_latest.json.tag_name.find(".")]}}'
|
||||||
- set_fact:
|
- set_fact:
|
||||||
llvm_apt_repo_url:
|
llvm_apt_repo_url:
|
||||||
'http://apt.llvm.org/{{ansible_distribution_release}}/'
|
'http://apt.llvm.org/{{ubuntu_codename}}/'
|
||||||
llvm_apt_category:
|
llvm_apt_category:
|
||||||
'llvm-toolchain-{{ansible_distribution_release}}-{{llvm_major_version}}'
|
'llvm-toolchain-{{ubuntu_codename}}-{{llvm_major_version}}'
|
||||||
|
|
||||||
- name: add upstream deb repository
|
- name: add upstream deb repository
|
||||||
become: true
|
become: true
|
||||||
|
|||||||
8
roles/magnet/tasks/main.yaml
Normal file
8
roles/magnet/tasks/main.yaml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
- assert:
|
||||||
|
that: ansible_os_family == 'Darwin'
|
||||||
|
|
||||||
|
- name: install app store package
|
||||||
|
mas:
|
||||||
|
id: 441258766
|
||||||
|
state: latest
|
||||||
8
roles/mas/tasks/main.yaml
Normal file
8
roles/mas/tasks/main.yaml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
- assert:
|
||||||
|
that: ansible_os_family == 'Darwin'
|
||||||
|
|
||||||
|
- name: install homebrew package
|
||||||
|
homebrew:
|
||||||
|
name: mas
|
||||||
|
state: latest
|
||||||
8
roles/microsoft-remote-desktop/tasks/main.yaml
Normal file
8
roles/microsoft-remote-desktop/tasks/main.yaml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
- assert:
|
||||||
|
that: ansible_os_family == "Darwin"
|
||||||
|
|
||||||
|
- name: install homebrew cask
|
||||||
|
homebrew_cask:
|
||||||
|
name: microsoft-remote-desktop
|
||||||
|
state: latest
|
||||||
@@ -4,4 +4,4 @@
|
|||||||
name: neovim
|
name: neovim
|
||||||
state: latest
|
state: latest
|
||||||
|
|
||||||
- include_tasks: unix.yaml
|
- include_tasks: Unix.yaml
|
||||||
|
|||||||
@@ -1,8 +1,16 @@
|
|||||||
---
|
---
|
||||||
|
- name: add neovim stable ppa
|
||||||
|
when: ansible_distribution == 'Ubuntu' and
|
||||||
|
ansible_distribution_version == '20.04'
|
||||||
|
become: true
|
||||||
|
apt_repository:
|
||||||
|
repo: ppa:neovim-ppa/stable
|
||||||
|
update_cache: true
|
||||||
|
|
||||||
- name: install apt package
|
- name: install apt package
|
||||||
become: true
|
become: true
|
||||||
apt:
|
apt:
|
||||||
name: neovim
|
name: neovim
|
||||||
state: latest
|
state: latest
|
||||||
|
|
||||||
- include_tasks: unix.yaml
|
- include_tasks: Unix.yaml
|
||||||
|
|||||||
36
roles/neovim/tasks/Unix-plugins.yaml
Normal file
36
roles/neovim/tasks/Unix-plugins.yaml
Normal 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}}'
|
||||||
28
roles/neovim/tasks/Unix.yaml
Normal file
28
roles/neovim/tasks/Unix.yaml
Normal 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'
|
||||||
36
roles/neovim/tasks/Windows-plugins.yaml
Normal file
36
roles/neovim/tasks/Windows-plugins.yaml
Normal 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}}'
|
||||||
@@ -1,14 +1,27 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
- name: install chocolatey packages
|
- name: install chocolatey packages
|
||||||
win_chocolatey:
|
win_chocolatey:
|
||||||
name: neovim
|
name: neovim
|
||||||
state: latest
|
state: latest
|
||||||
|
|
||||||
|
- set_fact:
|
||||||
|
vim_config_dir: '{{ansible_env.LOCALAPPDATA}}\nvim'
|
||||||
|
|
||||||
- name: clone config repo
|
- name: clone config repo
|
||||||
win_git:
|
win_git:
|
||||||
repo: git@code.infektor.net:config/vim.git
|
repo: git@code.infektor.net:config/vim.git
|
||||||
dest: '{{ansible_env.LOCALAPPDATA}}/nvim'
|
dest: '{{vim_config_dir}}'
|
||||||
version: master
|
branch: master
|
||||||
|
# clone: false
|
||||||
|
update: true
|
||||||
|
- win_owner:
|
||||||
|
path: '{{vim_config_dir}}'
|
||||||
|
user: Benie
|
||||||
|
recurse: true
|
||||||
|
|
||||||
|
- assert:
|
||||||
|
that: False
|
||||||
|
|
||||||
# - TODO: neovim set repo email
|
# - TODO: neovim set repo email
|
||||||
# win_git_config:
|
# win_git_config:
|
||||||
@@ -23,3 +36,27 @@
|
|||||||
dest: '{{ansible_env.ProgramData}}/Microsoft/Windows/Start Menu/Programs/nvim-qt.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}}'
|
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'
|
||||||
|
|||||||
@@ -1,14 +0,0 @@
|
|||||||
---
|
|
||||||
- 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
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
- name: install homebrew package
|
- name: install homebrew package
|
||||||
homebrew:
|
homebrew_cask:
|
||||||
name: obsidian
|
name: obsidian
|
||||||
state: latest
|
state: latest
|
||||||
|
|
||||||
@@ -8,4 +8,4 @@
|
|||||||
git:
|
git:
|
||||||
repo: git@github.com:kbenzie/notes.git
|
repo: git@github.com:kbenzie/notes.git
|
||||||
dest: '{{ansible_env.HOME}}/Documents/Notes'
|
dest: '{{ansible_env.HOME}}/Documents/Notes'
|
||||||
branch: main
|
version: main
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
---
|
---
|
||||||
|
- set_fact:
|
||||||
|
obsidian_notes_repo: '{{ansible_env.USERPROFILE}}/Documents/Notes'
|
||||||
|
|
||||||
- name: install chocolatey package
|
- name: install chocolatey package
|
||||||
win_chocolatey:
|
win_chocolatey:
|
||||||
name: obsidian
|
name: obsidian
|
||||||
@@ -7,5 +10,9 @@
|
|||||||
- name: clone notes repository
|
- name: clone notes repository
|
||||||
win_git:
|
win_git:
|
||||||
repo: git@github.com:kbenzie/notes.git
|
repo: git@github.com:kbenzie/notes.git
|
||||||
dest: '{{ansible_env.USERPROFILE}}/Documents/Notes'
|
dest: '{{obsidian_notes_repo}}'
|
||||||
branch: main
|
branch: main
|
||||||
|
- win_owner:
|
||||||
|
path: '{{obsidian_notes_repo}}'
|
||||||
|
user: Benie
|
||||||
|
recurse: true
|
||||||
|
|||||||
@@ -1,38 +0,0 @@
|
|||||||
---
|
|
||||||
- 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
|
|
||||||
@@ -1,16 +1,44 @@
|
|||||||
---
|
---
|
||||||
|
- set_fact:
|
||||||
|
powershell_config_dir:
|
||||||
|
'{{ansible_env.USERPROFILE}}/Documents/WindowsPowerShell'
|
||||||
|
|
||||||
- name: clone config repos
|
- name: clone config repos
|
||||||
win_git:
|
win_git:
|
||||||
repo: git@code.infektor.net:config/WindowsPowerShell.git
|
repo: git@code.infektor.net:config/WindowsPowerShell.git
|
||||||
dest: '{{ansible_env.USERPROFILE}}/Documents/WindowsPowerShell'
|
dest: '{{powershell_config_dir}}'
|
||||||
branch: master
|
branch: master
|
||||||
|
- win_owner:
|
||||||
|
path: '{{powershell_config_dir}}'
|
||||||
|
user: Benie
|
||||||
|
recurse: true
|
||||||
|
|
||||||
- name: install chocolatey package
|
- name: install chocolatey package
|
||||||
win_chocolatey:
|
win_chocolatey:
|
||||||
name: Cmder
|
name: Cmder
|
||||||
state: latest
|
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
|
- name: install PsReadline module
|
||||||
win_psmodule:
|
win_psmodule:
|
||||||
name: PsReadline
|
name: PsReadline
|
||||||
state: latest
|
state: latest
|
||||||
|
accept_license: true
|
||||||
|
|
||||||
|
- name: install posh-git module
|
||||||
|
win_psmodule:
|
||||||
|
name: posh-git
|
||||||
|
state: latest
|
||||||
|
accept_license: true
|
||||||
|
|||||||
8
roles/powertoys/tasks/main.yaml
Normal file
8
roles/powertoys/tasks/main.yaml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
- assert:
|
||||||
|
that: ansible_os_family == 'Windows'
|
||||||
|
|
||||||
|
- name: install chocolatey package
|
||||||
|
win_chocolatey:
|
||||||
|
name: powertoys
|
||||||
|
state: present
|
||||||
14
roles/prusaslicer/tasks/main.yaml
Normal file
14
roles/prusaslicer/tasks/main.yaml
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
---
|
||||||
|
- assert:
|
||||||
|
that: ansible_os_family == "Windows"
|
||||||
|
|
||||||
|
- name: install chocolatey package
|
||||||
|
win_chocolatey:
|
||||||
|
name: prusaslicer
|
||||||
|
state: latest
|
||||||
|
|
||||||
|
- name: create start menu shortcut
|
||||||
|
win_shortcut:
|
||||||
|
src: '{{ansible_env.ProgramData}}/chocolatey/bin/prusa-slicer.exe'
|
||||||
|
dest: '{{ansible_env.ProgramData}}/Microsoft/Windows/Start Menu/Programs/PrusaSlicer.lnk'
|
||||||
|
icon: '{{ansible_env.ProgramData}}/chocolatey/bin/prusa-slicer.exe,0'
|
||||||
@@ -6,20 +6,18 @@
|
|||||||
|
|
||||||
# TODO: set repo email
|
# TODO: set repo email
|
||||||
|
|
||||||
- name: install pip packages
|
- name: create config directories
|
||||||
pip:
|
|
||||||
name: '{{python_pip_packages}}'
|
|
||||||
state: latest
|
|
||||||
extra_args: --user
|
|
||||||
|
|
||||||
- name: create directories
|
|
||||||
file:
|
file:
|
||||||
state: directory
|
state: directory
|
||||||
dest: '{{item}}'
|
path: '{{item}}'
|
||||||
with_items:
|
with_items:
|
||||||
|
- ~/.config
|
||||||
- ~/.config/ipython/profile_default
|
- ~/.config/ipython/profile_default
|
||||||
- ~/.config/pip
|
- ~/.config/pip
|
||||||
|
|
||||||
|
# Ensure that pip.conf exists before ever installing pip packages since
|
||||||
|
# Debian has enabled `EXTERNALLY-MANAGED` from PEP 668 which breaks `pip
|
||||||
|
# install --user` unless configured otherwise.
|
||||||
- name: create symbolic links
|
- name: create symbolic links
|
||||||
file:
|
file:
|
||||||
state: link
|
state: link
|
||||||
@@ -34,3 +32,17 @@
|
|||||||
dest: ~/.config/ipython/profile_default/ipython_config.py
|
dest: ~/.config/ipython/profile_default/ipython_config.py
|
||||||
- src: ~/.config/python/pip.conf
|
- src: ~/.config/python/pip.conf
|
||||||
dest: ~/.config/pip/pip.conf
|
dest: ~/.config/pip/pip.conf
|
||||||
|
|
||||||
|
- name: install pip packages
|
||||||
|
pip:
|
||||||
|
name: '{{python_pip_packages}}'
|
||||||
|
state: latest
|
||||||
|
extra_args: --user
|
||||||
|
|
||||||
|
- name: create directories
|
||||||
|
file:
|
||||||
|
state: directory
|
||||||
|
dest: '{{item}}'
|
||||||
|
with_items:
|
||||||
|
- ~/.config/ipython/profile_default
|
||||||
|
- ~/.config/pip
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
- include_tasks: '{{ansible_os_family}}.yaml'
|
- include_tasks: '{{ansible_os_family}}.yaml'
|
||||||
|
|
||||||
- include_tasks: 'unix.yaml'
|
- include_tasks: 'Unix.yaml'
|
||||||
when: ansible_os_family != "Windows"
|
when: ansible_os_family != "Windows"
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ python_pip_packages:
|
|||||||
- ipdb
|
- ipdb
|
||||||
- ipython
|
- ipython
|
||||||
- isort
|
- isort
|
||||||
|
- jmespath
|
||||||
- pylint
|
- pylint
|
||||||
- python-gist
|
- python-gist
|
||||||
- yapf
|
- yapf
|
||||||
|
|||||||
5
roles/readline/tasks/main.yaml
Normal file
5
roles/readline/tasks/main.yaml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
- name: create .inputrc config file
|
||||||
|
template:
|
||||||
|
src: inputrc
|
||||||
|
dest: '{{ansible_env.HOME}}/.inputrc'
|
||||||
11
roles/readline/templates/inputrc
Normal file
11
roles/readline/templates/inputrc
Normal 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"
|
||||||
14
roles/sudo/tasks/main.yaml
Normal file
14
roles/sudo/tasks/main.yaml
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
---
|
||||||
|
- assert:
|
||||||
|
that: ansible_user_id != "root"
|
||||||
|
|
||||||
|
- include_vars: '{{ansible_os_family}}.yaml'
|
||||||
|
|
||||||
|
- name: create /etc/sudoers.d/{user} config file
|
||||||
|
become: true
|
||||||
|
template:
|
||||||
|
src: sudoers
|
||||||
|
dest: '/etc/sudoers.d/{{ansible_user_id}}'
|
||||||
|
owner: '{{sudo_owner}}'
|
||||||
|
group: '{{sudo_group}}'
|
||||||
|
mode: '0440'
|
||||||
1
roles/sudo/templates/sudoers
Normal file
1
roles/sudo/templates/sudoers
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{{ansible_user_id}} ALL=(ALL) NOPASSWD:ALL
|
||||||
3
roles/sudo/vars/Darwin.yaml
Normal file
3
roles/sudo/vars/Darwin.yaml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
sudo_owner: root
|
||||||
|
sudo_group: wheel
|
||||||
3
roles/sudo/vars/Debian.yaml
Normal file
3
roles/sudo/vars/Debian.yaml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
sudo_owner: root
|
||||||
|
sudo_group: root
|
||||||
7
roles/system-info/handlers/main.yaml
Normal file
7
roles/system-info/handlers/main.yaml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
- name: restart system-info
|
||||||
|
systemd:
|
||||||
|
name: system-info
|
||||||
|
scope: user
|
||||||
|
daemon_reload: true
|
||||||
|
state: restarted
|
||||||
@@ -1,5 +1,36 @@
|
|||||||
---
|
---
|
||||||
# TODO:
|
- name: install apt packages
|
||||||
# cp $script_dir/system-info.service ~/.config/systemd/user/system-info.service
|
become: true
|
||||||
# systemctl --user enable system-info
|
apt:
|
||||||
# systemctl --user start system-info
|
name:
|
||||||
|
- gawk
|
||||||
|
- sysstat
|
||||||
|
state: latest
|
||||||
|
|
||||||
|
- name: create systemd user unit directory
|
||||||
|
file:
|
||||||
|
state: directory
|
||||||
|
dest: ~/.config/systemd/user
|
||||||
|
|
||||||
|
- set_fact:
|
||||||
|
SYSTEM_INFO_SCRIPT_DIR: '{{ansible_env.HOME}}/.config/tmux/system-info'
|
||||||
|
|
||||||
|
- when: '"WSL" not in ansible_kernel'
|
||||||
|
set_fact:
|
||||||
|
SYSTEM_INFO_SCRIPT: '{{SYSTEM_INFO_SCRIPT_DIR}}/system-info-Linux.sh'
|
||||||
|
- when: '"WSL" in ansible_kernel'
|
||||||
|
set_fact:
|
||||||
|
SYSTEM_INFO_SCRIPT: '{{SYSTEM_INFO_SCRIPT_DIR}}/system-info-WSL.sh'
|
||||||
|
|
||||||
|
- name: install system-info systemd unit
|
||||||
|
template:
|
||||||
|
src: templates/system-info.service.j2
|
||||||
|
dest: ~/.config/systemd/user/system-info.service
|
||||||
|
notify: restart system-info
|
||||||
|
|
||||||
|
- name: enable system-info service
|
||||||
|
systemd:
|
||||||
|
name: system-info
|
||||||
|
scope: user
|
||||||
|
enabled: true
|
||||||
|
state: started
|
||||||
|
|||||||
@@ -30,29 +30,29 @@
|
|||||||
start_when_available: true
|
start_when_available: true
|
||||||
wake_to_run: false
|
wake_to_run: false
|
||||||
|
|
||||||
- name: create system-info-WSL.sh scheduled task
|
# - name: create system-info-WSL.sh scheduled task
|
||||||
win_scheduled_task:
|
# win_scheduled_task:
|
||||||
path: Benie
|
# path: Benie
|
||||||
name: system-info-WSL.sh
|
# name: system-info-WSL.sh
|
||||||
state: present
|
# state: present
|
||||||
enable: true
|
# enable: true
|
||||||
triggers:
|
# triggers:
|
||||||
- type: logon
|
# - type: logon
|
||||||
enabled: true
|
# enabled: true
|
||||||
- type: registration
|
# - type: registration
|
||||||
enabled: true
|
# enabled: true
|
||||||
actions:
|
# actions:
|
||||||
- path: '{{wsl_exe}}'
|
# - path: '{{wsl_exe}}'
|
||||||
arguments: '-d Debian -e /home/benie/.config/tmux/system-info/system-info-WSL.sh'
|
# arguments: '-d Debian -e /home/benie/.config/tmux/system-info/system-info-WSL.sh'
|
||||||
disallow_start_if_on_batteries: false
|
# disallow_start_if_on_batteries: false
|
||||||
stop_if_going_on_batteries: false
|
# stop_if_going_on_batteries: false
|
||||||
execution_time_limit: PT0S
|
# execution_time_limit: PT0S
|
||||||
logon_type: password
|
# logon_type: password
|
||||||
username: '{{ansible_user}}'
|
# username: '{{ansible_user}}'
|
||||||
password: '{{ansible_password}}'
|
# password: '{{ansible_password}}'
|
||||||
multiple_instances: 3
|
# multiple_instances: 3
|
||||||
run_level: limited
|
# run_level: limited
|
||||||
start_when_available: true
|
# start_when_available: true
|
||||||
wake_to_run: false
|
# wake_to_run: false
|
||||||
|
|
||||||
# - TODO: configure firewall
|
# - TODO: configure firewall
|
||||||
|
|||||||
9
roles/system-info/templates/system-info.service.j2
Normal file
9
roles/system-info/templates/system-info.service.j2
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=System Info
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
ExecStart={{SYSTEM_INFO_SCRIPT}}
|
||||||
|
Environment=LC_ALL=C.UTF-8
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=default.target
|
||||||
5
roles/tidy/tasks/Darwin.yaml
Normal file
5
roles/tidy/tasks/Darwin.yaml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
- name: install homebrew package
|
||||||
|
homebrew:
|
||||||
|
name: tidy-html5
|
||||||
|
state: latest
|
||||||
6
roles/tidy/tasks/Debian.yaml
Normal file
6
roles/tidy/tasks/Debian.yaml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
- name: install apt package
|
||||||
|
become: true
|
||||||
|
apt:
|
||||||
|
name: tidy
|
||||||
|
state: latest
|
||||||
2
roles/tidy/tasks/main.yaml
Normal file
2
roles/tidy/tasks/main.yaml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
---
|
||||||
|
- include_tasks: '{{ansible_os_family}}.yaml'
|
||||||
@@ -3,6 +3,21 @@
|
|||||||
pacman:
|
pacman:
|
||||||
name:
|
name:
|
||||||
- tmux
|
- tmux
|
||||||
- xclip
|
|
||||||
- urlscan
|
- urlscan
|
||||||
state: latest
|
state: latest
|
||||||
|
|
||||||
|
- name: install pacman package
|
||||||
|
when: '"WSL" not in ansible_kernel'
|
||||||
|
become: true
|
||||||
|
pacman:
|
||||||
|
name: xsel
|
||||||
|
state: latest
|
||||||
|
|
||||||
|
- name: remove pacman package
|
||||||
|
when: '"WSL" in ansible_kernel'
|
||||||
|
become: true
|
||||||
|
pacman:
|
||||||
|
name:
|
||||||
|
- xclip
|
||||||
|
- xsel
|
||||||
|
state: absent
|
||||||
|
|||||||
@@ -3,7 +3,34 @@
|
|||||||
homebrew:
|
homebrew:
|
||||||
name:
|
name:
|
||||||
- tmux
|
- tmux
|
||||||
- osx-cpu-temp
|
|
||||||
- reattach-to-user-namespace
|
- reattach-to-user-namespace
|
||||||
- urlview
|
- urlview
|
||||||
state: latest
|
state: latest
|
||||||
|
|
||||||
|
- name: check terminal info description exists
|
||||||
|
command: /usr/bin/infocmp -x tmux-256color
|
||||||
|
changed_when: false
|
||||||
|
failed_when: false
|
||||||
|
register: terminfo_exists
|
||||||
|
|
||||||
|
- name: download latest terminfo description
|
||||||
|
when: terminfo_exists.rc == 1
|
||||||
|
get_url:
|
||||||
|
url: https://gist.githubusercontent.com/nicm/ea9cf3c93f22e0246ec858122d9abea1/raw/37ae29fc86e88b48dbc8a674478ad3e7a009f357/tmux-256color
|
||||||
|
dest: ~/tmux-256color
|
||||||
|
|
||||||
|
- name: compile terminal info
|
||||||
|
when: terminfo_exists.rc == 1
|
||||||
|
command: /usr/bin/tic -x ~/tmux-256color
|
||||||
|
|
||||||
|
- name: cleanup downloaded terminfo description
|
||||||
|
when: terminfo_exists.rc == 1
|
||||||
|
file:
|
||||||
|
path: ~/tmux-256color
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- name: check terminal info description exists
|
||||||
|
when: terminfo_exists.rc == 1
|
||||||
|
command: /usr/bin/infocmp -x tmux-256color
|
||||||
|
changed_when: false
|
||||||
|
register: terminfo_exists
|
||||||
|
|||||||
@@ -1,12 +1,26 @@
|
|||||||
---
|
---
|
||||||
- name: install apt packages
|
- name: install apt packages
|
||||||
become: true
|
become: true
|
||||||
package:
|
apt:
|
||||||
name:
|
name:
|
||||||
- tmux
|
- tmux
|
||||||
- gawk
|
- gawk
|
||||||
- jq
|
|
||||||
- sysstat
|
- sysstat
|
||||||
- urlview
|
- urlview
|
||||||
- xclip
|
|
||||||
state: latest
|
state: latest
|
||||||
|
|
||||||
|
- name: install apt package
|
||||||
|
when: '"WSL" not in ansible_kernel'
|
||||||
|
become: true
|
||||||
|
apt:
|
||||||
|
name: xsel
|
||||||
|
state: latest
|
||||||
|
|
||||||
|
- name: remove apt package
|
||||||
|
when: '"WSL" in ansible_kernel'
|
||||||
|
become: true
|
||||||
|
apt:
|
||||||
|
name:
|
||||||
|
- xclip
|
||||||
|
- xsel
|
||||||
|
state: absent
|
||||||
|
|||||||
@@ -3,8 +3,22 @@
|
|||||||
dnf:
|
dnf:
|
||||||
name:
|
name:
|
||||||
- tmux
|
- tmux
|
||||||
- xclip
|
|
||||||
- urlscan
|
- urlscan
|
||||||
- sysstat
|
- sysstat
|
||||||
- jq
|
|
||||||
state: latest
|
state: latest
|
||||||
|
|
||||||
|
- name: install dnf package
|
||||||
|
when: '"WSL" not in ansible_kernel'
|
||||||
|
become: true
|
||||||
|
dnf:
|
||||||
|
name: xsel
|
||||||
|
state: latest
|
||||||
|
|
||||||
|
- name: remove dnf package
|
||||||
|
when: '"WSL" in ansible_kernel'
|
||||||
|
become: true
|
||||||
|
dnf:
|
||||||
|
name:
|
||||||
|
- xclip
|
||||||
|
- xsel
|
||||||
|
state: absent
|
||||||
|
|||||||
@@ -9,31 +9,4 @@
|
|||||||
|
|
||||||
# TODO: - name: set repo email
|
# TODO: - name: set repo email
|
||||||
|
|
||||||
- name: create layouts directory
|
- include_tasks: ~/.config/tmux/tasks.yaml
|
||||||
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...
|
|
||||||
|
|||||||
8
roles/viscosity/tasks/main.yaml
Normal file
8
roles/viscosity/tasks/main.yaml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
- assert:
|
||||||
|
that: ansible_os_family == "Darwin"
|
||||||
|
|
||||||
|
- name: install homebrew package
|
||||||
|
homebrew_cask:
|
||||||
|
name: viscosity
|
||||||
|
state: latest
|
||||||
6
roles/watch/tasks/main.yaml
Normal file
6
roles/watch/tasks/main.yaml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
- name: install homebrew package
|
||||||
|
when: ansible_os_family == "Darwin"
|
||||||
|
homebrew:
|
||||||
|
name: watch
|
||||||
|
state: latest
|
||||||
8
roles/webcatalog/tasks/main.yaml
Normal file
8
roles/webcatalog/tasks/main.yaml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
- assert:
|
||||||
|
that: ansible_os_family == "Darwin"
|
||||||
|
|
||||||
|
- name: install homebrew package
|
||||||
|
homebrew_cask:
|
||||||
|
name: webcatalog
|
||||||
|
state: latest
|
||||||
5
roles/wget/tasks/Darwin.yaml
Normal file
5
roles/wget/tasks/Darwin.yaml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
- name: install homebrew package
|
||||||
|
homebrew:
|
||||||
|
name: wget
|
||||||
|
state: latest
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user