google.cloud/roles/gcloud/tasks/archive/archive_install.yml
Yusuke Tsutsumi f692dd4c76 fix role tests
Ansible role tests were failing due to ansible-lint reporting
multiple errors.

Fixing those errors resolves the failing tests.

Switching gcsfuse to use gcloud's bootstrap to follow the current
docker install instructions.

Removing centos as it's a discontinued distribution.

Adding a check to ensure integration tests are skipped unless they
are run by a branch (a public fork does not pass required
integration test credentials).
2022-11-29 23:12:26 -08:00

50 lines
1.8 KiB
YAML

---
- name: gcloud | Archive | Ensure temp path exists
ansible.builtin.file: path={{ gcloud_archive_path }} state=directory mode=0755
- name: gcloud | Archive | Extract Cloud SDK archive
ansible.builtin.unarchive:
src: "{{ gcloud_archive_url }}"
dest: "{{ gcloud_archive_path }}"
remote_src: yes
creates: "{{ gcloud_library_path }}"
- name: gcloud | Archive | Link binaries to /usr/bin (like package install)
ansible.builtin.file:
src: "{{ gcloud_library_path }}/bin/{{ item }}"
dest: "/usr/bin/{{ item }}"
state: link
loop:
- bq
- docker-credential-gcloud
- gcloud
- git-credential-gcloud.sh
- gsutil
when: not gcloud_install_script
- name: gcloud | Archive | Add command completion
ansible.builtin.include_tasks: command_completion.yml
when: gcloud_command_completion
- name: gcloud | Archive | Install into Path
ansible.builtin.command: >-
{{ gcloud_archive_path }}/install.sh --quiet
--usage-reporting {{ gcloud_usage_reporting | lower }}
{% if gcloud_profile_path %}
--rc-path {{ gcloud_profile_path }}
{% endif %}
--command-completion {{ gcloud_command_completion | lower }}
--path-update {{ gcloud_update_path | lower }}
{% if gcloud_override_components | length > 0 %}--override-components
{% for component in gcloud_override_components %}{{ component }}
{% if loop.index < gcloud_override_components | length %}
{% endif %}
{% endfor %}
{% endif %}
{% if gcloud_additional_components | length > 0 %}--additional-components
{% for component in gcloud_additional_components %}{{ component }}
{% if loop.index < gcloud_additional_components | length %}
{% endif %}
{% endfor %}
{% endif %}
when: gcloud_install_script