Debian Codegraph @

ansible_collections/google/cloud/roles/gcloud/tasks/archive/main.yml

raw
1 ---
2 # tasks to install gcloud via archive
3 - name: Gcloud | Archive | Look for existing Google Cloud SDK installation
4 ansible.builtin.stat:
5 path: "{{ gcloud_archive_path }}/google-cloud-sdk/VERSION"
6 register: gcloud_status
7
8 - name: Gcloud | Archive | Get gcloud_status
9 ansible.builtin.debug:
10 var: gcloud_status
11
12 - name: Gcloud | Archive | Set installed version if installation exists
13 when: gcloud_status.stat.exists
14 block:
15 - name: Gcloud | Archive | Importing contents of ./google-cloud-sdk/VERSION in {{ gcloud_archive_path }}
16 ansible.builtin.slurp:
17 src: "{{ gcloud_archive_path }}/google-cloud-sdk/VERSION"
18 register: gcloud_installed_version_data
19 - name: Gcloud | Archive | Setting the gcloud_installed_version variable/fact
20 ansible.builtin.set_fact:
21 gcloud_installed_version: "{{ (gcloud_installed_version_data.content | b64decode | trim) }}"
22 - name: Gcloud | Archive | get the gcloud_installed_version
23 ansible.builtin.debug:
24 msg: "google-cloud-sdk: {{ gcloud_installed_version }} is installed"
25 - name: Gcloud | Archive | Version already installed
26 when: gcloud_version == gcloud_installed_version
27 ansible.builtin.debug:
28 msg: >-
29 Skipping installation of google-cloud-sdk version {{ gcloud_version }} when
30 {{ gcloud_installed_version }} is already installed.
31
32 - name: Gcloud | Archive | Start installation
33 when: gcloud_installed_version is undefined or gcloud_version is version(gcloud_installed_version, '>')
34 ansible.builtin.include_tasks: archive_install.yml
35
36 - name: Gcloud | Debian | Install the google-cloud-sdk additional components # noqa no-changed-when
37 ansible.builtin.command: gcloud components install {{ item }}
38 register: gcloud_install_comp_status
39 changed_when: "'All components are up to date.' not in gcloud_install_comp_status.stderr_lines"
40 loop: "{{ gcloud_additional_components }}"