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.