ansible / galaxy

Legacy Galaxy still available as read-only on https://old-galaxy.ansible.com - looking for the new galaxy -> https://github.com/ansible/galaxy_ng
Apache License 2.0
855 stars 331 forks source link

Add support for Google Virtual Network Interface (gVNIC) #3388

Open rahulkausale opened 3 months ago

rahulkausale commented 3 months ago

Feature Request

Use Case

We need to create instances with gVNIC interfaces as mentioned here https://cloud.google.com/compute/docs/instances/create-vm-with-gvnic.

Proposed Solution

Possible playbook

  google.cloud.gcp_compute_instance:
    name: "vm1"
    machine_type: "n1-standard-4"
    can_ip_forward: true
    disks:
      - auto_delete: 'true'
        boot: 'true'
        source: "{{ disk }}"
    network_interfaces:
      - network: "{{ mgmt_network.resources[0] }}"
        subnetwork: "{{ mgmt_subnet.resources[0] }}"
        nic_type: 'gvnic'
    zone: "{{ gcp_zone }}"
    project: "{{ gcp_project }}"
    auth_kind: "{{ gcp_cred_kind }}"
    service_account_file: "{{ gcp_cred_file }}"
    state: present

As part of request https://github.com/hashicorp/terraform-provider-google/issues/7699, module gcp_compute_image was modified to support guest_os_features of type GVNIC. But gcp_compute_instance module still doesnt have any option to request vNICs of type gVNIC.