---
# file: roles/google_cloud_sdk/tasks/main.yml

- name: Install Google Cloud SDK
  homebrew_cask:
    name: google-cloud-sdk
    state: present

- name: Ensure Google Cloud SDK is sourced from {{ ansible_user_dir }}/.bashrc
  blockinfile:
    dest: "{{ ansible_user_dir }}/.bashrc"
    block: |
      [ -e /usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.bash.inc] && . /usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.bash.inc
      [ -e /usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/completion.bash.inc] && . /usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/completion.bash.inc
    marker: '# {mark} ANSIBLE MANAGED BLOCK - google-cloud-sdk'
    create: yes

---
# file: roles/google_cloud_sdk/tasks/main.yml

- name: Install Google Cloud SDK
  homebrew_cask:
    name: google-cloud-sdk
    state: present

- name: Ensure Google Cloud SDK is sourced from {{ ansible_user_dir }}/.bashrc
  blockinfile:
    dest: "{{ ansible_user_dir }}/.bashrc"
    block: |
      [ -e /usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.bash.inc ] && . /usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.bash.inc
      [ -e /usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/completion.bash.inc ] && . /usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/completion.bash.inc
    marker: '# {mark} ANSIBLE MANAGED BLOCK - google-cloud-sdk'
    create: yes

Fix Google SDK bash command
Fix Google SDK bash command
