Ansible 2.5 virtual cpu and socket not work to gather , as well customvalues

6 views
Skip to first unread message

talha jilal

unread,
May 3, 2018, 2:22:01 PM5/3/18
to Ansible Project


1- Same code with customvalue works for me in ansible 2.4  but does not work on ansible 2.5.
2- Ansible 2.5 ony take one option at a time,  num_cpus or cpu_cores_per_sockets


Any idea folks I am report this error second time in group., 

My playbook looks something like this .



########################### Tasks ################

---
#two_of_two.yml
- name: Provisioning two_of_two
  vmware_guest:
    hostname: "{{ vcenter_hostname }}"
    username: "{{ vcenter_user }}"
    password: "{{ vcenter_pass }}"
    datacenter: "{{ data_center_name }}"
    validate_certs: no
    #folder: "{{ data_center_name }}/{{ folder_path }}"   # Uncomment when VMs created
    folder: "{{ folder_path }}"
    esxi_hostname: "{{ esxi_hostname }}"
    name: "{{ inventory_hostname }}"
    resource_pool: "{{ resource_pool_name_local }}"
    state: poweredon
    template: "{{ vm_template_name }}"
################## OS Disk Properties ###############
    disk:
    - size_gb: "{{ disk1_size_gb }}"  #I added this value we must know the template disk size this is requirement
      type: "{{ disk1_type }}"
      datastore: "{{ disk1_datastore }}"
################## disk-02 ###############
    - size_gb: "{{ disk2_size_gb }}"
      type: "{{ disk2_type }}"
      datastore: "{{ disk2_datastore }}"
# Network interfaceS ##
# Interface -01  ##
    networks:
    - name: "{{ nic1_port_group }}"
      nic: 1
      device_type: vmxnet3
      type: static
      ip:  "{{ nic1_ip }}"
      netmask: "{{ nic1_mask }}"
      gateway: "{{ nic1_gw }}"
      hostname: "{{ inventory_hostname }}"
# Interface -02
    - name: "{{ nic2_port_group }}"
      nic: 2
      device_type: vmxnet3
      type: dhcp
# Memory and CPU Information ##
    hardware:
      num_cpus: 4
      memory_mb: "{{ ram_size_gb }}"
      hotadd_cpu: yes
      num_cpu_cores_per_socket: 4
      scsi: paravirtual
    customization:
      autologon: yes
      dns_servers:
      - "{{ dns_1 }}"
# Custom Values annotations.
    customvalues:
     - annotation:
       key: APPLICATION
       value: application
    wait_for_ip_address: no
  delegate_to: localhost
  register: deploy
- debug: var=deploy







#######################################
Debug out put


    "deploy": {
        "changed": true,
        "failed": false,
        "instance": {
            "annotation": "",
            "current_snapshot": null,
            "customvalues": {},
            "guest_consolidation_needed": false,
            "guest_question": null,
            "guest_tools_status": "guestToolsRunning",
            "guest_tools_version": "2147483647",
            "hw_cores_per_socket": 4,
            "hw_datastores": [
                "*****n_3f02"
            ],
            "hw_esxi_host": "*********************************",
            "hw_eth0": {
                "addresstype": "assigned",
                "ipaddresses": null,
                "label": "Network adapter 1",
                "macaddress": "00:50:56:a3:09:b0",
                "macaddress_dash": "00-50-56-a3-09-b0",
                "summary": "DVSwitch: 9a 96 23 50 bc 8c 77 da-c3 9d 35 76 e2 bc c1 35"
            },
            "hw_eth1": {
                "addresstype": "assigned",
                "ipaddresses": null,
                "label": "Network adapter 2",
                "macaddress": "00:50:56:a3:78:69",
                "macaddress_dash": "00-50-56-a3-78-69",
                "summary": "DVSwitch: 9a 96 23 50 bc 8c 77 da-c3 9d 35 76 e2 bc c1 35"
            },
            "hw_files": [
                "[***********",
                "[****",
                "[****",
                "[*****",
                "[******",
                "[****"
            ],
            "hw_folder": "/****/vm",
            "hw_guest_full_name": "",
            "hw_guest_ha_state": false,
            "hw_guest_id": null,
            "hw_interfaces": [
                "eth0",
                "eth1"
            ],
            "hw_is_template": false,
            "hw_memtotal_mb": 2048,
            "hw_name": "delete-vm",
            "hw_power_status": "poweredOn",
            "hw_processor_count": 4,
            "hw_product_uuid": "42232a91-69d9-731f-a420-f10e2f06d7eb",
            "ipv4": null,
            "ipv6": null,
            "module_hw": true,
            "snapshots": []
        }
    }
}

Reply all
Reply to author
Forward
0 new messages