Skip to content

Commit 1a7b53d

Browse files
author
Matt Reeves
committedSep 22, 2024
Merge branch 'main' into renovate/ghcr.io-open-webui-open-webui-0.x
2 parents 107e6e3 + c583b81 commit 1a7b53d

File tree

4 files changed

+154
-11
lines changed

4 files changed

+154
-11
lines changed
 

‎ansible/playbooks/zsh.yml

+115
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
---
2+
- name: Configure Zsh, Neofetch, FZF, and custom .zshrc
3+
hosts: all
4+
become: true
5+
vars:
6+
zsh_custom: "{{ ansible_env.HOME }}/.oh-my-zsh/custom"
7+
user: "{{ ansible_user }}"
8+
9+
tasks:
10+
- name: Install necessary packages
11+
apt:
12+
name:
13+
- zsh
14+
- neofetch
15+
- fzf
16+
state: present
17+
update_cache: yes
18+
19+
- name: Pre-create basic .zshrc
20+
copy:
21+
dest: "/home/{{ user }}/.zshrc"
22+
content: |
23+
# Path to your Oh My Zsh installation.
24+
export ZSH="$HOME/.oh-my-zsh"
25+
export PATH=$PATH:$HOME/.local/bin
26+
27+
# Set theme
28+
ZSH_THEME="robbyrussell"
29+
30+
# Plugins
31+
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)
32+
33+
source $ZSH/oh-my-zsh.sh
34+
35+
# Set up Oh My Posh
36+
eval "$(oh-my-posh init zsh --config https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/sonicboom_dark.omp.json)"
37+
38+
# Custom aliases
39+
alias dcd="docker compose down"
40+
alias dcu="docker compose up -d"
41+
42+
# Display system information
43+
neofetch
44+
owner: "{{ user }}"
45+
mode: '0644'
46+
47+
- name: Download Oh My Zsh installation script
48+
get_url:
49+
url: https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh
50+
dest: /tmp/install_ohmyzsh.sh
51+
52+
- name: Run Oh My Zsh installation script
53+
command: sh /tmp/install_ohmyzsh.sh --unattended
54+
register: ohmyzsh_result
55+
failed_when: "'FAILED' in ohmyzsh_result.stderr"
56+
args:
57+
chdir: "/home/{{ user }}"
58+
environment:
59+
HOME: "/home/{{ user }}"
60+
RUNZSH: "no"
61+
62+
- name: Ensure custom plugins directory exists
63+
file:
64+
path: "{{ zsh_custom }}/plugins"
65+
state: directory
66+
owner: "{{ user }}"
67+
group: "{{ user }}"
68+
69+
- name: Clone zsh-syntax-highlighting plugin
70+
git:
71+
repo: https://github.com/zsh-users/zsh-syntax-highlighting.git
72+
dest: "/home/{{ ansible_user }}/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting"
73+
update: yes
74+
75+
- name: Clone zsh-autosuggestions plugin
76+
git:
77+
repo: https://github.com/zsh-users/zsh-autosuggestions.git
78+
dest: "/home/{{ ansible_user }}/.oh-my-zsh/custom/plugins/zsh-autosuggestions"
79+
update: yes
80+
81+
- name: Clone zsh-history-substring-search plugin
82+
git:
83+
repo: https://github.com/zsh-users/zsh-history-substring-search.git
84+
dest: "/home/{{ ansible_user }}/.oh-my-zsh/custom/plugins/zsh-history-substring-search"
85+
update: yes
86+
87+
- name: Clone you-should-use plugin
88+
git:
89+
repo: https://github.com/MichaelAquilina/zsh-you-should-use.git
90+
dest: "/home/{{ ansible_user }}/.oh-my-zsh/custom/plugins/you-should-use"
91+
update: yes
92+
93+
- name: Ensure .local/bin directory exists
94+
file:
95+
path: "/home/{{ user }}/.local/bin"
96+
state: directory
97+
owner: "{{ user }}"
98+
mode: '0755'
99+
100+
- name: Download Oh My Posh binary
101+
get_url:
102+
url: https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/posh-linux-amd64
103+
dest: "/home/{{ user }}/.local/bin/oh-my-posh"
104+
mode: '0755'
105+
106+
- name: Ensure ownership of .local/bin/oh-my-posh
107+
file:
108+
path: "/home/{{ user }}/.local/bin/oh-my-posh"
109+
owner: "{{ user }}"
110+
mode: '0755'
111+
112+
- name: Change default shell to Zsh (after setting up .zshrc)
113+
user:
114+
name: "{{ user }}"
115+
shell: /bin/zsh

