---
- name: AZURE | CREATE VM | vnet interface
  azure.azcollection.azure_rm_networkinterface:
    resource_group: "{{ az_rg_name }}-{{ az_rg_prefix }}-rg"
    name: "{{ az_vm_name }}_nic"
    public_ip_name: "{{ az_vm_name }}_ip"
    virtual_network: "{{ az_rg_name }}-{{ az_rg_prefix }}-vnet"
    subnet: "{{ az_rg_name }}-{{ az_rg_prefix }}-subnet }}"
    security_group: "{{ az_rg_name }}-{{ az_rg_prefix }}-sec-group"

- name: AZURE | CREATE VM | vm
  azure.azcollection.azure_rm_virtualmachine:
    resource_group: "{{ az_rg_name }}-{{ az_rg_prefix }}-rg"
    name: "{{ az_vm_name }}"
    os_type: "{{ az_vm_os_type }}"
    vm_size: "{{ az_vm_size }}"
    admin_username: "{{ az_vm_username }}"
    admin_password: "{{ az_vm_password }}"
    network_interfaces: "{{ az_vm_name }}_nic"
    image: "{{ az_vm_image }}"
    tags:
      blueprint: "{{ az_blueprint }}"
      purpose: "{{ az_purpose_tag }}"
      env: "{{ az_env_tag }}"
      ansible_group: "{{ az_ansiblegroup_tag }}"
      owner: "{{ az_vm_owner }}"
      info: "This instance was built by Red Hat Product Demos"
      Name: "{{ az_vm_name }}"
