8 Commits

Author SHA1 Message Date
356cf58e74 temp! 2022-07-02 11:36:54 +01:00
c596fcb87a Split out fzf from zsh into its own role 2022-06-18 22:09:56 +01:00
441343fd7c Add coc-yaml config 2022-06-18 21:18:02 +01:00
1184062dc7 Add hosts template for wsl role
For setting up an ssh connection to the Windows host to manage it.
2022-06-11 16:58:58 +01:00
d172e171b2 Fix directory creation in nodejs role 2022-06-11 12:31:34 +01:00
651909ff71 Add op role for Linux, macOS, and Windows 2022-06-05 20:38:48 +01:00
60a147124f Use ~/.local/src/node for tidyness 2022-06-05 20:37:42 +01:00
3aa7bcfa2e Add python3-venv for make coc.nvim work 2022-06-05 19:59:25 +01:00
23 changed files with 211 additions and 19 deletions

12
.vim/coc-settings.json Normal file
View File

@@ -0,0 +1,12 @@
{
"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"
]
}
}

View File

@@ -9,7 +9,9 @@
- role: ag
- role: bat
- role: fzf
- role: git
- role: op
- role: tree
- role: llvm

View File

@@ -7,7 +7,9 @@
- role: system-info
- role: ag
- role: fzf
- role: git
- role: op
- role: tree
- role: llvm

View File

@@ -1,4 +1,4 @@
---
- name: install fzf binaries
command:
cmd: ~/.config/zsh/fzf/install --bin
cmd: ~/.local/src/fzf/install --bin

View File

@@ -0,0 +1,5 @@
---
- name: install homebrew package
homebrew:
name: fzf
state: latest

View File

@@ -0,0 +1,13 @@
---
- name: clone fzf repo
git:
repo: https://github.com/junegunn/fzf.git
dest: ~/.local/src/fzf
notify: install fzf binaries
- meta: flush_handlers
- name: create symbolic links
file:
state: link
src: ~/.local/src/fzf/bin/fzf
dest: ~/.local/bin/fzf

View File

@@ -0,0 +1,12 @@
---
- name: install apt package
when: ansible_distribution == "Debian" and
ansible_distribution_version == "unstable"
become: true
apt:
name: fzf
state: latest
- include_tasks: Debian-old.yaml
when: not (ansible_distribution == "Debian" and
ansible_distribution_version == "unstable")

View File

@@ -0,0 +1,5 @@
---
- name: install chocolatey package
win_chocolatey:
name: fzf
state: latest

View File

@@ -0,0 +1,2 @@
---
- include_tasks: '{{ansible_os_family}}.yaml'

View File

@@ -7,22 +7,22 @@
- name: create directory for downloaded package
file:
state: directory
dest: ~/.local/src
dest: ~/.local/src/node
- name: download latest package
get_url:
url: 'https://nodejs.org/dist/{{latest.json[0].version}}/node-{{latest.json[0].version}}-linux-x64.tar.gz'
dest: ~/.local/src/node.tar.gz
dest: ~/.local/src/node/node.tar.gz
- name: extract downloaded package
unarchive:
src: ~/.local/src/node.tar.gz
dest: ~/.local/src
src: ~/.local/src/node/node.tar.gz
dest: ~/.local/src/node
remote_src: true
- name: create symlink links
- name: create symbolic links
file:
state: link
src: '~/.local/src/node-{{latest.json[0].version}}-linux-x64/bin/{{item}}'
src: '~/.local/src/node/node-{{latest.json[0].version}}-linux-x64/bin/{{item}}'
dest: '~/.local/bin/{{item}}'
with_items: [corepack, node, npm, npx]

View File

@@ -0,0 +1,5 @@
---
- name: install homebrew package
homebrew_cask:
name: 1password-cli
state: latest

View File

@@ -0,0 +1,38 @@
---
- 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

View File

@@ -0,0 +1,5 @@
---
- name: install chocolatey package
win_chocolatey:
name: op
state: latest

2
roles/op/tasks/main.yaml Normal file
View File

@@ -0,0 +1,2 @@
---
- include_tasks: '{{ansible_os_family}}.yaml'

View File

@@ -3,7 +3,8 @@
become: true
apt:
name:
- python-is-python3
- python3
- python3-pip
- python3-venv
- python3-virtualenv
- python-is-python3

View File

@@ -0,0 +1,3 @@
---
- set_fact:
download_url: https://cdn-2.webcatalog.io/webcatalog/WebCatalog-{{latest.version}}-universal.dmg

