Skip to content

hammadrauf/ansible-role-gcloud

 
 

Repository files navigation

Google Cloud CLI

Ansible role to install Google Cloud CLI linux. Forked from labasubagia.gcloud but heavily re-scripted.

This is installs using standard install method on GCloud website. Installs system wide (for all users).

Requirements

  • Ansible Core >= 2.16
  • Tested Linux Distribution
    • Debian 12
    • Ubuntu 24.04
    • Fedora 40

Note: Other (and/or newer) distributions likely to work but not been tested

Role Variables

The following variables will change the behavior of this role (default values are shown below):

## google recommends to install gcloud sdk in user directory, not as root
gcloud_additional_components: []

Test Locally using Lint and Ansible Molecule

rm -rf ~/.ansible/roles/
molecule test --all
molecule test --all --driver-name=podman
molecule test --all -d docker

yamllint -v . && ansible-lint -v . && molecule test --all

tox
tox -p auto   # Runs tox environments in parallel, depending on local cpu core count and depends clause.
tox -e lint   # Runs only lint tox environment
tox -e fedora40  # Runs only fedora40 tox environment, if it depends on another tox environment, that should also execute.

Example Playbook

- hosts: servers
  roles:
    - role: hammadrauf.gcloud
      vars:
        gcloud_additional_components:
          - gke-gcloud-auth-plugin
          - kubectl

License

MIT

Author Information

Laba Subagia

This Forked maintained by Hammad Rauf

About

Ansible role to install gcloud CLi

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors