I'm building a VM on Vcenter with a playbook that runs fine and creates a 
VM when executed from the Ansible server but fails to create a VM when the 
same playbook is executed from ANsible Tower.
I do not see any syntax errors and I see the same job output on both the 
Ansible server and on Ansible Tower. I'm not sure if there is a difference 
in vmware_guest module for Tower or with versions. 

My playbook is
---
    - name: Create a VM
      vmware_guest:
        hostname: "{{ hostname_esxi }}"
        username: ansible.pfshq.com
        password: #####
        validate_certs: False

        datacenter: "{{ datacenter }}"

        resource_pool: "{{ resource_pool_esxi }}"
        cluster: "{{ cluster_esxi }}"
        guest_id: "{{ guest_id }}"
        folder: "/{{ datacenter }}/vm"
        state: poweredon
        annotation: "{{ annotation }}"
# hostname gets passed in command line as extra arguments -e 
hostname=xxxxxxx
        name: "{{ hostname }}"
        hardware:
          memory_mb: "{{ memory_esxi }}"
          num_cpus: "{{ cpu_esxi }}"
          scsi: "{{ scsi_esxi }}"
        wait_for_ip_address: yes
        disk:
        - size_gb: "{{ disk_size_1 }}"
          type: "{{ disk_type }}"
  
          datastore: "{{ datastore_cluster_1 }}"
        - size_gb: "{{ disk_size_2 }}"
          type: "{{ disk_type }}"

          datastore: "{{ datastore_cluster_2 }}"
        networks:
        - name: "{{ network_name }}"
          domain: "{{ domain }}"
          device_type: "{{ device_type }}"
          dns_servers:
          - "{{ dns1 }}"
          - "{{ dns2 }}"
      delegate_to: localhost
      register: VM

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/6b24463a-52b0-4234-a440-df612489094e%40googlegroups.com.

Reply via email to