Download and Install Google Cloud Sdk.
Google Cloud SDK is a set of tools that you can use to manage resources and applications hosted on Google Cloud Platform.
These tools include:
- gcloud
- gsutil
- core
- bq
- kubectl
- app-engine-python
- app-engine-java
- beta
- alpha
- pubsub-emulator
- gcd-emulator
If you just want a Google Cloud SDK installation with the default options you can run :
By default, Install Latest Version of SDK with following tools:
- gcloud
- gsutil
- core
- bq
include gcloudsdkIf you need to customize version and install_dir configuration options, you need to do the following:
class { 'gcloudsdk':
install_dir => '/opt',
version => '108.0.0',
}You can also choose to turn on bash or zsh autocompletion in profile scripts:
class { 'gcloudsdk':
bash_completion => true,
zsh_completion => true,
}If you need to add any additional gcloud components, you can do this with the gcloudsdk::component defined type using the component's ID:
gcloudsdk::component { 'bigtable':
ensure => 'installed',
}
gcloudsdk::component { 'minikube':
ensure => 'installed',
}Components can also be added directly throug a call to the gcloudsk class:
class { 'gcloudsdk':
extra_components => {
bigtable => {
ensure => 'installed',
},
},
install_dir => '/opt',
version => '108.0.0',
}This can also all be done from Hiera as well:
gcloudsdk:
extra_components:
bigtable:
ensure: 'installed'
install_dir: '/opt'
version: '108.0.0'Restart the shell or terminal after gsutil package is installed. This will set the path of gsutil in the default environment path variable.
Alternatively, you can source install_gsutil.sh shell script by executing the following command or export the path to configure gsutil to work without restarting the shell.
source /etc/profile.d/gcloud_path.shexport PATH=$PATH:${install_dir}/google-cloud-sdk/binThe original module is based on work by Ranjith Kumar.
PRs with improvements are always welcome.