Hi @Wawrzek,

Yes, they need be in a RG. But in my case the VM will be in one RG and the 
vNet already existing in another RG.

But I achieve this using this :

- name: Create Azure VM
hosts: localhost
connection: local
vars:
resource_group_vnet: rgname
vnet_name: vnetname
subnet_name: subnetname

and after the image information, I put this:
virtual_network_resource_group: "{{ resource_group_vnet }}"
virtual_network_name: "{{ vnet_name }}"
subnet_name: "{{ subnet_name }}"

After this, the vm was created in your resource and consume the vNet in 
another RG.

Tks.


Em terça-feira, 3 de setembro de 2019 11:57:10 UTC-3, Lucas Chies escreveu:
>
> Hello guys,
> I've a doubt ... I've a ansible script that create an windows VM on Azure, 
> but I already have the vnet created in and hosted in another Resource Group.
> I don't know how can I create my script to put this VM in the created vNet.
>
> I tried to put this:
>
> virtual_network_name:
> resource_group: rg-fgl-network
> name: vnet-fgl
> location: brazilsouth
>
> But is not working.
>
> Someone already tried this?
>

-- 
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/10638ee9-79f5-49e7-8e3c-7d8ef1050864%40googlegroups.com.

Reply via email to