DEV Community

Cover image for GCP Automation using Ansible
Abhishek Vaidya
Abhishek Vaidya

Posted on

GCP Automation using Ansible

Introduction

Ansible provides different Google Cloud Platform modules for automating google cloud platform. In this blog we will be creating a Google Compute Engine Instance and deploy Apache Server on it using Ansible.

Prerequisites

GitHub

You can find the resources in abhivaidya07/ansible_gcloud

Getting Started !!

  • Install python version > 3.0
$ sudo yum install python3-pip
Enter fullscreen mode Exit fullscreen mode
  • The GCP modules require both the requests and the google-auth libraries to be installed.
$ sudo pip3 install requests google-auth
Enter fullscreen mode Exit fullscreen mode
  • Install Ansible
$ sudo pip3 install ansible 
Enter fullscreen mode Exit fullscreen mode
$ ansible-playbook gce.yml
Enter fullscreen mode Exit fullscreen mode
  • Your Google Compute Engine Instance is now created, with Apache Server installed in it.
  • Browse to instance public ip address, and you will see HELLO WORLD !! is getting displayed.

Top comments (0)