Hi Kaushal,

You would want to review the Terraform documentation for 
google_compute_instance - likely metadata_startup_script is your answer:

https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_instance#metadata_startup_script

Any more this goes beyond the scope of this mailing list, so I would recommend 
reaching to appropriate Hashicorp or GCP resources for more help.

- Rilindo

> On Jul 23, 2022, at 11:04 AM, [email protected] <[email protected]> 
> wrote:
> 
> Hi Rilindo,
> 
> I am using Google Cloud Platform (GCP) - Google Cloud as my primary cloud 
> service provider. Please guide. Thanks in advance.
> Best Regards,
> 
> Kaushal
> 
> On Saturday, 23 July 2022 at 21:30:59 UTC+5:30 [email protected] 
> <http://gmail.com/> wrote:
> Thanks Rilindo for the quick response and much appreciated. I will appreciate 
> if you can provide me with a basic working example to understand it and I 
> will implement it once i play around with it. Thanks in Advance.
> 
> Best Regards,
> 
> Kaushal
> 
> On Saturday, 23 July 2022 at 21:13:43 UTC+5:30 [email protected] 
> <applewebdata://566D4FAF-757F-46C2-BFA4-9AEAB3138343> wrote:
> Hi Kausal,
> 
> Depending on the provider, you can use cloud-init to:
> 
> - Invoke an installation of Ansible
> - Download the Ansible code
> - Run the code from a local installed instance of Ansible
> 
> - Rilindo
> 
> 
>> On Jul 23, 2022, at 10:22 AM, [email protected] <http://gmail.com/> 
>> <[email protected] <>> wrote:
>> 
> 
>> Hi,
>> 
>> Is there a way to execute Ansible playbooks in Terraform main.tf 
>> <http://main.tf/> file? For example I want to deploy nginx webserver inside 
>> GCP GCE VM Instance using Ansible playbook once GCP GCE VM Instance is 
>> provisioned using Terraform.
>> 
>> Please guide. Thanks in advance.
>> 
>> Best Regards,
>> 
>> Kaushal
>> 
>> 
> 
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Ansible Project" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/d3e76019-0911-4577-a9e4-85575eb885a5n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/ansible-project/d3e76019-0911-4577-a9e4-85575eb885a5n%40googlegroups.com?utm_medium=email&utm_source=footer>.
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] 
> <mailto:[email protected]>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-project/2243341d-81a5-4671-98b9-8e3a10ec1298n%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/ansible-project/2243341d-81a5-4671-98b9-8e3a10ec1298n%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/071E98BF-0FE3-4AFC-A59B-787DF78C4DD8%40gmail.com.

Reply via email to