Compare commits
20 commits
37ae145d64
...
3e5323e771
Author | SHA1 | Date | |
---|---|---|---|
3e5323e771 | |||
9e47851f3b | |||
1a7b53d6f9 | |||
c583b81865 | |||
6620a53ac6 | |||
45d9404f22 | |||
b2c6782e41 | |||
f311309e05 | |||
41c76486f6 | |||
694ace85ad | |||
181cfe20fb | |||
e540c5d195 | |||
3d4c493a08 | |||
b0c601f4e7 | |||
107e6e3bd5 | |||
2808793ba6 | |||
983b5e7c48 | |||
19588596db | |||
8285b213e3 | |||
ac27e8d020 |
6 changed files with 157 additions and 14 deletions
115
ansible/playbooks/zsh.yml
Normal file
115
ansible/playbooks/zsh.yml
Normal file
|
@ -0,0 +1,115 @@
|
||||||
|
---
|
||||||
|
- name: Configure Zsh, Neofetch, FZF, and custom .zshrc
|
||||||
|
hosts: all
|
||||||
|
become: true
|
||||||
|
vars:
|
||||||
|
zsh_custom: "{{ ansible_env.HOME }}/.oh-my-zsh/custom"
|
||||||
|
user: "{{ ansible_user }}"
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Install necessary packages
|
||||||
|
apt:
|
||||||
|
name:
|
||||||
|
- zsh
|
||||||
|
- neofetch
|
||||||
|
- fzf
|
||||||
|
state: present
|
||||||
|
update_cache: yes
|
||||||
|
|
||||||
|
- name: Pre-create basic .zshrc
|
||||||
|
copy:
|
||||||
|
dest: "/home/{{ user }}/.zshrc"
|
||||||
|
content: |
|
||||||
|
# Path to your Oh My Zsh installation.
|
||||||
|
export ZSH="$HOME/.oh-my-zsh"
|
||||||
|
export PATH=$PATH:$HOME/.local/bin
|
||||||
|
|
||||||
|
# Set theme
|
||||||
|
ZSH_THEME="robbyrussell"
|
||||||
|
|
||||||
|
# Plugins
|
||||||
|
plugins=(git ubuntu copypath copyfile dirhistory zsh-interactive-cd docker docker-compose opentofu zsh-history-substring-search zsh-autosuggestions zsh-syntax-highlighting you-should-use)
|
||||||
|
|
||||||
|
source $ZSH/oh-my-zsh.sh
|
||||||
|
|
||||||
|
# Set up Oh My Posh
|
||||||
|
eval "$(oh-my-posh init zsh --config https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/sonicboom_dark.omp.json)"
|
||||||
|
|
||||||
|
# Custom aliases
|
||||||
|
alias dcd="docker compose down"
|
||||||
|
alias dcu="docker compose up -d"
|
||||||
|
|
||||||
|
# Display system information
|
||||||
|
neofetch
|
||||||
|
owner: "{{ user }}"
|
||||||
|
mode: '0644'
|
||||||
|
|
||||||
|
- name: Download Oh My Zsh installation script
|
||||||
|
get_url:
|
||||||
|
url: https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh
|
||||||
|
dest: /tmp/install_ohmyzsh.sh
|
||||||
|
|
||||||
|
- name: Run Oh My Zsh installation script
|
||||||
|
command: sh /tmp/install_ohmyzsh.sh --unattended
|
||||||
|
register: ohmyzsh_result
|
||||||
|
failed_when: "'FAILED' in ohmyzsh_result.stderr"
|
||||||
|
args:
|
||||||
|
chdir: "/home/{{ user }}"
|
||||||
|
environment:
|
||||||
|
HOME: "/home/{{ user }}"
|
||||||
|
RUNZSH: "no"
|
||||||
|
|
||||||
|
- name: Ensure custom plugins directory exists
|
||||||
|
file:
|
||||||
|
path: "{{ zsh_custom }}/plugins"
|
||||||
|
state: directory
|
||||||
|
owner: "{{ user }}"
|
||||||
|
group: "{{ user }}"
|
||||||
|
|
||||||
|
- name: Clone zsh-syntax-highlighting plugin
|
||||||
|
git:
|
||||||
|
repo: https://github.com/zsh-users/zsh-syntax-highlighting.git
|
||||||
|
dest: "/home/{{ ansible_user }}/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting"
|
||||||
|
update: yes
|
||||||
|
|
||||||
|
- name: Clone zsh-autosuggestions plugin
|
||||||
|
git:
|
||||||
|
repo: https://github.com/zsh-users/zsh-autosuggestions.git
|
||||||
|
dest: "/home/{{ ansible_user }}/.oh-my-zsh/custom/plugins/zsh-autosuggestions"
|
||||||
|
update: yes
|
||||||
|
|
||||||
|
- name: Clone zsh-history-substring-search plugin
|
||||||
|
git:
|
||||||
|
repo: https://github.com/zsh-users/zsh-history-substring-search.git
|
||||||
|
dest: "/home/{{ ansible_user }}/.oh-my-zsh/custom/plugins/zsh-history-substring-search"
|
||||||
|
update: yes
|
||||||
|
|
||||||
|
- name: Clone you-should-use plugin
|
||||||
|
git:
|
||||||
|
repo: https://github.com/MichaelAquilina/zsh-you-should-use.git
|
||||||
|
dest: "/home/{{ ansible_user }}/.oh-my-zsh/custom/plugins/you-should-use"
|
||||||
|
update: yes
|
||||||
|
|
||||||
|
- name: Ensure .local/bin directory exists
|
||||||
|
file:
|
||||||
|
path: "/home/{{ user }}/.local/bin"
|
||||||
|
state: directory
|
||||||
|
owner: "{{ user }}"
|
||||||
|
mode: '0755'
|
||||||
|
|
||||||
|
- name: Download Oh My Posh binary
|
||||||
|
get_url:
|
||||||
|
url: https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/posh-linux-amd64
|
||||||
|
dest: "/home/{{ user }}/.local/bin/oh-my-posh"
|
||||||
|
mode: '0755'
|
||||||
|
|
||||||
|
- name: Ensure ownership of .local/bin/oh-my-posh
|
||||||
|
file:
|
||||||
|
path: "/home/{{ user }}/.local/bin/oh-my-posh"
|
||||||
|
owner: "{{ user }}"
|
||||||
|
mode: '0755'
|
||||||
|
|
||||||
|
- name: Change default shell to Zsh (after setting up .zshrc)
|
||||||
|
user:
|
||||||
|
name: "{{ user }}"
|
||||||
|
shell: /bin/zsh
|
|
@ -18,7 +18,7 @@ services:
|
||||||
capabilities: [gpu]
|
capabilities: [gpu]
|
||||||
|
|
||||||
open-webui:
|
open-webui:
|
||||||
image: ghcr.io/open-webui/open-webui:v0.3.22
|
image: ghcr.io/open-webui/open-webui:v0.3.23
|
||||||
container_name: open-webui
|
container_name: open-webui
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
ports:
|
ports:
|
||||||
|
|
|
@ -43,7 +43,7 @@ services:
|
||||||
- PGID=1000
|
- PGID=1000
|
||||||
|
|
||||||
radarr:
|
radarr:
|
||||||
image: ghcr.io/linuxserver/radarr@sha256:3bee8fb8eb4bb93b77eb4e0c5d755f25649223965af59f5f0363ddda03c6d10c
|
image: ghcr.io/linuxserver/radarr@sha256:dfbce5095045fc1c15058318342ee590ab50379854b13464dd2ca17b10c4beb4
|
||||||
container_name: radarr
|
container_name: radarr
|
||||||
ports:
|
ports:
|
||||||
- "7878:7878"
|
- "7878:7878"
|
||||||
|
@ -57,7 +57,7 @@ services:
|
||||||
- PGID=1000
|
- PGID=1000
|
||||||
|
|
||||||
sonarr:
|
sonarr:
|
||||||
image: ghcr.io/linuxserver/sonarr@sha256:28cc44346fc87805b52a4376a89edc12cf082a5530cffee800a6c05dee482734
|
image: ghcr.io/linuxserver/sonarr@sha256:98c21a64377619ec74778c70cc2e74d3e978a4d2c61f97b9ad88a0e5bc0766f9
|
||||||
container_name: sonarr
|
container_name: sonarr
|
||||||
ports:
|
ports:
|
||||||
- "8989:8989"
|
- "8989:8989"
|
||||||
|
|
21
packer/ubuntu-jammy/files/.zshrc
Normal file
21
packer/ubuntu-jammy/files/.zshrc
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
# Path to your Oh My Zsh installation.
|
||||||
|
export ZSH="$HOME/.oh-my-zsh"
|
||||||
|
export PATH=$PATH:$HOME/.local/bin
|
||||||
|
|
||||||
|
# Set theme
|
||||||
|
ZSH_THEME="robbyrussell"
|
||||||
|
|
||||||
|
# Plugins
|
||||||
|
plugins=(git ubuntu copypath copyfile dirhistory zsh-interactive-cd docker docker-compose opentofu zsh-history-substring-search zsh-autosuggestions zsh-syntax-highlighting you-should-use)
|
||||||
|
|
||||||
|
source $ZSH/oh-my-zsh.sh
|
||||||
|
|
||||||
|
# Set up Oh My Posh
|
||||||
|
eval "$(oh-my-posh init zsh --config https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/sonicboom_dark.omp.json)"
|
||||||
|
|
||||||
|
# Custom aliases
|
||||||
|
alias dcd="docker compose down"
|
||||||
|
alias dcu="docker compose up -d"
|
||||||
|
|
||||||
|
# Display system information
|
||||||
|
neofetch
|
|
@ -94,27 +94,38 @@ build {
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
provisioner "file" {
|
provisioner "file" {
|
||||||
source = "files/pve.cfg"
|
source = "files/pve.cfg"
|
||||||
destination = "/tmp/pve.cfg"
|
destination = "/tmp/pve.cfg"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
provisioner "shell" {
|
provisioner "shell" {
|
||||||
inline = [ "sudo cp /tmp/pve.cfg /etc/cloud/cloud.cfg.d/pve.cfg" ]
|
inline = [ "sudo cp /tmp/pve.cfg /etc/cloud/cloud.cfg.d/pve.cfg" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
# Install Commonly Used Things - add alias's - set git config
|
# Install commonly used things - add alias's - set git config
|
||||||
provisioner "shell" {
|
provisioner "shell" {
|
||||||
inline = [
|
inline = [
|
||||||
"sudo apt-get install -y ca-certificates curl gnupg lsb-release nfs-common qemu-guest-agent net-tools",
|
"sudo apt-get install -y ca-certificates curl gnupg lsb-release nfs-common qemu-guest-agent net-tools zsh neofetch fzf",
|
||||||
|
"sudo chsh -s $(which zsh) mafyuh",
|
||||||
"curl -fsSL https://get.docker.com | sudo sh",
|
"curl -fsSL https://get.docker.com | sudo sh",
|
||||||
"echo \"alias dcu='docker compose up -d'\" >> ~/.bashrc",
|
"sh -c \"$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)\" --unattended",
|
||||||
"echo \"alias dcd='docker compose down'\" >> ~/.bashrc",
|
"git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting",
|
||||||
|
"git clone https://github.com/zsh-users/zsh-autosuggestions.git $${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-autosuggestions",
|
||||||
|
"git clone https://github.com/zsh-users/zsh-history-substring-search.git $${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-history-substring-search",
|
||||||
|
"git clone https://github.com/MichaelAquilina/zsh-you-should-use.git $${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/you-should-use",
|
||||||
|
"mkdir -p /home/mafyuh/.local/bin",
|
||||||
|
"curl -fsSL https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/posh-linux-amd64 -o /home/mafyuh/.local/bin/oh-my-posh",
|
||||||
|
"sudo chmod +x /home/mafyuh/.local/bin/oh-my-posh",
|
||||||
"git config --global user.name \"Mafyuh\"",
|
"git config --global user.name \"Mafyuh\"",
|
||||||
"git config --global user.email \"matt@mafyuh.com\"",
|
"git config --global user.email \"matt@mafyuh.com\"",
|
||||||
"sudo apt-get -y update"
|
"sudo apt-get -y update"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
provisioner "file" {
|
||||||
|
source = "files/.zshrc"
|
||||||
|
destination = "~/.zshrc"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -65,7 +65,3 @@ resource "proxmox_virtual_environment_vm" "Ubu" {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
output "vm_ipv4_address" {
|
|
||||||
value = proxmox_virtual_environment_vm.Ubu.ipv4_addresses[1][0]
|
|
||||||
}
|
|
Loading…
Reference in a new issue