Compare commits
22 Commits
moonlight
...
368982b8fa
| Author | SHA1 | Date | |
|---|---|---|---|
| 368982b8fa | |||
| b3cd84e181 | |||
| b0d2fd212e | |||
| f7ee7af25c | |||
| 50a9cc97b6 | |||
| e2d1414c3b | |||
| 576eb2ae41 | |||
| 69bcd75f7b | |||
| d32588dbfd | |||
| 4783803a77 | |||
| 1ad397771d | |||
| 6ff50854e0 | |||
| 5cba48f632 | |||
| 7e9166cb48 | |||
| 747f1a6992 | |||
| db3d146dc9 | |||
| 91839b927d | |||
| c5e2a76d2e | |||
| baa0206937 | |||
| 2abc38f696 | |||
| 63ff47c3b2 | |||
| da4b8858d3 |
@@ -1,6 +1,5 @@
|
||||
---
|
||||
- hosts: localhost
|
||||
|
||||
roles:
|
||||
- role: sudo
|
||||
when: ansible_user_id != "root"
|
||||
@@ -15,6 +14,7 @@
|
||||
- role: bat
|
||||
- role: curl
|
||||
- role: fzf
|
||||
- role: gh
|
||||
- role: git
|
||||
- role: htop
|
||||
- role: jp
|
||||
@@ -23,12 +23,11 @@
|
||||
- role: tidy
|
||||
- role: tree
|
||||
- role: yq
|
||||
- role: watch
|
||||
|
||||
- role: llvm
|
||||
- role: nodejs
|
||||
- role: python
|
||||
|
||||
- role: 1password
|
||||
|
||||
- role: wsl
|
||||
when: '"WSL" in ansible_kernel'
|
||||
5
UnixGUI.yaml
Normal file
5
UnixGUI.yaml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
- import_playbook: UnixCLI.yaml
|
||||
- hosts: localhost
|
||||
roles:
|
||||
- role: 1password
|
||||
@@ -14,8 +14,9 @@
|
||||
- role: bat
|
||||
- role: curl
|
||||
- role: fzf
|
||||
- role: tree
|
||||
- role: gh
|
||||
- role: jq
|
||||
- role: tree
|
||||
- role: yq
|
||||
|
||||
- role: llvm
|
||||
|
||||
12
macOS.yaml
12
macOS.yaml
@@ -1,7 +1,13 @@
|
||||
---
|
||||
- import_playbook: Unix.yaml
|
||||
|
||||
- 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
|
||||
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
|
||||
keyring: '{{keyring}}'
|
||||
state: present
|
||||
|
||||
- when: ansible_machine == 'x86_64'
|
||||
@@ -20,9 +23,9 @@
|
||||
become: true
|
||||
apt_repository:
|
||||
repo: >-
|
||||
deb [arch={{arch}}
|
||||
signed-by=/etc/apt/trusted.gpg.d/1password-archive-keyring.gpg]
|
||||
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'
|
||||
|
||||
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
|
||||
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
|
||||
win_chocolatey:
|
||||
name: moonlight-qt
|
||||
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'
|
||||
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
|
||||
register: latest
|
||||
|
||||
# TODO: Support arm64
|
||||
- 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}}'
|
||||
latest_version: '{{latest.json.tag_name}}'
|
||||
jp_exe: '{{ansible_env.HOME}}/.local/bin/jp'
|
||||
@@ -14,7 +17,7 @@
|
||||
- name: check if already installed
|
||||
stat:
|
||||
path: '{{jp_exe}}'
|
||||
register: jp_exe
|
||||
register: jp_stat
|
||||
|
||||
- name: get installed version
|
||||
when: jp_stat.stat.exists == True
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
- name: install apt package
|
||||
become: true
|
||||
apt:
|
||||
name: jq
|
||||
state: latest
|
||||
|
||||
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,6 +1,6 @@
|
||||
---
|
||||
- name: install homebrew package
|
||||
homebrew:
|
||||
homebrew_cask:
|
||||
name: obsidian
|
||||
state: latest
|
||||
|
||||
@@ -8,4 +8,4 @@
|
||||
git:
|
||||
repo: git@github.com:kbenzie/notes.git
|
||||
dest: '{{ansible_env.HOME}}/Documents/Notes'
|
||||
branch: main
|
||||
version: main
|
||||
|
||||
@@ -2,11 +2,13 @@
|
||||
- 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: root
|
||||
group: root
|
||||
owner: '{{sudo_owner}}'
|
||||
group: '{{sudo_group}}'
|
||||
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:
|
||||
name:
|
||||
- tmux
|
||||
- xclip
|
||||
- urlscan
|
||||
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
|
||||
|
||||
@@ -7,3 +7,31 @@
|
||||
- reattach-to-user-namespace
|
||||
- urlview
|
||||
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
|
||||
become: true
|
||||
package:
|
||||
apt:
|
||||
name:
|
||||
- tmux
|
||||
- gawk
|
||||
- jq
|
||||
- sysstat
|
||||
- urlview
|
||||
- xclip
|
||||
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:
|
||||
name:
|
||||
- tmux
|
||||
- xclip
|
||||
- urlscan
|
||||
- sysstat
|
||||
- jq
|
||||
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
|
||||
Reference in New Issue
Block a user