Open cloud shell (top right corner) and execute this commands
sudo -s
cd ~
git clone https://github.com/shodan0x00/gcp-terraform-ansible-pipe.git /opt/bootstrap
bash /opt/bootstrap/install.sh
copy remote_user from /opt/bootstrap/ansible.cfg
copy key file /opt/bootstrap/ssh-key
ssh -i <ssh-key> <remote_user>@<vm-public_ip>
Script generates following files from created VMs and generated keys:
/opt/bootstrap/ansible/ansible.cfg
/opt/bootstrap/hosts
/opt/bootstrap/ssh-key
Where 'ansible.cfg' file has ssh username, 'hosts' has public IP associations of created VMs and 'ssh-key' is a private key used to ssh into those VMs.
Copy them into your local machine, go into the folder where ansible.cfg reside and launch with this command:
ansible-playbook -i /opt/bootstrap/hosts /opt/bootstrap/ansible/postgres-kafka-nifi.yaml --private-key /opt/bootstrap/ssh-key