Open cloud shell (top right corner) and execute this commands. If you want to relaunch the installation again to create another one project, restarting the gcloud console is strongly recommended. To perform a restart, select three dots on gcloud console settigns and pick the Restart option.
cd ~
rm -rf $HOME/bootstrap/
git clone https://github.com/RT-Data-Engineer/gcp-terraform-ansible-pipe.git $HOME/bootstrap
bash $HOME/bootstrap/install.sh
cd ~
rm -rf $HOME/step2
git clone https://github.com/RT-Data-Engineer/gcp-terraform-ansible-pipe.git $HOME/step2
bash $HOME/step2/install_step2.sh
To do it manually:
- Refresh the page
- Search for "Manage resources" in gcloud search bar
- Select the project you want to delete and confirm
To remove ALL (!) projects and resources, run this script line:
gcloud projects list | cut -f2 | awk '{print $1}' | tail -n+2 | xargs -n1 gcloud projects delete --quiet
copy remote_user from $HOME/bootstrap/ansible.cfg
copy key file $HOME/bootstrap/ssh-key
ssh -i <ssh-key> <remote_user>@<vm-public_ip>
Script generates following files from created VMs and generated keys:
$HOME/bootstrap/ansible/ansible.cfg
$HOME/bootstrap/hosts
$HOME/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 $HOME/bootstrap/hosts $HOME/bootstrap/ansible/postgres-kafka-nifi.yaml --private-key $HOME/bootstrap/ssh-key