Compare commits
13 Commits
8c70ba71c1
...
benie/gnom
| Author | SHA1 | Date | |
|---|---|---|---|
| f5fc30a924 | |||
| 1f4c43a4a1 | |||
| 3b31dc06fe | |||
| 876db8ecfb | |||
| 959f4b2b32 | |||
| d8c6c6a808 | |||
| 5420eb9cd5 | |||
| 3fee590a8f | |||
| 0b71c22019 | |||
| db0b181473 | |||
| 65d96b2faa | |||
| 1749c78364 | |||
| b560f9c7d9 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,2 +1,3 @@
|
||||
external
|
||||
modules/win_git*
|
||||
playbooks/test.yaml
|
||||
|
||||
4
playbooks/1password.yaml
Normal file
4
playbooks/1password.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
- hosts: localhost
|
||||
roles:
|
||||
- 1password
|
||||
3
playbooks/Linux.yaml
Normal file
3
playbooks/Linux.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
---
|
||||
- import_playbook: LinuxCLI.yaml
|
||||
- import_playbook: UnixGUI.yaml
|
||||
5
playbooks/LinuxCLI.yaml
Normal file
5
playbooks/LinuxCLI.yaml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
- hosts: localhost
|
||||
roles:
|
||||
- role: gdb
|
||||
- role: system-info
|
||||
@@ -8,26 +8,25 @@
|
||||
- role: zsh
|
||||
- role: neovim
|
||||
- role: tmux
|
||||
- role: system-info
|
||||
when: '"WSL" not in ansible_kernel'
|
||||
|
||||
- role: ag
|
||||
- role: bash
|
||||
- role: bat
|
||||
- role: curl
|
||||
- role: editline
|
||||
- role: fzf
|
||||
- role: gh
|
||||
- role: git
|
||||
- role: glab
|
||||
- role: htop
|
||||
- role: jp
|
||||
- role: jq
|
||||
- role: readline
|
||||
- role: tidy
|
||||
- role: tree
|
||||
- role: yq
|
||||
- role: watch
|
||||
- role: wget
|
||||
- role: yq
|
||||
|
||||
- role: llvm
|
||||
- role: nodejs
|
||||
|
||||
- role: wsl
|
||||
when: '"WSL" in ansible_kernel'
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
---
|
||||
- import_playbook: UnixCLI.yaml
|
||||
- hosts: localhost
|
||||
roles:
|
||||
- role: 1password
|
||||
- role: fonts
|
||||
- role: obsidian
|
||||
- role: webcatalog
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
---
|
||||
- import_playbook: Unix.yaml
|
||||
- import_playbook: Windows.yaml
|
||||
- import_playbook: UnixCLI.yaml
|
||||
- hosts: localhost
|
||||
roles:
|
||||
- role: gdb
|
||||
- role: wsl
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
---
|
||||
- import_playbook: UnixCLI.yaml
|
||||
- hosts: localhost
|
||||
roles:
|
||||
- role: system-info
|
||||
- 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
|
||||
|
||||
22
roles/1password/tasks/RedHat.yaml
Normal file
22
roles/1password/tasks/RedHat.yaml
Normal file
@@ -0,0 +1,22 @@
|
||||
---
|
||||
- name: add yum repository key
|
||||
become: true
|
||||
rpm_key:
|
||||
key: https://downloads.1password.com/linux/keys/1password.asc
|
||||
|
||||
- name: add yum repository
|
||||
become: true
|
||||
yum_repository:
|
||||
name: 1password
|
||||
description: 1Password Stable Channel
|
||||
baseurl: https://downloads.1password.com/linux/rpm/stable/$basearch
|
||||
enabled: true
|
||||
gpgcheck: true
|
||||
repo_gpgcheck: true
|
||||
gpgkey: ['https://downloads.1password.com/linux/keys/1password.asc']
|
||||
|
||||
- name: install yum package
|
||||
become: true
|
||||
yum:
|
||||
name: 1password
|
||||
state: latest
|
||||
@@ -1,2 +1,3 @@
|
||||
---
|
||||
- include_tasks: '{{ansible_os_family}}.yaml'
|
||||
# TODO: If gnome-shell on wayland set global key binding in custom keyboard settings
|
||||
|
||||
6
roles/ag/tasks/RedHat.yaml
Normal file
6
roles/ag/tasks/RedHat.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
- name: install yum package
|
||||
become: true
|
||||
yum:
|
||||
name: the_silver_searcher
|
||||
state: latest
|
||||
@@ -4,7 +4,6 @@
|
||||
ansible_distribution == "Ubuntu" and
|
||||
ansible_distribution_version == "18.04"
|
||||
}}'
|
||||
- debug: msg={{use_github}}
|
||||
|
||||
- when: use_github
|
||||
include_tasks: deb.yaml
|
||||
|
||||
6
roles/bat/tasks/RedHat.yaml
Normal file
6
roles/bat/tasks/RedHat.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
- name: install yum package
|
||||
become: true
|
||||
yum:
|
||||
name: bat
|
||||
state: latest
|
||||
6
roles/curl/tasks/RedHat.yaml
Normal file
6
roles/curl/tasks/RedHat.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
- name: install yum package
|
||||
become: true
|
||||
yum:
|
||||
name: curl
|
||||
state: latest
|
||||
3
roles/fonts/handlers/main.yaml
Normal file
3
roles/fonts/handlers/main.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
---
|
||||
- name: refresh font cache
|
||||
command: fc-cache
|
||||
56
roles/fonts/tasks/Linux.yaml
Normal file
56
roles/fonts/tasks/Linux.yaml
Normal file
@@ -0,0 +1,56 @@
|
||||
---
|
||||
- name: stat version file
|
||||
stat:
|
||||
path: '{{ansible_env.HOME}}/.local/share/fonts/CaskaydiaCove.version'
|
||||
register: version_file
|
||||
|
||||
- name: slurp version
|
||||
when: version_file.stat.exists
|
||||
slurp:
|
||||
path: '{{ansible_env.HOME}}/.local/share/fonts/CaskaydiaCove.version'
|
||||
register: version_slurp
|
||||
|
||||
- when: version_file.stat.exists
|
||||
set_fact:
|
||||
version: '{{version_slurp.content | b64decode}}'
|
||||
|
||||
- name: get latest release
|
||||
uri:
|
||||
url: https://api.github.com/repos/ryanoasis/nerd-fonts/releases/latest
|
||||
register: latest
|
||||
|
||||
- set_fact:
|
||||
needs_installed:
|
||||
'{{ not version_file.stat.exists or version.strip() != latest.json.tag_name }}'
|
||||
asset: '{{ latest.json.assets | to_json | from_json |
|
||||
json_query("[?contains(name, `CascadiaCode.zip`)] | [0]") }}'
|
||||
|
||||
- name: create user fonts directory
|
||||
when: needs_installed
|
||||
file:
|
||||
path: '{{ansible_env.HOME}}/.local/share/fonts'
|
||||
state: directory
|
||||
|
||||
- name: download Caskaydia Cove Nerd Font archive
|
||||
when: needs_installed
|
||||
get_url:
|
||||
url: '{{asset.browser_download_url}}'
|
||||
dest: '{{ansible_env.HOME}}/.local/share/fonts/tmp.zip'
|
||||
|
||||
- name: install Caskaydia Cove Nerd Font
|
||||
when: needs_installed
|
||||
unarchive:
|
||||
src: '{{ansible_env.HOME}}/.local/share/fonts/tmp.zip'
|
||||
dest: '{{ansible_env.HOME}}/.local/share/fonts'
|
||||
notify: refresh font cache
|
||||
|
||||
- name: write version file
|
||||
copy:
|
||||
content: '{{latest.json.tag_name}}'
|
||||
dest: '{{ansible_env.HOME}}/.local/share/fonts/CaskaydiaCove.version'
|
||||
|
||||
- name: remove Caskaydia Cove Nerd Font archive
|
||||
when: needs_installed
|
||||
file:
|
||||
path: '{{ansible_env.HOME}}/.local/share/fonts/tmp.zip'
|
||||
state: absent
|
||||
@@ -1,2 +1,5 @@
|
||||
---
|
||||
- include_tasks: '{{ansible_os_family}}.yaml'
|
||||
- when: ansible_os_family == 'Darwin'
|
||||
include_tasks: 'Darwin.yaml'
|
||||
- when: ansible_os_family != 'Darwin' and ansible_os_family != 'Windows'
|
||||
include_tasks: 'Linux.yaml'
|
||||
|
||||
6
roles/fzf/tasks/RedHat.yaml
Normal file
6
roles/fzf/tasks/RedHat.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
- name: install yum package
|
||||
become: true
|
||||
yum:
|
||||
name: fzf
|
||||
state: latest
|
||||
6
roles/gdb/RedHat.yaml
Normal file
6
roles/gdb/RedHat.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
- name: install dnf package
|
||||
become: true
|
||||
dnf:
|
||||
name: gdb
|
||||
state: latest
|
||||
12
roles/gh/tasks/RedHat.yaml
Normal file
12
roles/gh/tasks/RedHat.yaml
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
- name: add yum repository
|
||||
become: true
|
||||
get_url:
|
||||
url: https://cli.github.com/packages/rpm/gh-cli.repo
|
||||
dest: /etc/yum.repos.d/gh-cli.repo
|
||||
|
||||
- name: install dnf package
|
||||
become: true
|
||||
dnf:
|
||||
name: gh
|
||||
state: latest
|
||||
6
roles/glab/tasks/RedHat.yaml
Normal file
6
roles/glab/tasks/RedHat.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
- name: install dnf package
|
||||
become: true
|
||||
dnf:
|
||||
name: glab
|
||||
state: latest
|
||||
6
roles/htop/tasks/RedHat.yaml
Normal file
6
roles/htop/tasks/RedHat.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
- name: install dnf package
|
||||
become: true
|
||||
dnf:
|
||||
name: htop
|
||||
state: latest
|
||||
51
roles/jp/tasks/RedHat.yaml
Normal file
51
roles/jp/tasks/RedHat.yaml
Normal file
@@ -0,0 +1,51 @@
|
||||
---
|
||||
- name: stat executable
|
||||
stat:
|
||||
path: '{{ansible_env.HOME}}/.local/bin/jp'
|
||||
register: jp_stat
|
||||
|
||||
- name: get installed version
|
||||
when: jp_stat.stat.exists
|
||||
command: jp --version
|
||||
changed_when: false
|
||||
register: jp_version
|
||||
|
||||
- name: extract installed version
|
||||
when: jp_stat.stat.exists
|
||||
set_fact:
|
||||
jp_installed_version:
|
||||
'{{jp_version.stdout.strip() | regex_replace("^.*(\d+\.\d+\.\d+).*$", "\1")}}'
|
||||
|
||||
- name: get latest release
|
||||
uri:
|
||||
url: 'https://api.github.com/repos/jmespath/jp/releases/latest'
|
||||
register: latest
|
||||
|
||||
- name: determine if jp needs installed
|
||||
set_fact:
|
||||
jp_needs_installed:
|
||||
'{{not jp_stat.stat.exists or jp_installed_version != latest.json.tag_name}}'
|
||||
arch_dict: {x86_64: amd64, arm64: arm64}
|
||||
|
||||
- name: select asset name
|
||||
when: jp_needs_installed
|
||||
set_fact:
|
||||
asset_query:
|
||||
'[?contains(name, `jp-linux-{{arch_dict[ansible_architecture]}}`)] | [0]'
|
||||
- name: select asset
|
||||
when: jp_needs_installed
|
||||
set_fact:
|
||||
asset: '{{latest.json.assets | to_json | from_json | json_query(asset_query)}}'
|
||||
|
||||
- name: create directory
|
||||
when: jp_needs_installed
|
||||
file:
|
||||
path: '{{ansible_env.HOME}}/.local/bin'
|
||||
state: directory
|
||||
|
||||
- name: install executable
|
||||
when: jp_needs_installed
|
||||
get_url:
|
||||
url: '{{asset.browser_download_url}}'
|
||||
dest: '{{ansible_env.HOME}}/.local/bin/jp'
|
||||
mode: '0755'
|
||||
6
roles/jq/tasks/RedHat.yaml
Normal file
6
roles/jq/tasks/RedHat.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
- name: install dnf package
|
||||
become: true
|
||||
dnf:
|
||||
name: jq
|
||||
state: latest
|
||||
10
roles/llvm/tasks/Fedora.yaml
Normal file
10
roles/llvm/tasks/Fedora.yaml
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
- name: install dnf packages
|
||||
become: true
|
||||
dnf:
|
||||
name:
|
||||
- clang
|
||||
- clang-tools-extra
|
||||
- git-clang-format
|
||||
- llvm
|
||||
state: latest
|
||||
@@ -1,7 +1,11 @@
|
||||
---
|
||||
- name: install homebrew packages
|
||||
homebrew:
|
||||
name: neovim
|
||||
name:
|
||||
- neovim
|
||||
state: latest
|
||||
|
||||
- set_fact:
|
||||
neovim_pip_packages: '{{neovim_pip_packages + ["pynvim"]}}'
|
||||
|
||||
- include_tasks: Unix.yaml
|
||||
|
||||
@@ -10,7 +10,9 @@
|
||||
- name: install apt package
|
||||
become: true
|
||||
apt:
|
||||
name: neovim
|
||||
name:
|
||||
- neovim
|
||||
- python3-neovim
|
||||
state: latest
|
||||
|
||||
- include_tasks: Unix.yaml
|
||||
|
||||
10
roles/neovim/tasks/RedHat.yaml
Normal file
10
roles/neovim/tasks/RedHat.yaml
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
- name: install dnf package
|
||||
become: true
|
||||
dnf:
|
||||
name:
|
||||
- neovim
|
||||
- python3-neovim
|
||||
state: latest
|
||||
|
||||
- include_tasks: Unix.yaml
|
||||
@@ -8,8 +8,6 @@
|
||||
dest: '{{vim_config_dir}}'
|
||||
version: master
|
||||
|
||||
# TODO: - name: set repo email
|
||||
|
||||
- name: install pip packages
|
||||
pip:
|
||||
name: '{{neovim_pip_packages}}'
|
||||
|
||||
@@ -3,6 +3,5 @@ neovim_pip_packages:
|
||||
- cmake-language-server
|
||||
- cmakelint
|
||||
- compdb
|
||||
- pynvim
|
||||
- vim-vint
|
||||
- yamllint
|
||||
|
||||
6
roles/nodejs/tasks/RedHat.yaml
Normal file
6
roles/nodejs/tasks/RedHat.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
- name: install yum package
|
||||
become: true
|
||||
yum:
|
||||
name: nodejs
|
||||
state: latest
|
||||
5
roles/obsidian/handlers/main.yaml
Normal file
5
roles/obsidian/handlers/main.yaml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
- name: install desktop menu
|
||||
command: >
|
||||
xdg-desktop-menu install --mode user
|
||||
{{ansible_env.HOME}}/.local/share/applications/obsidian-obsidian.desktop
|
||||
@@ -4,8 +4,4 @@
|
||||
name: obsidian
|
||||
state: latest
|
||||
|
||||
- name: clone notes repository
|
||||
git:
|
||||
repo: git@github.com:kbenzie/notes.git
|
||||
dest: '{{ansible_env.HOME}}/Documents/Notes'
|
||||
version: main
|
||||
- include_tasks: Unix.yaml
|
||||
|
||||
48
roles/obsidian/tasks/RedHat.yaml
Normal file
48
roles/obsidian/tasks/RedHat.yaml
Normal file
@@ -0,0 +1,48 @@
|
||||
---
|
||||
- name: stat symlink
|
||||
stat:
|
||||
path: '{{ansible_env.HOME}}/.local/bin/Obsidian'
|
||||
register: symlink_file
|
||||
|
||||
- name: get latest release
|
||||
uri:
|
||||
url: https://api.github.com/repos/obsidianmd/obsidian-releases/releases/latest
|
||||
register: latest
|
||||
|
||||
- set_fact:
|
||||
appimage: 'Obsidian-{{latest.json.name}}.AppImage'
|
||||
- set_fact:
|
||||
filepath: '{{ansible_env.HOME}}/.local/bin/{{appimage}}'
|
||||
asset_query: '[?contains(name, `{{appimage}}`)] | [0]'
|
||||
- set_fact:
|
||||
needs_installed:
|
||||
'{{not symlink_file.stat.exists or symlink_file.stat.lnk_source != filepath}}'
|
||||
asset: '{{latest.json.assets | to_json | from_json | json_query(asset_query)}}'
|
||||
|
||||
- name: download latest version
|
||||
get_url:
|
||||
url: '{{asset.browser_download_url}}'
|
||||
dest: '{{filepath}}'
|
||||
mode: '0755'
|
||||
|
||||
- name: create symlink
|
||||
file:
|
||||
src: '{{filepath}}'
|
||||
dest: '{{ansible_env.HOME}}/.local/bin/Obsidian'
|
||||
state: link
|
||||
|
||||
# TODO: icon for desktop file
|
||||
|
||||
- name: create desktop file
|
||||
template:
|
||||
src: obsidian.desktop.j2
|
||||
dest: '{{ansible_env.HOME}}/.local/share/applications/obsidian-obsidian.desktop'
|
||||
notify: install desktop menu
|
||||
|
||||
- name: remove old appimage
|
||||
when: needs_installed and symlink_file.stat.exists
|
||||
file:
|
||||
path: '{{symlink_file.stat.lnk_source}}'
|
||||
state: absent
|
||||
|
||||
- include_tasks: Unix.yaml
|
||||
6
roles/obsidian/tasks/Unix.yaml
Normal file
6
roles/obsidian/tasks/Unix.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
- name: clone notes repository
|
||||
git:
|
||||
repo: git@github.com:kbenzie/notes.git
|
||||
dest: '{{ansible_env.HOME}}/Documents/Notes'
|
||||
version: main
|
||||
11
roles/obsidian/templates/obsidian.desktop.j2
Normal file
11
roles/obsidian/templates/obsidian.desktop.j2
Normal file
@@ -0,0 +1,11 @@
|
||||
[Desktop Entry]
|
||||
Name=Obsidian
|
||||
Exec={{ansible_env.HOME}}/.local/bin/Obsidian
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Icon=obsidian
|
||||
StartupWMClass=Obsidian
|
||||
X-AppImage-Version={{latest.json.name}}
|
||||
Comment=Private and flexible note‑taking app that adapts to the way you think.
|
||||
MimeType=x-scheme-handler/obsidian;
|
||||
Categories=Utility;
|
||||
@@ -8,3 +8,4 @@
|
||||
- python3-pip
|
||||
- python3-venv
|
||||
- python3-virtualenv
|
||||
state: latest
|
||||
|
||||
9
roles/python/tasks/RedHat.yaml
Normal file
9
roles/python/tasks/RedHat.yaml
Normal file
@@ -0,0 +1,9 @@
|
||||
---
|
||||
- name: install yum packages
|
||||
become: true
|
||||
yum:
|
||||
name:
|
||||
- python3
|
||||
- python3-pip
|
||||
- python3-virtualenv
|
||||
state: latest
|
||||
3
roles/sudo/vars/RedHat.yaml
Normal file
3
roles/sudo/vars/RedHat.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
---
|
||||
sudo_owner: root
|
||||
sudo_group: wheel
|
||||
@@ -3,34 +3,10 @@
|
||||
become: true
|
||||
apt:
|
||||
name:
|
||||
- acpi
|
||||
- gawk
|
||||
- lm-sensors
|
||||
- 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
|
||||
- include_tasks: Linux.yaml
|
||||
|
||||
28
roles/system-info/tasks/Linux.yaml
Normal file
28
roles/system-info/tasks/Linux.yaml
Normal file
@@ -0,0 +1,28 @@
|
||||
---
|
||||
- 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
|
||||
11
roles/system-info/tasks/RedHat.yaml
Normal file
11
roles/system-info/tasks/RedHat.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
---
|
||||
- name: install dnf packages
|
||||
become: true
|
||||
dnf:
|
||||
name:
|
||||
- acpi
|
||||
- lm_sensors
|
||||
- sysstat
|
||||
state: latest
|
||||
|
||||
- include_tasks: Linux.yaml
|
||||
6
roles/tidy/tasks/RedHat.yaml
Normal file
6
roles/tidy/tasks/RedHat.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
- name: install dnf package
|
||||
become: true
|
||||
dnf:
|
||||
name: tidy
|
||||
state: latest
|
||||
10
roles/tmux/tasks/RedHat.yaml
Normal file
10
roles/tmux/tasks/RedHat.yaml
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
- name: install yum packages
|
||||
become: true
|
||||
yum:
|
||||
name:
|
||||
- tmux
|
||||
- sysstat
|
||||
- urlview
|
||||
- xsel
|
||||
state: latest
|
||||
6
roles/tree/tasks/RedHat.yaml
Normal file
6
roles/tree/tasks/RedHat.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
- name: install dnf package
|
||||
become: true
|
||||
dnf:
|
||||
name: tree
|
||||
state: latest
|
||||
4
roles/ulauncher/tasks/main.yaml
Normal file
4
roles/ulauncher/tasks/main.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
# TODO: Install ulauncher - or find a better alternative
|
||||
# TODO: If gnome-shell on wayland set global key binding in custom keyboard settings
|
||||
# TODO: Clone https://github.com/shepda/ulauncher-adwaita-darkish into ~/.config/ulauncher/user-themes
|
||||
5
roles/webcatalog/handlers/main.yaml
Normal file
5
roles/webcatalog/handlers/main.yaml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
- name: install desktop menu
|
||||
command: >
|
||||
xdg-desktop-menu install --mode user
|
||||
{{ansible_env.HOME}}/.local/share/applications/webcatalog-webcatalog.desktop
|
||||
5
roles/webcatalog/tasks/Darwin.yaml
Normal file
5
roles/webcatalog/tasks/Darwin.yaml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
- name: install homebrew package
|
||||
homebrew_cask:
|
||||
name: webcatalog
|
||||
state: latest
|
||||
49
roles/webcatalog/tasks/Linux.yaml
Normal file
49
roles/webcatalog/tasks/Linux.yaml
Normal file
@@ -0,0 +1,49 @@
|
||||
---
|
||||
- name: stat symlink
|
||||
stat:
|
||||
path: '{{ansible_env.HOME}}/.local/bin/WebCatalog'
|
||||
register: symlink_file
|
||||
|
||||
- name: get releases
|
||||
uri:
|
||||
url: https://raw.githubusercontent.com/kbenzie/webcatalog-release-scraper/main/webcatalog-releases.json
|
||||
return_content: true
|
||||
register: releases_raw
|
||||
|
||||
- set_fact:
|
||||
releases: '{{releases_raw.content | from_json}}'
|
||||
- set_fact:
|
||||
appimage: 'WebCatalog-{{releases[0].version}}.AppImage'
|
||||
- set_fact:
|
||||
filepath: '{{ansible_env.HOME}}/.local/bin/{{appimage}}'
|
||||
|
||||
- set_fact:
|
||||
needs_installed:
|
||||
'{{not symlink_file.stat.exists or symlink_file.stat.lnk_source != filepath}}'
|
||||
|
||||
- name: download latest version
|
||||
when: needs_installed
|
||||
get_url:
|
||||
url: 'https://cdn-2.webcatalog.io/webcatalog/{{appimage}}'
|
||||
dest: '{{ansible_env.HOME}}/.local/bin/{{appimage}}'
|
||||
mode: '0755'
|
||||
|
||||
- name: create symlink
|
||||
file:
|
||||
src: '{{filepath}}'
|
||||
dest: '{{ansible_env.HOME}}/.local/bin/WebCatalog'
|
||||
state: link
|
||||
|
||||
# TODO: icon for desktop file
|
||||
|
||||
- name: create desktop file
|
||||
template:
|
||||
src: webcatalog.desktop.j2
|
||||
dest: '{{ansible_env.HOME}}/.local/share/applications/webcatalog-webcatalog.desktop'
|
||||
notify: install desktop menu
|
||||
|
||||
- name: remove old appimage
|
||||
when: needs_installed and symlink_file.stat.exists
|
||||
file:
|
||||
path: '{{symlink_file.stat.lnk_source}}'
|
||||
state: absent
|
||||
@@ -1,8 +1,7 @@
|
||||
---
|
||||
- assert:
|
||||
that: ansible_os_family == "Darwin"
|
||||
|
||||
- name: install homebrew package
|
||||
homebrew_cask:
|
||||
name: webcatalog
|
||||
state: latest
|
||||
- when: ansible_os_family == 'Darwin'
|
||||
include_tasks: 'Darwin.yaml'
|
||||
- when: ansible_os_family == 'Windows'
|
||||
include_tasks: 'Windows.yaml'
|
||||
- when: ansible_os_family != 'Darwin' and ansible_os_family != 'Windows'
|
||||
include_tasks: 'Linux.yaml'
|
||||
|
||||
11
roles/webcatalog/templates/webcatalog.desktop.j2
Normal file
11
roles/webcatalog/templates/webcatalog.desktop.j2
Normal file
@@ -0,0 +1,11 @@
|
||||
[Desktop Entry]
|
||||
Name=WebCatalog
|
||||
Exec={{ansible_env.HOME}}/.local/bin/WebCatalog
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Icon=webcatalog
|
||||
StartupWMClass=WebCatalog
|
||||
X-AppImage-Version={{releases[0].version}}
|
||||
Comment=Turn Any Websites Into Real Desktop Apps
|
||||
MimeType=x-scheme-handler/webcatalog;
|
||||
Categories=Utility;
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
- name: install apt package
|
||||
become: true
|
||||
apt:
|
||||
name: wget
|
||||
state: latest
|
||||
|
||||
6
roles/wget/tasks/RedHat.yaml
Normal file
6
roles/wget/tasks/RedHat.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
- name: install dnf package
|
||||
become: true
|
||||
dnf:
|
||||
name: wget
|
||||
state: latest
|
||||
51
roles/yq/tasks/RedHat.yaml
Normal file
51
roles/yq/tasks/RedHat.yaml
Normal file
@@ -0,0 +1,51 @@
|
||||
---
|
||||
- name: stat executable
|
||||
stat:
|
||||
path: '{{ansible_env.HOME}}/.local/bin/yq'
|
||||
register: yq_stat
|
||||
|
||||
- name: get installed version
|
||||
when: yq_stat.stat.exists
|
||||
command: yq --version
|
||||
changed_when: false
|
||||
register: yq_version
|
||||
|
||||
- name: extract installed version
|
||||
when: yq_stat.stat.exists
|
||||
set_fact:
|
||||
yq_installed_version:
|
||||
'{{yq_version.stdout.strip() | regex_replace("^.*(\d+\.\d+\.\d+).*$", "\1")}}'
|
||||
|
||||
- name: get latest release
|
||||
uri:
|
||||
url: 'https://api.github.com/repos/mikefarah/yq/releases/latest'
|
||||
register: latest
|
||||
|
||||
- name: determine if yq needs installed
|
||||
set_fact:
|
||||
yq_needs_installed:
|
||||
'{{not yq_stat.stat.exists or yq_installed_version != latest.json.tag_name}}'
|
||||
arch_dict: {x86_64: amd64, arm64: arm64}
|
||||
|
||||
- name: select asset name
|
||||
when: yq_needs_installed
|
||||
set_fact:
|
||||
asset_query:
|
||||
'[?contains(name, `yq_linux_{{arch_dict[ansible_architecture]}}`)] | [0]'
|
||||
- name: select asset
|
||||
when: yq_needs_installed
|
||||
set_fact:
|
||||
asset: '{{latest.json.assets | to_json | from_json | json_query(asset_query)}}'
|
||||
|
||||
- name: create directory
|
||||
when: yq_needs_installed
|
||||
file:
|
||||
path: '{{ansible_env.HOME}}/.local/bin'
|
||||
state: directory
|
||||
|
||||
- name: install executable
|
||||
when: yq_needs_installed
|
||||
get_url:
|
||||
url: '{{asset.browser_download_url}}'
|
||||
dest: '{{ansible_env.HOME}}/.local/bin/yq'
|
||||
mode: '0755'
|
||||
8
roles/zsh/tasks/RedHat.yaml
Normal file
8
roles/zsh/tasks/RedHat.yaml
Normal file
@@ -0,0 +1,8 @@
|
||||
---
|
||||
- name: install yum packages
|
||||
become: true
|
||||
yum:
|
||||
name:
|
||||
- zsh
|
||||
- pinentry-tty
|
||||
state: latest
|
||||
Reference in New Issue
Block a user