-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathmain.yml
More file actions
23 lines (20 loc) · 1.05 KB
/
main.yml
File metadata and controls
23 lines (20 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
---
# 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-darwin-arm.tar.gz
remote_src: true
dest: "{{ ansible_facts['env']['HOME'] }}/"
creates: "{{ ansible_facts['env']['HOME'] }}/.google-cloud-sdk"
- name: Rename
command: mv {{ ansible_facts['env']['HOME'] }}/google-cloud-sdk {{ ansible_facts['env']['HOME'] }}/.google-cloud-sdk
args:
creates: "{{ ansible_facts['env']['HOME'] }}/.google-cloud-sdk"
- name: Install gcloud components
command: "{{ ansible_facts['env']['HOME'] }}/.google-cloud-sdk/bin/gcloud components install gke-gcloud-auth-plugin"
register: gcp_command_result
changed_when: "'All components are up to date' not in gcp_command_result.stderr"
- name: Update gcloud components
shell: yes 'y' | {{ ansible_facts['env']['HOME'] }}/.google-cloud-sdk/bin/gcloud components update
register: gcp_command_result
changed_when: "'All components are up to date' not in gcp_command_result.stderr"