Skip to content

Commit

Permalink
fix(ubuntu): Do not try to install brew as root
Browse files Browse the repository at this point in the history
  • Loading branch information
cdalvaro committed Oct 3, 2024
1 parent 386b5f3 commit 4f00703
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions os-images/AWS/ubuntu/scripts/install_brew.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/bin/bash

# Exit on failures
set -e
# Echo what runs
set -x

if [[ "$(uname -m)" != 'x86_64' ]]; then
echo "brew won't be installed for $(uname -m) architecture"
exit 0
Expand Down
2 changes: 1 addition & 1 deletion os-images/AWS/ubuntu/ubuntu.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ build {

provisioner "shell" {
inline_shebang = "/bin/bash -ex"
execute_command = "sudo -E -H bash -c '{{ .Vars }} {{ .Path }}'"
execute_command = "sudo -E -H -u ${var.ssh_username} bash -c '{{ .Vars }} {{ .Path }}'"
script = "${path.root}/scripts/install_brew.sh"
}

Expand Down

0 comments on commit 4f00703

Please sign in to comment.