ansible/cloud/vmware
Joseph Callen 2fc15c5d2b Resolves issue with vmware_vswitch module for v2.0
When this module was written back in May 2015 we were using 1.9.x. Being lazy I added to param the objects that the other functions would need. What I have noticed is in 2.0 exit_json is trying to jsonify those complex objects and failing.

Playbook
```yaml
   - name: Add a temporary vSwitch
      local_action:
        module: vmware_vswitch
        hostname: "{{ inventory_hostname }}"
        username: "{{ esxi_username }}"
        password: "{{ site_passwd }}"
        switch_name: temp_vswitch
        nic_name: "{{ vss_vmnic }}"
        mtu: 1500
```

Module Testing
```bash
TASK [Add a temporary vSwitch] *************************************************
task path: /opt/autodeploy/projects/emmet/tasks/deploy/esxi_network.yml:13
ESTABLISH LOCAL CONNECTION FOR USER: root
localhost EXEC ( umask 22 && mkdir -p "$( echo $HOME/.ansible/tmp/ansible-tmp-1454342817.37-180776062017566 )" && echo "$( echo $HOME/.ansible/tmp/ansible-tmp-1454342817.37-180776062017566 )" )
ESTABLISH LOCAL CONNECTION FOR USER: root
localhost EXEC ( umask 22 && mkdir -p "$( echo $HOME/.ansible/tmp/ansible-tmp-1454342817.41-201974997737598 )" && echo "$( echo $HOME/.ansible/tmp/ansible-tmp-1454342817.41-201974997737598 )" )
ESTABLISH LOCAL CONNECTION FOR USER: root
localhost EXEC ( umask 22 && mkdir -p "$( echo $HOME/.ansible/tmp/ansible-tmp-1454342817.44-148446986849801 )" && echo "$( echo $HOME/.ansible/tmp/ansible-tmp-1454342817.44-148446986849801 )" )
localhost PUT /tmp/tmpLLExSG TO /root/.ansible/tmp/ansible-tmp-1454342817.37-180776062017566/vmware_vswitch
localhost EXEC LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /root/.ansible/tmp/ansible-tmp-1454342817.37-180776062017566/vmware_vswitch; rm -rf "/root/.ansible/tmp/ansible-tmp-1454342817.37-180776062017566/" > /dev/null 2>&1
localhost PUT /tmp/tmpyoAaHt TO /root/.ansible/tmp/ansible-tmp-1454342817.41-201974997737598/vmware_vswitch
localhost EXEC LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /root/.ansible/tmp/ansible-tmp-1454342817.41-201974997737598/vmware_vswitch; rm -rf "/root/.ansible/tmp/ansible-tmp-1454342817.41-201974997737598/" > /dev/null 2>&1
localhost PUT /tmp/tmpPcmaMZ TO /root/.ansible/tmp/ansible-tmp-1454342817.44-148446986849801/vmware_vswitch
localhost EXEC LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /root/.ansible/tmp/ansible-tmp-1454342817.44-148446986849801/vmware_vswitch; rm -rf "/root/.ansible/tmp/ansible-tmp-1454342817.44-148446986849801/" > /dev/null 2>&1
changed: [foundation-esxi-01 -> localhost] => {"changed": true, "invocation": {"module_args": {"hostname": "foundation-esxi-01", "mtu": 1500, "nic_name": "vmnic1", "number_of_ports": 128, "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", "state": "present", "switch_name": "temp_vswitch", "username": "root"}, "module_name": "vmware_vswitch"}}
changed: [foundation-esxi-02 -> localhost] => {"changed": true, "invocation": {"module_args": {"hostname": "foundation-esxi-02", "mtu": 1500, "nic_name": "vmnic1", "number_of_ports": 128, "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", "state": "present", "switch_name": "temp_vswitch", "username": "root"}, "module_name": "vmware_vswitch"}}
changed: [foundation-esxi-03 -> localhost] => {"changed": true, "invocation": {"module_args": {"hostname": "foundation-esxi-03", "mtu": 1500, "nic_name": "vmnic1", "number_of_ports": 128, "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", "state": "present", "switch_name": "temp_vswitch", "username": "root"}, "module_name": "vmware_vswitch"}}

```

Documentation fix
2016-02-01 11:21:38 -05:00
..
__init__.py moved new module to proper subdir 2015-04-22 10:18:34 -04:00
vca_fw.py use doc fragments 2016-01-12 11:03:44 -06:00
vca_nat.py Merge pull request #1487 from chrrrles/vmware_doc_fragments 2016-01-15 15:42:25 -06:00
vca_vapp.py reference instance_id in docs, fixes for calls to fail_json 2015-10-12 08:35:21 -05:00
vmware_cluster.py use doc fragments 2016-01-12 11:03:44 -06:00
vmware_datacenter.py use doc fragments 2016-01-12 11:03:44 -06:00
vmware_dns_config.py use doc fragments 2016-01-12 11:03:44 -06:00
vmware_dvs_host.py use doc fragments 2016-01-12 11:03:44 -06:00
vmware_dvs_portgroup.py use doc fragments 2016-01-12 11:03:44 -06:00
vmware_dvswitch.py use doc fragments 2016-01-12 11:03:44 -06:00
vmware_host.py use doc fragments 2016-01-12 11:03:44 -06:00
vmware_migrate_vmk.py use doc fragments 2016-01-12 11:03:44 -06:00
vmware_portgroup.py use doc fragments 2016-01-12 11:03:44 -06:00
vmware_target_canonical_facts.py use doc fragments 2016-01-12 11:03:44 -06:00
vmware_vm_facts.py use doc fragments 2016-01-12 11:03:44 -06:00
vmware_vm_shell.py use doc fragments 2016-01-12 11:03:44 -06:00
vmware_vm_vss_dvs_migrate.py use doc fragments 2016-01-12 11:03:44 -06:00
vmware_vmkernel.py use doc fragments 2016-01-12 11:03:44 -06:00
vmware_vmkernel_ip_config.py use doc fragments 2016-01-12 11:03:44 -06:00
vmware_vsan_cluster.py use doc fragments 2016-01-12 11:03:44 -06:00
vmware_vswitch.py Resolves issue with vmware_vswitch module for v2.0 2016-02-01 11:21:38 -05:00
vsphere_copy.py adding no_log to password 2016-01-05 14:36:05 -06:00