Compare commits
22 Commits
webcatalog
...
b159445520
| Author | SHA1 | Date | |
|---|---|---|---|
| b159445520 | |||
| 6a4a182cf5 | |||
| 55cc3441be | |||
| bd4e5f1941 | |||
| c9845be40c | |||
| f47b45d82c | |||
| 854bf8d1e9 | |||
| 3272331f08 | |||
| 8c9af58146 | |||
| e4a08c843c | |||
| c77b356968 | |||
| 7404c0ae59 | |||
| 06b511d823 | |||
| 9693194f7f | |||
| 337237a6e8 | |||
| 31eba75038 | |||
| 5728aba7df | |||
| 76b6d63064 | |||
| 189371d7f2 | |||
| 491a9a07b5 | |||
| c4e87f2022 | |||
| 09e7ec3ad4 |
@@ -6,17 +6,22 @@
|
|||||||
- 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: git
|
- role: git
|
||||||
- role: op
|
- role: htop
|
||||||
|
- role: tidy
|
||||||
- role: tree
|
- role: tree
|
||||||
|
|
||||||
- role: llvm
|
- role: llvm
|
||||||
- role: nodejs
|
- role: nodejs
|
||||||
- role: python
|
- role: python
|
||||||
|
|
||||||
|
- role: 1password
|
||||||
|
|
||||||
- role: wsl
|
- role: wsl
|
||||||
when: '"WSL" in ansible_kernel'
|
when: '"WSL" in ansible_kernel'
|
||||||
|
|||||||
@@ -2,14 +2,15 @@
|
|||||||
- hosts: windows
|
- hosts: windows
|
||||||
|
|
||||||
roles:
|
roles:
|
||||||
|
- 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: op
|
|
||||||
- role: tree
|
- role: tree
|
||||||
|
|
||||||
- role: llvm
|
- role: llvm
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
- import_playbook: unix.yaml
|
- import_playbook: Unix.yaml
|
||||||
|
|
||||||
- hosts: localhost
|
- hosts: localhost
|
||||||
|
|
||||||
|
|||||||
@@ -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,48 @@
|
|||||||
# TODO: https://support.1password.com/install-linux/#debian-or-ubuntu
|
---
|
||||||
|
- name: add apt signing key
|
||||||
|
when: '"WSL" not in ansible_kernel'
|
||||||
|
become: true
|
||||||
|
apt_key:
|
||||||
|
url: https://downloads.1password.com/linux/keys/1password.asc
|
||||||
|
keyring: /etc/apt/trusted.gpg.d/1password-archive-keyring.gpg
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- when: ansible_machine == 'x86_64'
|
||||||
|
set_fact:
|
||||||
|
arch: amd64
|
||||||
|
|
||||||
|
- assert:
|
||||||
|
that: arch is defined
|
||||||
|
fail_msg: 'Architecture not currently supported: {{ansible_machine}}'
|
||||||
|
|
||||||
|
- name: add apt repository
|
||||||
|
when: '"WSL" not in ansible_kernel'
|
||||||
|
become: true
|
||||||
|
apt_repository:
|
||||||
|
repo: >-
|
||||||
|
deb [arch={{arch}}
|
||||||
|
signed-by=/etc/apt/trusted.gpg.d/1password-archive-keyring.gpg]
|
||||||
|
https://downloads.1password.com/linux/debian/{{arch}} stable main
|
||||||
|
|
||||||
|
- name: install gui package
|
||||||
|
when: '"WSL" not in ansible_kernel'
|
||||||
|
become: true
|
||||||
|
apt:
|
||||||
|
name: 1password
|
||||||
|
state: latest
|
||||||
|
|
||||||
|
- name: install cli package
|
||||||
|
when: '"WSL" not in ansible_kernel'
|
||||||
|
become: true
|
||||||
|
apt:
|
||||||
|
name: 1password-cli
|
||||||
|
state: latest
|
||||||
|
|
||||||
|
- name: create symlink to op.exe
|
||||||
|
when: '"WSL" in ansible_kernel'
|
||||||
|
file:
|
||||||
|
state: link
|
||||||
|
src: /mnt/c/Users/Benie/AppData/Local/1Password/cli/op.exe
|
||||||
|
dest: ~/.local/bin/op
|
||||||
|
|
||||||
|
- include_tasks: zsh-completion.yaml
|
||||||
|
|||||||
@@ -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'
|
||||||
|
|||||||
10
roles/1password/tasks/zsh-completion.yaml
Normal file
10
roles/1password/tasks/zsh-completion.yaml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
---
|
||||||
|
- name: get op zsh completion script
|
||||||
|
command: op completion zsh
|
||||||
|
register: zsh_completion_script
|
||||||
|
changed_when: false
|
||||||
|
|
||||||
|
- name: create op zsh completion file
|
||||||
|
copy:
|
||||||
|
content: '{{zsh_completion_script.stdout}}'
|
||||||
|
dest: ~/.local/share/zsh/site-functions/_op
|
||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -1,12 +1,6 @@
|
|||||||
---
|
---
|
||||||
- name: install apt package
|
- name: install apt package
|
||||||
when: ansible_distribution == "Debian" and
|
|
||||||
ansible_distribution_version == "unstable"
|
|
||||||
become: true
|
become: true
|
||||||
apt:
|
apt:
|
||||||
name: fzf
|
name: fzf
|
||||||
state: latest
|
state: latest
|
||||||
|
|
||||||
- include_tasks: Debian-old.yaml
|
|
||||||
when: not (ansible_distribution == "Debian" and
|
|
||||||
ansible_distribution_version == "unstable")
|
|
||||||
|
|||||||
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:
|
||||||
|
|||||||
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
|
||||||
5
roles/htop/tasks/Debian.yaml
Normal file
5
roles/htop/tasks/Debian.yaml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
- name: install apt package
|
||||||
|
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'
|
||||||
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
|
||||||
5
roles/jq/tasks/Debian.yaml
Normal file
5
roles/jq/tasks/Debian.yaml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
- name: install apt package
|
||||||
|
apt:
|
||||||
|
name: jq
|
||||||
|
state: latest
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
- name: install chocolatey package
|
- name: install chocolatey package
|
||||||
win_chocolatey:
|
win_chocolatey:
|
||||||
name: op
|
name: jq
|
||||||
state: latest
|
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'
|
||||||
@@ -1,4 +1,7 @@
|
|||||||
---
|
---
|
||||||
|
- set_fact:
|
||||||
|
nvim_config_dir: '{{ansible_env.LOCALAPPDATA}}/nvim'
|
||||||
|
|
||||||
- name: install chocolatey packages
|
- name: install chocolatey packages
|
||||||
win_chocolatey:
|
win_chocolatey:
|
||||||
name: neovim
|
name: neovim
|
||||||
@@ -7,8 +10,12 @@
|
|||||||
- 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: '{{nvim_config_dir}}'
|
||||||
version: master
|
version: master
|
||||||
|
- win_owner:
|
||||||
|
path: '{{nvim_config_dir}}'
|
||||||
|
user: Benie
|
||||||
|
recurse: true
|
||||||
|
|
||||||
# - TODO: neovim set repo email
|
# - TODO: neovim set repo email
|
||||||
# win_git_config:
|
# win_git_config:
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -1,5 +1,25 @@
|
|||||||
---
|
---
|
||||||
# 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
|
||||||
|
|
||||||
|
- name: install system-info systemd unit
|
||||||
|
copy:
|
||||||
|
src: ~/.config/tmux/system-info/system-info.service
|
||||||
|
dest: ~/.config/systemd/user/system-info.service
|
||||||
|
|
||||||
|
- name: enable system-info service
|
||||||
|
systemd:
|
||||||
|
name: system-info
|
||||||
|
scope: user
|
||||||
|
enabled: true
|
||||||
|
state: started
|
||||||
|
|||||||
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'
|
||||||
@@ -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...
|
|
||||||
|
|||||||
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
|
||||||
5
roles/wget/tasks/Debian.yaml
Normal file
5
roles/wget/tasks/Debian.yaml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
- name: install apt package
|
||||||
|
apt:
|
||||||
|
name: wget
|
||||||
|
state: latest
|
||||||
16
roles/wget/tasks/main.yaml
Normal file
16
roles/wget/tasks/main.yaml
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
---
|
||||||
|
- include_tasks: '{{ansible_os_family}}.yaml'
|
||||||
|
|
||||||
|
- name: create directories
|
||||||
|
file:
|
||||||
|
state: directory
|
||||||
|
dest: '{{item}}'
|
||||||
|
with_items:
|
||||||
|
- ~/.config/wget
|
||||||
|
- ~/.cache/wget
|
||||||
|
|
||||||
|
- name: create config file
|
||||||
|
copy:
|
||||||
|
content: |
|
||||||
|
hsts-file = {{ansible_env.HOME}}/.cache/wget/hsts
|
||||||
|
dest: ~/.config/wget/rc
|
||||||
5
roles/yq/tasks/Darwin.yaml
Normal file
5
roles/yq/tasks/Darwin.yaml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
- name: install homebrew package
|
||||||
|
homebrew:
|
||||||
|
name: yq
|
||||||
|
state: latest
|
||||||
37
roles/yq/tasks/Debian.yaml
Normal file
37
roles/yq/tasks/Debian.yaml
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
---
|
||||||
|
- name: get latest github release
|
||||||
|
uri:
|
||||||
|
url: https://api.github.com/repos/mikefarah/yq/releases/latest
|
||||||
|
register: latest
|
||||||
|
|
||||||
|
- set_fact:
|
||||||
|
asset_query: '[?contains(name, `yq_linux_amd64`)] | [0]'
|
||||||
|
assets: '{{latest.json.assets}}'
|
||||||
|
latest_version: '{{latest.json.tag_name[1:]}}'
|
||||||
|
yq_exe: '{{ansible_env.HOME}}/.local/bin/yq'
|
||||||
|
|
||||||
|
- name: check if alreayd installed
|
||||||
|
stat:
|
||||||
|
path: '{{yq_exe}}'
|
||||||
|
register: yq_stat
|
||||||
|
|
||||||
|
- name: get installed version
|
||||||
|
when: yq_stat.stat.exists == True
|
||||||
|
command: '{{yq_exe}} --version'
|
||||||
|
register: yq_version_output
|
||||||
|
changed_when: false
|
||||||
|
|
||||||
|
- when: yq_stat.stat.exists == True
|
||||||
|
set_fact:
|
||||||
|
installed_version:
|
||||||
|
'{{yq_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: '{{yq_exe}}'
|
||||||
|
mode: +x
|
||||||
5
roles/yq/tasks/Windows.yaml
Normal file
5
roles/yq/tasks/Windows.yaml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
- name: install chocolatey package
|
||||||
|
win_chocolatey:
|
||||||
|
name: yq
|
||||||
|
state: latest
|
||||||
2
roles/yq/tasks/main.yaml
Normal file
2
roles/yq/tasks/main.yaml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
---
|
||||||
|
- include_tasks: '{{ansible_os_family}}.yaml'
|
||||||
Reference in New Issue
Block a user