-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathmain.yml
22 lines (19 loc) · 973 Bytes
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# https://cloud.google.com/sdk/docs/quickstart-macos
- name: Download Google Cloud SDK
unarchive:
src: https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-436.0.0-darwin-arm.tar.gz
remote_src: yes
dest: "{{ ansible_env.HOME }}/"
creates: "{{ ansible_env.HOME }}/.google-cloud-sdk"
- name: Rename
shell: mv {{ ansible_env.HOME }}/google-cloud-sdk {{ ansible_env.HOME }}/.google-cloud-sdk
args:
creates: "{{ ansible_env.HOME }}/.google-cloud-sdk"
- name: Install gcloud components
command: "{{ ansible_env.HOME }}/.google-cloud-sdk/bin/gcloud components install gke-gcloud-auth-plugin"
register: command_result
changed_when: "'All components are up to date' not in command_result.stderr"
- name: Update gcloud components
shell: yes 'y' | {{ ansible_env.HOME }}/.google-cloud-sdk/bin/gcloud components update
register: command_result
changed_when: "'All components are up to date' not in command_result.stderr"