diff --git a/one_installer.yml b/one_installer.yml index 95c6727..d294d43 100644 --- a/one_installer.yml +++ b/one_installer.yml @@ -78,12 +78,17 @@ debug: msg: "pyenv installation status: {{ pyenv_status.stdout }}" - name: Install Homebrew + become: no shell: | - /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.bashrc - eval "$(/opt/homebrew/bin/brew shellenv)" - source ~/.bashrc - become: yes + if ! command -v brew &> /dev/null; then + echo "Homebrew not found. Installing Homebrew." + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> ~/.bash_profile + eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" + else + echo "Homebrew is already installed." + fi + ignore_errors : yes - name: Install rupa/z, and mcfly become: yes @@ -217,7 +222,7 @@ - golang.Go - ryanluker.vscode-coverage-gutters ignore_errors : yes - + - name: Install GVM (Go Version Manager) become: yes become_user: "{{ current_user.stdout }}"