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...
This example shows a simple way of searching for a pattern match in a string and return the decision. For ex: My_exceptions="abc 123" My_string="Hey I am searching for 123" for word in $My_exceptions do [ `echo $My_string |grep $word` ] && match_found="y" || match_found="n" [ $match_found = y ] && break; done This works for environment like Solaris 5.10/5.11, Linux, ksh, bash