Skip to content

Commit

Permalink
update packer machine builder provisioner
Browse files Browse the repository at this point in the history
  • Loading branch information
geloman committed Nov 12, 2024
1 parent 7c85735 commit 8180d5f
Showing 1 changed file with 4 additions and 21 deletions.
25 changes: 4 additions & 21 deletions packer/main.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,10 @@ source "digitalocean" "eastblue" {

build {
sources = ["source.digitalocean.eastblue"]
provisioner "shell" {
inline = [
"apt update -y && apt upgrade -y",
"apt install -y zsh eza fzf ripgrep fd-find bat git-delta gcc tar unzip curl wget neofetch ansible",
"useradd --create-home --groups sudo --shell /usr/bin/zsh geloman && passwd --delete geloman",
"mkdir -p /home/geloman/.ssh /home/geloman/.config /home/geloman/.personal /home/geloman/.development /home/geloman/.language-servers/bin /home/geloman/.language-servers/lua-language-server",
"git clone --depth 1 https://github.com/geloman-likes-rust/dotfiles /home/geloman/.dotfiles",
"git clone --depth 1 https://github.com/ohmyzsh/ohmyzsh.git /home/geloman/.oh-my-zsh",
"git clone --depth 1 https://github.com/tmux-plugins/tpm /home/geloman/.tmux/plugins/tpm",
"[ ! -f /usr/bin/bat ] && ln -s /usr/bin/batcat /usr/bin/bat",
"curl -L https://github.com/neovim/neovim/releases/download/stable/nvim-linux64.tar.gz | tar xz -C /usr/local/",
"curl -L https://github.com/LuaLS/lua-language-server/releases/download/3.10.6/lua-language-server-3.10.6-linux-x64.tar.gz | tar xz -C /home/geloman/.language-servers/lua-language-server",
"ln -s /usr/local/nvim-linux64/bin/nvim /usr/local/bin/nvim",
"ln -s /home/geloman/.language-servers/lua-language-server/bin/lua-language-server /home/geloman/.language-servers/bin/lua-language-server",
"ln -s /home/geloman/.dotfiles/ssh/config /home/geloman/.ssh/config",
"ln -s /home/geloman/.dotfiles/.gitconfig /home/geloman/.gitconfig",
"ln -s /home/geloman/.dotfiles/zsh/.zshrc /home/geloman/.zshrc",
"ln -s /home/geloman/.dotfiles/nvim /home/geloman/.config/",
"ln -s /home/geloman/.dotfiles/tmux/.tmux.conf /home/geloman/.tmux.conf",
"chown -R geloman:geloman /home/geloman",
"su geloman -c \"nvim --headless '+Lazy! restore' +qa\""
provisioner "ansible" {
playbook_file = "../ansible/playbook.yaml"
extra_arguments = [
"--roles-path", "../ansible/roles"
]
}
}

0 comments on commit 8180d5f

Please sign in to comment.