Skip to main content

Posts

Showing posts from June, 2022

Ansible for GCP : How to setup and access remote inventory Hosts

Setting Ansible on Google Cloud Platform for the first time requires some steps to follow. There may be several ways but i followed the below steps: Assuming that you have couple of Virtual compute nodes created on your google cloud platform, i will be following the below names for sample references My virtual instances on GCP are: my-vmgroup-control-1 : This i am using as a control node.  my-vmgroup-app-instancegroup-1-lmlv : This is my traget inventory node 1  my-vmgroup-app-instancegroup-1-nxmr: This is my traget inventory node 2 Lets setup the ansible to work with the inventory nodes and perform our tasks. 1) Setup the ssh key  2) Add public key to the meta data on GCP cloud at project level. 3) setup the ansible environment Setup the ssh key Open the Google cloud platform and go to Virtual instances page. Select the control node that you have setup and click on SSH button on the right. You can also use gloud command to make a connection and open the terminal. After y...