0
votes

I have been reading the "Getting started with Puppet on GCP" section at https://cloud.google.com/blog/products/gcp/introducing-puppet-support-for-google-cloud-platform24. I used the console to create a service account with Service Account Admin role and set up an instance to run as that service account. Then I enabled the Gmail API.

In "1. Install your modules", I don't understand the discussion about Google modules if I want to use Puppet on GCP. I think I would need Puppet on GCP (the other way around).

Indeed, when I tried the puppet apply <<EOF command in that section, I get -bash: puppet: command not found. How do I install puppet?

2

2 Answers

0
votes

Cloud Shell is basically a e2-small GCE VM running a Debian-based Linux OS.

It does not come with Puppet pre-installed, but you can install it like on any other Debian-based distribution. Bear in mind though this instance is ephemeral:

The instance persists while your Cloud Shell session is active; after an hour of inactivity, your session terminates and its VM, discarded.

If you install Puppet normally in Cloud Shell, it may not be there next time you connect.

However it is possible to customize your environment automatically on VM boot to ensure that your Cloud Shell instance includes your preferred tools, like Puppet:

Cloud Shell automatically runs the script, $HOME/.customize_environment, when your instance boots up. Unlike .profile or .bashrc, this script runs once when Cloud Shell boots (rather than once for each shell login).

This script runs as root and you can install any packages that you want to exist in each Cloud Shell session using Debian package management commands.

As for how to install and set up Puppet in GCP, check out these resources for starters: