Creates a VMware vSwitch
We have an end-to-end playbook that performs bare metal provisioning and
configuration of vSphere.
The playbooks/tasks and results from that testing is what will be listed
in this PR.
If there are any questions please let either @jcpowermac or @mtnbikenc
know.
Tested with version
```
$ ansible-playbook --version
ansible-playbook 1.9.2
configured module search path = None
```
Associated tasks used for testing below
```
- 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: 9000
```
Verbose testing output and results
```
TASK: [Configure ESXi hostname and DNS servers]
*******************************
<127.0.0.1> REMOTE_MODULE vmware_dns_config password=VALUE_HIDDEN
hostname=foundation-esxi-01 change_hostname_to=cscesxtmp001
domainname=lordbusiness.local dns_servers=192.168.70.3,192.168.70.4
username=root
<127.0.0.1> REMOTE_MODULE vmware_dns_config password=VALUE_HIDDEN
hostname=foundation-esxi-02 change_hostname_to=cscesxtmp002
domainname=lordbusiness.local dns_servers=192.168.70.3,192.168.70.4
username=root
<127.0.0.1> REMOTE_MODULE vmware_dns_config password=VALUE_HIDDEN
hostname=foundation-esxi-03 change_hostname_to=cscesxtmp003
domainname=lordbusiness.local dns_servers=192.168.70.3,192.168.70.4
username=root
changed: [foundation-esxi-01 -> 127.0.0.1] => {"changed": true}
changed: [foundation-esxi-03 -> 127.0.0.1] => {"changed": true}
changed: [foundation-esxi-02 -> 127.0.0.1] => {"changed": true}
```
Due to a software bug in vSphere, it fails to handle ampersand in datacenter names.
The solution is to do what vSphere does (when browsing) and double-encode ampersands.
It is likely other characters need special treatment like this as well, haven't found any.
Due to a spurious newline we corrupted the payload. It depends on the order of the headers and if there were headers added by vSphere.
The Accept header was also not needed.