title: Is it possible to assign ip address via ansible and vmware module?
body: <p>I'm trying to use Ansible and Vmware module to assign an IP address to a newly created virtual machine with no network configured.
  I tried vmware_guest/networks module but it requires a vlan ID and it always return vlan xxx does not exist.
  Also I don't understand why it needs a vlan and the vm guest name is not enough.</p>
  <p>This is my playbook:</p>
  <pre><code>---
  
  - hosts: localhost
    tasks:
    - name: Set ip for VM
      vmware_guest:
        hostname: &quot;{{ vcenter_hostname }}&quot;
        username: &quot;{{ vcenter_username }}&quot;
        password: &quot;{{ vcenter_password }}&quot;
        validate_certs: No
        name: ***
        networks:
        - vlan: '***'
          type: static
          ip: 10.***.***.***
          netmask: 255.255.255.0
          gateway: 10.***.***.1
  </code></pre>
  <p>I tried to use vmware_shell too but it needs vmtools installed, I found a way to install them with vmware_tools_upgrade module but then I don't have the permission to run vmware_shell (I don't administer vsphere)</p>
  <p>Maybe I should try something directly in python? I must add I have Vmware remote console access and Linux root privileges.</p>