‎packer/ubuntu-jammy/files/.zshrc

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Path to your Oh My Zsh installation.
2+
export ZSH="$HOME/.oh-my-zsh"
3+
export PATH=$PATH:$HOME/.local/bin
4+
5+
# Set theme
6+
ZSH_THEME="robbyrussell"
7+
8+
# Plugins
9+
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)
10+
11+
source $ZSH/oh-my-zsh.sh
12+
13+
# Set up Oh My Posh
14+
eval "$(oh-my-posh init zsh --config https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/sonicboom_dark.omp.json)"
15+
16+
# Custom aliases
17+
alias dcd="docker compose down"
18+
alias dcu="docker compose up -d"
19+
20+
# Display system information
21+
neofetch

‎packer/ubuntu-jammy/ubuntu-jammy.pkr.hcl

+18-7
Original file line numberDiff line numberDiff line change
@@ -94,27 +94,38 @@ build {
9494
]
9595
}
9696

97-
9897
provisioner "file" {
9998
source = "files/pve.cfg"
10099
destination = "/tmp/pve.cfg"
101100
}
102101

103-
104102
provisioner "shell" {
105103
inline = [ "sudo cp /tmp/pve.cfg /etc/cloud/cloud.cfg.d/pve.cfg" ]
106104
}
107105

108-
# Install Commonly Used Things - add alias's - set git config
106+
# Install commonly used things - add alias's - set git config
109107
provisioner "shell" {
110108
inline = [
111-
"sudo apt-get install -y ca-certificates curl gnupg lsb-release nfs-common qemu-guest-agent net-tools",
109+
"sudo apt-get install -y ca-certificates curl gnupg lsb-release nfs-common qemu-guest-agent net-tools zsh neofetch fzf",
110+
"sudo chsh -s $(which zsh) mafyuh",
112111
"curl -fsSL https://get.docker.com | sudo sh",
113-
"echo \"alias dcu='docker compose up -d'\" >> ~/.bashrc",
114-
"echo \"alias dcd='docker compose down'\" >> ~/.bashrc",
112+
"sh -c \"$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)\" --unattended",
113+
"git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting",
114+
"git clone https://github.com/zsh-users/zsh-autosuggestions.git $${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-autosuggestions",
115+
"git clone https://github.com/zsh-users/zsh-history-substring-search.git $${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-history-substring-search",
116+
"git clone https://github.com/MichaelAquilina/zsh-you-should-use.git $${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/you-should-use",
117+
"mkdir -p /home/mafyuh/.local/bin",
118+
"curl -fsSL https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/posh-linux-amd64 -o /home/mafyuh/.local/bin/oh-my-posh",
119+
"sudo chmod +x /home/mafyuh/.local/bin/oh-my-posh",
115120
"git config --global user.name \"Mafyuh\"",
116121
"git config --global user.email \"matt@mafyuh.com\"",
117122
"sudo apt-get -y update"
118123
]
119124
}
120-
}
125+
126+
provisioner "file" {
127+
source = "files/.zshrc"
128+
destination = "~/.zshrc"
129+
}
130+
131+
}

‎terraform/ubu.tf

-4
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,4 @@ resource "proxmox_virtual_environment_vm" "Ubu" {
6464
]
6565
}
6666

67-
}
68-
69-
output "vm_ipv4_address" {
70-
value = proxmox_virtual_environment_vm.Ubu.ipv4_addresses[1][0]
7167
}

0 commit comments

Comments
 (0)
Please sign in to comment.