View File

@@ -0,0 +1,31 @@
---
- assert: {that: [ansible_machine == 'x86_64']}
- set_fact:
filename: 'WebCatalog-{{latest.version}}.AppImage'
# TODO: Support arm64: 'WebCatalog-{{latest.version}}-arm64.AppImage'
- name: create directory for download
file:
state: directory
dest: ~/.local/src/webcatalog
- name: download AppImage
get_url:
url: 'https://cdn-2.webcatalog.io/webcatalog/{{filename}}'
dest: '~/.local/src/webcatalog/{{filename}}'
- name: make AppImage executable
file:
dest: '~/.local/src/webcatalog/{{filename}}'
mode: a+x
- name: create symbolic link
file:
src: '~/.local/src/webcatalog/{{filename}}'
dest: '~/.local/bin/WebCatalog'
state: link
- name: create desktop file
template:
dest: io.webcatalog.WebCatalog.desktop

View File

@@ -0,0 +1,5 @@
---
- set_fact:
filename: WebCatalog%20Setup%20{{latest.version}}.exe
- name: download

View File

@@ -0,0 +1,19 @@
---
- name: get latest releases
uri:
url: https://raw.githubusercontent.com/kbenzie/webcatalog-release-scraper/main/webcatalog-releases.json
register: releases
- set_fact:
latest: '{{releases.json[0]}}'
- include_tasks: '{{ansible_os_family}}.yaml'
# TODO: Generate these links from the changelog from 42.0.0 up
- debug: msg=https://cdn-2.webcatalog.io/webcatalog/WebCatalog-{{latest.version}}-universal.dmg
- debug: msg=https://cdn-2.webcatalog.io/webcatalog/WebCatalog%20Setup%20{{latest.version}}.exe
- debug: msg=https://cdn-2.webcatalog.io/webcatalog/WebCatalog-{{latest.version}}.AppImage
- debug: msg=https://cdn-2.webcatalog.io/webcatalog/WebCatalog-{{latest.version}}-arm64.AppImage
# NOTE: Otherwise use https://github.com/webcatalog/webcatalog-legacy/releases

View File

@@ -0,0 +1,11 @@
[Desktop Entry]
Name=WebCatalog
Exec={{command}}
Terminal=false
Type=Application
Icon=webcatalog
StartupWMClass=WebCatalog
X-AppImage-Version={{latest.version}}
Comment=Turn Any Websites Into Real Desktop Apps
MimeType=x-scheme-handler/webcatalog;
Categories=Utility;

View File

@@ -1,17 +1,38 @@
---
- name: install apt packages
become: true
apt:
name: sshpass
state: latest
- name: create /etc/ansible
become: true
file:
dest: /etc/ansible
state: directory
- name: create hosts file
become: true
template:
src: templates/hosts.j2
dest: /etc/ansible/hosts
- name: create external directory
file:
dest: external
state: directory
- name: clone ansible win_git module
git:
repo: https://github.com/tivrobo/ansible-win_git.git
dest: external/ansible-win_git
version: master
- name: create ansible modules directory
file:
dest: ~/.ansible/plugins/modules
state: directory
- name: copy win_git files to ansible modules directory
copy:
src: '~/.config/local/external/ansible-win_git/{{item}}'

View File

@@ -0,0 +1,9 @@
---
all:
children:
windows:
hosts:
{{ansible_hostname}}.local:
ansible_user: {{ansible_user_id}}
ansible_connection: ssh
ansible_shell_type: cmd

View File

@@ -21,13 +21,6 @@
- repo: https://github.com/zsh-users/zsh-completions.git
dest: ~/.config/zsh/zsh-completions
- name: clone fzf repo
git:
repo: https://github.com/junegunn/fzf.git
dest: ~/.config/zsh/fzf
notify: install fzf binaries
- meta: flush_handlers
- name: create directories
file:
state: directory
@@ -62,10 +55,6 @@
dest: ~/.local/share/zsh/site-functions/_layout
- src: ~/.config/zsh/notes/_note
dest: ~/.local/share/zsh/site-functions/_note
- src: ~/.config/zsh/fzf/bin/fzf
dest: ~/.local/bin/fzf
- src: ~/.config/zsh/fzf/bin/fzf-tmux
dest: ~/.local/bin/fzf-tmux
- src: ~/.config/zsh/cmake-uninstall
dest: ~/.local/bin/cmake-uninstall
- src: ~/.config/zsh/$