# Is it possible to create a project and VPC in Google cloud through Ansible?

**URL:** <https://forum.ansible.com/t/is-it-possible-to-create-a-project-and-vpc-in-google-cloud-through-ansible/28897>\
**Category:** Ansible Project\
**Created:** [October 30, 2018, 11:17am UTC](https://forum.ansible.com/t/is-it-possible-to-create-a-project-and-vpc-in-google-cloud-through-ansible/28897 "2018-10-30T11:17:09Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![somali.batra](https://avatars.discourse-cdn.com/v4/letter/s/76d3ee/32.png) [@somali.batra](https://forum.ansible.com/u/somali.batra)\
**Post date:** [October 30, 2018, 11:17am UTC](https://forum.ansible.com/t/is-it-possible-to-create-a-project-and-vpc-in-google-cloud-through-ansible/28897/1 "2018-10-30T11:17:09Z")

</div>

I am new to Ansible. I have come across various articles showing how to provision resources like GCE in the Google cloud. But I want to automate the entire end to end flow and thus would start with automating the creation of Project and VPC in Google Cloud.

Can someone help me identify module(s) using which this can be achieved?

Thanks,  
Somali

---

<div class="post-metadata">

**Author:** ![viper233](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/viper233/32/2060_2.png) [@viper233](https://forum.ansible.com/u/viper233)\
**Post date:** [October 30, 2018, 4:42pm UTC](https://forum.ansible.com/t/is-it-possible-to-create-a-project-and-vpc-in-google-cloud-through-ansible/28897/2 "2018-10-30T16:42:55Z")

</div>

Looking at another Infrastructure as code example

[https://cloud.google.com/community/tutorials/managing-gcp-projects-with-terraform](https://cloud.google.com/community/tutorials/managing-gcp-projects-with-terraform)

There seems to be some manual steps via the gcloud sdk to initially get a service role to then provision resources within a project.

This is not a perfect response to your question, just a quick reply to perhaps put you on the right path.

---

<div class="post-metadata">

**Author:** ![somali.batra](https://avatars.discourse-cdn.com/v4/letter/s/76d3ee/32.png) [@somali.batra](https://forum.ansible.com/u/somali.batra)\
**Post date:** [October 30, 2018, 5:38pm UTC](https://forum.ansible.com/t/is-it-possible-to-create-a-project-and-vpc-in-google-cloud-through-ansible/28897/3 "2018-10-30T17:38:32Z")

</div>

Thank Steve.

I understand a service account is required to provision resources on Google cloud. So now the question is, can that be automated as well?

Meaning is it possible to do the following through Ansible on Google Cloud

1. create a project
2. create a service account
3. create a VPC
4. create a GCE VM instance (this definitely is possible using the gce module, can I also create a project, service account and vpc using any of the ansible modules?)

---

<div class="post-metadata">

**Author:** ![Jonathan\_Lozada\_De\_L](https://avatars.discourse-cdn.com/v4/letter/j/eb8c5e/32.png) [@Jonathan\_Lozada\_De\_L](https://forum.ansible.com/u/Jonathan_Lozada_De_L)\
**Post date:** [October 30, 2018, 5:40pm UTC](https://forum.ansible.com/t/is-it-possible-to-create-a-project-and-vpc-in-google-cloud-through-ansible/28897/4 "2018-10-30T17:40:28Z")

</div>

not at the moment as far as I know.

---

<div class="post-metadata">

**Author:** ![somali.batra](https://avatars.discourse-cdn.com/v4/letter/s/76d3ee/32.png) [@somali.batra](https://forum.ansible.com/u/somali.batra)\
**Post date:** [October 30, 2018, 5:43pm UTC](https://forum.ansible.com/t/is-it-possible-to-create-a-project-and-vpc-in-google-cloud-through-ansible/28897/5 "2018-10-30T17:43:07Z")

</div>

You mean none of this can be achieved through Ansible - project, vpc, service account?

---

<div class="post-metadata">

**Author:** ![Jonathan\_Lozada\_De\_L](https://avatars.discourse-cdn.com/v4/letter/j/eb8c5e/32.png) [@Jonathan\_Lozada\_De\_L](https://forum.ansible.com/u/Jonathan_Lozada_De_L)\
**Post date:** [October 30, 2018, 5:45pm UTC](https://forum.ansible.com/t/is-it-possible-to-create-a-project-and-vpc-in-google-cloud-through-ansible/28897/6 "2018-10-30T17:45:47Z")

</div>

Sorry, the project and service account [https://docs.ansible.com/ansible/latest/modules/list\_of\_cloud\_modules.html#google](https://docs.ansible.com/ansible/latest/modules/list_of_cloud_modules.html#google)

---

<div class="post-metadata">

**Author:** ![somali.batra](https://avatars.discourse-cdn.com/v4/letter/s/76d3ee/32.png) [@somali.batra](https://forum.ansible.com/u/somali.batra)\
**Post date:** [October 31, 2018, 2:36am UTC](https://forum.ansible.com/t/is-it-possible-to-create-a-project-and-vpc-in-google-cloud-through-ansible/28897/7 "2018-10-31T02:36:37Z")

</div>

Hi Jonathan,

I could not identify a module to create VPC as well in this link [https://docs.ansible.com/ansible/latest/modules/list\_of\_cloud\_modules.html#google](https://docs.ansible.com/ansible/latest/modules/list_of_cloud_modules.html#google). Am I missing something?

---

<div class="post-metadata">

**Author:** ![somali.batra](https://avatars.discourse-cdn.com/v4/letter/s/76d3ee/32.png) [@somali.batra](https://forum.ansible.com/u/somali.batra)\
**Post date:** [October 31, 2018, 2:50am UTC](https://forum.ansible.com/t/is-it-possible-to-create-a-project-and-vpc-in-google-cloud-through-ansible/28897/8 "2018-10-31T02:50:51Z")

</div>

Ok, I think I found it. Thank you!
