Compare commits
37 Commits
moonlight
...
8fae111d0e
| Author | SHA1 | Date | |
|---|---|---|---|
| 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 |
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,9 +1,9 @@
|
|||||||
---
|
---
|
||||||
- hosts: localhost
|
- hosts: localhost
|
||||||
|
|
||||||
roles:
|
roles:
|
||||||
- role: sudo
|
- role: sudo
|
||||||
when: ansible_user_id != "root"
|
when: ansible_user_id != "root"
|
||||||
|
- role: python
|
||||||
|
|
||||||
- role: zsh
|
- role: zsh
|
||||||
- role: neovim
|
- role: neovim
|
||||||
@@ -15,6 +15,7 @@
|
|||||||
- role: bat
|
- role: bat
|
||||||
- role: curl
|
- role: curl
|
||||||
- role: fzf
|
- role: fzf
|
||||||
|
- role: gh
|
||||||
- role: git
|
- role: git
|
||||||
- role: htop
|
- role: htop
|
||||||
- role: jp
|
- role: jp
|
||||||
@@ -23,12 +24,10 @@
|
|||||||
- role: tidy
|
- role: tidy
|
||||||
- role: tree
|
- role: tree
|
||||||
- role: yq
|
- role: yq
|
||||||
|
- role: watch
|
||||||
|
|
||||||
- role: llvm
|
- role: llvm
|
||||||
- role: nodejs
|
- role: nodejs
|
||||||
- role: python
|
|
||||||
|
|
||||||
- role: 1password
|
|
||||||
|
|
||||||
- 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
|
||||||
@@ -5,6 +5,7 @@
|
|||||||
install_cad_apps: false
|
install_cad_apps: false
|
||||||
|
|
||||||
roles:
|
roles:
|
||||||
|
- role: python
|
||||||
- role: git
|
- role: git
|
||||||
- role: powershell
|
- role: powershell
|
||||||
- role: neovim
|
- role: neovim
|
||||||
@@ -14,13 +15,13 @@
|
|||||||
- role: bat
|
- role: bat
|
||||||
- role: curl
|
- role: curl
|
||||||
- role: fzf
|
- role: fzf
|
||||||
- role: tree
|
- role: gh
|
||||||
- role: jq
|
- role: jq
|
||||||
|
- role: tree
|
||||||
- role: yq
|
- role: yq
|
||||||
|
|
||||||
- role: llvm
|
- role: llvm
|
||||||
- role: nodejs
|
- role: nodejs
|
||||||
- role: python
|
|
||||||
|
|
||||||
- role: 1password
|
- role: 1password
|
||||||
- role: autohotkey
|
- role: autohotkey
|
||||||
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,10 +1,13 @@
|
|||||||
---
|
---
|
||||||
|
- set_fact:
|
||||||
|
keyring: /etc/apt/trusted.gpg.d/1password-archive-keyring.gpg
|
||||||
|
|
||||||
- name: add apt signing key
|
- name: add apt signing key
|
||||||
when: '"WSL" not in ansible_kernel'
|
when: '"WSL" not in ansible_kernel'
|
||||||
become: true
|
become: true
|
||||||
apt_key:
|
apt_key:
|
||||||
url: https://downloads.1password.com/linux/keys/1password.asc
|
url: https://downloads.1password.com/linux/keys/1password.asc
|
||||||
keyring: /etc/apt/trusted.gpg.d/1password-archive-keyring.gpg
|
keyring: '{{keyring}}'
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- when: ansible_machine == 'x86_64'
|
- when: ansible_machine == 'x86_64'
|
||||||
@@ -20,9 +23,9 @@
|
|||||||
become: true
|
become: true
|
||||||
apt_repository:
|
apt_repository:
|
||||||
repo: >-
|
repo: >-
|
||||||
deb [arch={{arch}}
|
deb [arch={{arch}} signed-by={{keyring}}]
|
||||||
signed-by=/etc/apt/trusted.gpg.d/1password-archive-keyring.gpg]
|
|
||||||
https://downloads.1password.com/linux/debian/{{arch}} stable main
|
https://downloads.1password.com/linux/debian/{{arch}} stable main
|
||||||
|
filename: 1password
|
||||||
|
|
||||||
- name: install gui package
|
- name: install gui package
|
||||||
when: '"WSL" not in ansible_kernel'
|
when: '"WSL" not in ansible_kernel'
|
||||||
|
|||||||
@@ -4,6 +4,11 @@
|
|||||||
register: zsh_completion_script
|
register: zsh_completion_script
|
||||||
changed_when: false
|
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
|
- name: create op zsh completion file
|
||||||
copy:
|
copy:
|
||||||
content: '{{zsh_completion_script.stdout}}'
|
content: '{{zsh_completion_script.stdout}}'
|
||||||
|
|||||||
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,6 +1,8 @@
|
|||||||
---
|
---
|
||||||
- name: install apt package
|
- when: ansible_distribution == 'Ubuntu' and
|
||||||
become: true
|
ansible_distribution_version is version('22.04', '<=')
|
||||||
apt:
|
include_tasks: Debian-old.yaml
|
||||||
name: fzf
|
|
||||||
state: latest
|
- when: not (ansible_distribution == 'Ubuntu' and
|
||||||
|
ansible_distribution_version is version('22.04', '<='))
|
||||||
|
include_tasks: Debian-apt.yaml
|
||||||
|
|||||||
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
|
||||||
5
roles/gh/tasks/Windows.yaml
Normal file
5
roles/gh/tasks/Windows.yaml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
- name: install chocolatey package
|
||||||
|
win_chocolatey:
|
||||||
|
name: gh
|
||||||
|
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'
|
||||||
@@ -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'
|
||||||
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?
|
||||||
@@ -4,9 +4,12 @@
|
|||||||
url: https://api.github.com/repos/jmespath/jp/releases/latest
|
url: https://api.github.com/repos/jmespath/jp/releases/latest
|
||||||
register: latest
|
register: latest
|
||||||
|
|
||||||
# TODO: Support arm64
|
|
||||||
- set_fact:
|
- set_fact:
|
||||||
asset_query: '[?contains(name, `jp-darwin-amd64`)] | [0]'
|
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}}'
|
assets: '{{latest.json.assets}}'
|
||||||
latest_version: '{{latest.json.tag_name}}'
|
latest_version: '{{latest.json.tag_name}}'
|
||||||
jp_exe: '{{ansible_env.HOME}}/.local/bin/jp'
|
jp_exe: '{{ansible_env.HOME}}/.local/bin/jp'
|
||||||
@@ -14,7 +17,7 @@
|
|||||||
- name: check if already installed
|
- name: check if already installed
|
||||||
stat:
|
stat:
|
||||||
path: '{{jp_exe}}'
|
path: '{{jp_exe}}'
|
||||||
register: jp_exe
|
register: jp_stat
|
||||||
|
|
||||||
- name: get installed version
|
- name: get installed version
|
||||||
when: jp_stat.stat.exists == True
|
when: jp_stat.stat.exists == True
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
---
|
---
|
||||||
- name: install apt package
|
- name: install apt package
|
||||||
|
become: true
|
||||||
apt:
|
apt:
|
||||||
name: jq
|
name: jq
|
||||||
state: latest
|
state: latest
|
||||||
|
|||||||
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
|
||||||
@@ -1,4 +1,12 @@
|
|||||||
---
|
---
|
||||||
|
- 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:
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -6,3 +6,9 @@
|
|||||||
win_chocolatey:
|
win_chocolatey:
|
||||||
name: prusaslicer
|
name: prusaslicer
|
||||||
state: latest
|
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
|
||||||
|
|||||||
@@ -2,11 +2,13 @@
|
|||||||
- assert:
|
- assert:
|
||||||
that: ansible_user_id != "root"
|
that: ansible_user_id != "root"
|
||||||
|
|
||||||
|
- include_vars: '{{ansible_os_family}}.yaml'
|
||||||
|
|
||||||
- name: create /etc/sudoers.d/{user} config file
|
- name: create /etc/sudoers.d/{user} config file
|
||||||
become: true
|
become: true
|
||||||
template:
|
template:
|
||||||
src: sudoers
|
src: sudoers
|
||||||
dest: '/etc/sudoers.d/{{ansible_user_id}}'
|
dest: '/etc/sudoers.d/{{ansible_user_id}}'
|
||||||
owner: root
|
owner: '{{sudo_owner}}'
|
||||||
group: root
|
group: '{{sudo_group}}'
|
||||||
mode: '0440'
|
mode: '0440'
|
||||||
|
|||||||
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
|
||||||
@@ -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
|
||||||
|
|||||||
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
|
||||||
@@ -36,7 +36,7 @@
|
|||||||
- name: copy win_git files to ansible modules directory
|
- name: copy win_git files to ansible modules directory
|
||||||
copy:
|
copy:
|
||||||
src: '~/.config/local/external/ansible-win_git/{{item}}'
|
src: '~/.config/local/external/ansible-win_git/{{item}}'
|
||||||
dest: '~/.ansible/plugins/modules/{{item}}'
|
dest: '~/.config/local/modules/{{item}}'
|
||||||
with_items:
|
with_items:
|
||||||
- win_git.ps1
|
- win_git.ps1
|
||||||
- win_git.py
|
- win_git.py
|
||||||
|
|||||||
@@ -64,6 +64,19 @@
|
|||||||
loop_control:
|
loop_control:
|
||||||
label: '{{item.dest}}'
|
label: '{{item.dest}}'
|
||||||
|
|
||||||
|
- name: list commands with available completions
|
||||||
|
command:
|
||||||
|
zsh {{ansible_env.HOME}}/.config/zsh/list-commands-with-available-completions.zsh
|
||||||
|
changed_when: false
|
||||||
|
register: completion_commands
|
||||||
|
|
||||||
|
- name: install completions for available commands
|
||||||
|
file:
|
||||||
|
state: link
|
||||||
|
src: '~/.config/zsh/zsh-completions/src/_{{item}}'
|
||||||
|
dest: '~/.local/share/zsh/site-functions/_{{item}}'
|
||||||
|
with_items: '{{completion_commands.stdout}}'
|
||||||
|
|
||||||
- name: get absolute path
|
- name: get absolute path
|
||||||
shell: command -v zsh
|
shell: command -v zsh
|
||||||
register: zsh
|
register: zsh
|
||||||
|
|||||||
Reference in New Issue
Block a user