DevOps Articles

Curated articles, resources, tips and trends from the DevOps World.

How-to create dynamic inventory in GCP using Ansible

4 years ago medium.com
How-to create dynamic inventory in GCP using Ansible

Summary: This is a summary of an article originally published by the source. Read the full original article here →

This article details the steps needed to setup the “gce.py” and also the configuration changes needed to create a GCP instance using Ansible . In order to use “gce.py” we need to create a credentials in GCP console as a P12 format and make changes to the “gce.ini” and “secrets.py” files to enable this communication .

We will create it in both of the formats , the JSON format is used by Ansible modules in creating GCP instance and all GCP related operations .

Create json — this is the file that is created in the GCP console , by choosing the API/Credentials options and choosing the JSON option to Add keys to the service account .2.

Transfer the file to the Unix instance where ansible is installed and use the following command to convert it to a “ .pem” format to be applied in the “secrets.py” file

Made with pure grit © 2024 Jetpack Labs Inc. All rights reserved. www.jetpacklabs.com