<h5 dir="auto">ISSUE TYPE</h5>
<ul dir="auto">
<li>Feature Idea</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>
<p dir="auto">Windows Transport</p>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">Allow connectivity to Windows hosts, via Win32 OpenSSH  (<a href="https://github.com/PowerShell/Win32-OpenSSH">https://github.com/PowerShell/Win32-OpenSSH</a>) opposed to WinRM.</p>
<p dir="auto">I can see this was requested last year but was closed as it wasn't apart of windows. Now there is a Microsoft release available (pre-prod currently). <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="229351790" data-permission-text="Title is private" data-url="https://github.com/ansible/ansible/issues/24726" data-hovercard-type="issue" data-hovercard-url="/ansible/ansible/issues/24726/hovercard" href="https://github.com/ansible/ansible/issues/24726">#24726</a></p>
<p dir="auto">(orig comment reformatted for readability)</p>

<h5 dir="auto">ISSUE TYPE</h5>
<ul dir="auto">
<li>Bug Report</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>
<p dir="auto">vmware_guest</p>
<h5 dir="auto">ANSIBLE VERSION</h5>
<p dir="auto">ansible 2.5.0<br>
config file = /etc/ansible/ansible.cfg<br>
configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']<br>
ansible python module location = /usr/lib/python2.7/site-packages/ansible-2.5.0-py2.7.egg/ansible<br>
executable location = /usr/bin/ansible<br>
python version = 2.7.5 (default, May  3 2017, 07:55:04) [GCC 4.8.5 20150623 (Red Hat 4.8.5-14)]</p>
<h5 dir="auto">CONFIGURATION</h5>
<p dir="auto">[root@vhwansgp2 _10__bss_infrastructure_playbooks]# ansible-config dump --only-changed<br>
DEFAULT_HOST_LIST(/etc/ansible/ansible.cfg) = [u'/etc/ansible/inventory']<br>
DEFAULT_STDOUT_CALLBACK(/etc/ansible/ansible.cfg) = debug<br>
HOST_KEY_CHECKING(/etc/ansible/ansible.cfg) = False<br>
PERSISTENT_CONNECT_TIMEOUT(/etc/ansible/ansible.cfg) = 30<br>
[root@vhwansgp2 _10__bss_infrastructure_playbooks]#</p>
<h5 dir="auto">OS / ENVIRONMENT</h5>
<p dir="auto">Ansible Server : RHEL 7<br>
Trying to build a VM of ESX version 6.</p>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">vmware_guest module throwing the below error.</p>
<p dir="auto">&lt;127.0.0.1&gt; EXEC /bin/sh -c '/usr/bin/python2 /var/lib/awx/.ansible/tmp/ansible-tmp-1508741611.03-141536980839774/vmware_guest.py; rm -rf "/var/lib/awx/.ansible/tmp/ansible-tmp-1508741611.03-141536980839774/" &gt; /dev/null 2&gt;&amp;1 &amp;&amp; sleep 0'</p>
<p dir="auto">The full traceback is:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Traceback (most recent call last):  File &quot;/tmp/ansible_wB67_F/ansible_module_vmware_guest.py&quot;, line 1547, in &lt;module&gt;
    main()
  File &quot;/tmp/ansible_wB67_F/ansible_module_vmware_guest.py&quot;, line 1538, in main
    result = pyv.deploy_vm()
  File &quot;/tmp/ansible_wB67_F/ansible_module_vmware_guest.py&quot;, line 1372, in deploy_vm
    self.wait_for_vm_ip(vm)
  File &quot;/tmp/ansible_wB67_F/ansible_module_vmware_guest.py&quot;, line 1457, in wait_for_vm_ip
    facts = self.gather_facts(newvm)
  File &quot;/tmp/ansible_wB67_F/ansible_module_vmware_guest.py&quot;, line 564, in gather_facts
    return gather_vm_facts(self.content, vm)
  File &quot;/tmp/ansible_wB67_F/ansible_modlib.zip/ansible/module_utils/vmware.py&quot;, line 266, in gather_vm_facts AttributeError: 'NoneType' object has no attribute 'config'

fatal: [127.0.0.1]: FAILED! =&gt; {…


PLAY RECAP *********************************************************************07:54:15

127.0.0.1                  : ok=1    changed=0    unreachable=0    failed=1
"><pre class="notranslate"><code class="notranslate">Traceback (most recent call last):  File "/tmp/ansible_wB67_F/ansible_module_vmware_guest.py", line 1547, in &lt;module&gt;
    main()
  File "/tmp/ansible_wB67_F/ansible_module_vmware_guest.py", line 1538, in main
    result = pyv.deploy_vm()
  File "/tmp/ansible_wB67_F/ansible_module_vmware_guest.py", line 1372, in deploy_vm
    self.wait_for_vm_ip(vm)
  File "/tmp/ansible_wB67_F/ansible_module_vmware_guest.py", line 1457, in wait_for_vm_ip
    facts = self.gather_facts(newvm)
  File "/tmp/ansible_wB67_F/ansible_module_vmware_guest.py", line 564, in gather_facts
    return gather_vm_facts(self.content, vm)
  File "/tmp/ansible_wB67_F/ansible_modlib.zip/ansible/module_utils/vmware.py", line 266, in gather_vm_facts AttributeError: 'NoneType' object has no attribute 'config'

fatal: [127.0.0.1]: FAILED! =&gt; {…


PLAY RECAP *********************************************************************07:54:15

127.0.0.1                  : ok=1    changed=0    unreachable=0    failed=1

</code></pre></div>
<h5 dir="auto">STEPS TO REPRODUCE</h5>
<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="---
  # Create a new VM from a template using the new vmware_guest module
  - name: VM from template
    hosts: 127.0.0.1
    gather_facts: false
    connection: local
    vars:
      notes: Created by Ansible
      dumpfacts: False
    tasks:
      - name: set the template name
        set_fact:
          vmtemplate: RHEL7.3_Template
        when:  os  == &quot;Redhat&quot; and  ver  == &quot;7.3&quot;
      - name: Create VM from template
        vmware_guest:
          validate_certs: False
          hostname: &quot;{{ vcenter_hostname }}&quot;
          username: &quot;{{ vcenter_user }}&quot;
          password: &quot;{{ vcenter_pass }}&quot;
          esxi_hostname: &quot;{{ esxhost }}&quot;
          datacenter: GBS
          name: &quot;{{hname }}&quot;
          template: &quot;{{ vmtemplate }}&quot;
          disk:
            - size_gb: 35
              type: thin
              datastore: &quot;{{ datastore }}&quot;
          hardware:
            memory_mb: &quot;{{ vm_memory | default(1024) }}&quot;
            num_cpus: &quot;{{ vm_cpu }}&quot;
          networks:
            - name: VM Network
              ip: &quot;{{ ipaddr }}&quot;
              netmask: 255.255.255.0
              gateway: &quot;{{ gatwy }}&quot;
              dns_servers:
              - 10.0.0.250
          wait_for_ip_address: True
          state: present
        register: newvm
      - name: IP address info
        debug:
          msg: &quot;{{ newvm.instance.ipv4 }} {{ hname }} {{ os }} {{ ver }}&quot;
"><pre class="notranslate">---
  <span class="pl-c"><span class="pl-c">#</span> Create a new VM from a template using the new vmware_guest module</span>
  - <span class="pl-ent">name</span>: <span class="pl-s">VM from template</span>
    <span class="pl-ent">hosts</span>: <span class="pl-s">127.0.0.1</span>
    <span class="pl-ent">gather_facts</span>: <span class="pl-c1">false</span>
    <span class="pl-ent">connection</span>: <span class="pl-s">local</span>
    <span class="pl-ent">vars</span>:
      <span class="pl-ent">notes</span>: <span class="pl-s">Created by Ansible</span>
      <span class="pl-ent">dumpfacts</span>: <span class="pl-c1">False</span>
    <span class="pl-ent">tasks</span>:
      - <span class="pl-ent">name</span>: <span class="pl-s">set the template name</span>
        <span class="pl-ent">set_fact</span>:
          <span class="pl-ent">vmtemplate</span>: <span class="pl-s">RHEL7.3_Template</span>
        <span class="pl-ent">when</span>:  <span class="pl-s">os  == "Redhat" and  ver  == "7.3"</span>
      - <span class="pl-ent">name</span>: <span class="pl-s">Create VM from template</span>
        <span class="pl-ent">vmware_guest</span>:
          <span class="pl-ent">validate_certs</span>: <span class="pl-c1">False</span>
          <span class="pl-ent">hostname</span>: <span class="pl-s"><span class="pl-pds">"</span>{{ vcenter_hostname }}<span class="pl-pds">"</span></span>
          <span class="pl-ent">username</span>: <span class="pl-s"><span class="pl-pds">"</span>{{ vcenter_user }}<span class="pl-pds">"</span></span>
          <span class="pl-ent">password</span>: <span class="pl-s"><span class="pl-pds">"</span>{{ vcenter_pass }}<span class="pl-pds">"</span></span>
          <span class="pl-ent">esxi_hostname</span>: <span class="pl-s"><span class="pl-pds">"</span>{{ esxhost }}<span class="pl-pds">"</span></span>
          <span class="pl-ent">datacenter</span>: <span class="pl-s">GBS</span>
          <span class="pl-ent">name</span>: <span class="pl-s"><span class="pl-pds">"</span>{{hname }}<span class="pl-pds">"</span></span>
          <span class="pl-ent">template</span>: <span class="pl-s"><span class="pl-pds">"</span>{{ vmtemplate }}<span class="pl-pds">"</span></span>
          <span class="pl-ent">disk</span>:
            - <span class="pl-ent">size_gb</span>: <span class="pl-c1">35</span>
              <span class="pl-ent">type</span>: <span class="pl-s">thin</span>
              <span class="pl-ent">datastore</span>: <span class="pl-s"><span class="pl-pds">"</span>{{ datastore }}<span class="pl-pds">"</span></span>
          <span class="pl-ent">hardware</span>:
            <span class="pl-ent">memory_mb</span>: <span class="pl-s"><span class="pl-pds">"</span>{{ vm_memory | default(1024) }}<span class="pl-pds">"</span></span>
            <span class="pl-ent">num_cpus</span>: <span class="pl-s"><span class="pl-pds">"</span>{{ vm_cpu }}<span class="pl-pds">"</span></span>
          <span class="pl-ent">networks</span>:
            - <span class="pl-ent">name</span>: <span class="pl-s">VM Network</span>
              <span class="pl-ent">ip</span>: <span class="pl-s"><span class="pl-pds">"</span>{{ ipaddr }}<span class="pl-pds">"</span></span>
              <span class="pl-ent">netmask</span>: <span class="pl-s">255.255.255.0</span>
              <span class="pl-ent">gateway</span>: <span class="pl-s"><span class="pl-pds">"</span>{{ gatwy }}<span class="pl-pds">"</span></span>
              <span class="pl-ent">dns_servers</span>:
              - <span class="pl-s">10.0.0.250</span>
          <span class="pl-ent">wait_for_ip_address</span>: <span class="pl-c1">True</span>
          <span class="pl-ent">state</span>: <span class="pl-s">present</span>
        <span class="pl-ent">register</span>: <span class="pl-s">newvm</span>
      - <span class="pl-ent">name</span>: <span class="pl-s">IP address info</span>
        <span class="pl-ent">debug</span>:
          <span class="pl-ent">msg</span>: <span class="pl-s"><span class="pl-pds">"</span>{{ newvm.instance.ipv4 }} {{ hname }} {{ os }} {{ ver }}<span class="pl-pds">"</span></span>
</pre></div>
<h5 dir="auto">EXPECTED RESULTS</h5>
<p dir="auto">It will create a vm and perform the basic OS configurations.</p>
<h5 dir="auto">ACTUAL RESULTS</h5>
<p dir="auto">SEARCH<br>
KEY</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible-playbook 2.5.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/var/lib/awx/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible-2.5.0-py2.7.egg/ansible
  executable location = /usr/bin/ansible-playbook
  python version = 2.7.5 (default, May  3 2017, 07:55:04) [GCC 4.8.5 20150623 (Red Hat 4.8.5-14)]
Using /etc/ansible/ansible.cfg as config file
SSH password:
Parsed /tmp/awx_95_x_P4Re/tmpEiKzAH.awxrest.py inventory source with script plugin

PLAYBOOK: create_vm.yml ********************************************************
1 plays in create_vm.yml

PLAY [VM from template] ********************************************************07:53:30
META: ran handlers
TASK [set the template name] ***************************************************07:53:30
task path: /var/lib/awx/projects/_10__bss_infrastructure_playbooks/create_vm.yml:1107:53:30
ok: [127.0.0.1] =&gt; {
    &quot;ansible_facts&quot;: {
        &quot;vmtemplate&quot;: &quot;RHEL7.3_Template&quot;
    },
    &quot;changed&quot;: false,
    &quot;failed&quot;: false
}

TASK [Create VM from template] *************************************************07:53:30
task path: /var/lib/awx/projects/_10__bss_infrastructure_playbooks/create_vm.yml:1507:53:30
Using module file /usr/lib/python2.7/site-packages/ansible-2.5.0-py2.7.egg/ansible/modules/cloud/vmware/vmware_guest.py
&lt;127.0.0.1&gt; ESTABLISH LOCAL CONNECTION FOR USER: awx
&lt;127.0.0.1&gt; EXEC /bin/sh -c 'echo ~ &amp;&amp; sleep 0'
&lt;127.0.0.1&gt; EXEC /bin/sh -c '( umask 77 &amp;&amp; mkdir -p &quot;` echo /var/lib/awx/.ansible/tmp/ansible-tmp-1508741611.03-141536980839774 `&quot; &amp;&amp; echo ansible-tmp-1508741611.03-141536980839774=&quot;` echo /var/lib/awx/.ansible/tmp/ansible-tmp-1508741611.03-141536980839774 `&quot; ) &amp;&amp; sleep 0'
&lt;127.0.0.1&gt; PUT /tmp/tmp2E_Vnk TO /var/lib/awx/.ansible/tmp/ansible-tmp-1508741611.03-141536980839774/vmware_guest.py
&lt;127.0.0.1&gt; EXEC /bin/sh -c 'chmod u+x /var/lib/awx/.ansible/tmp/ansible-tmp-1508741611.03-141536980839774/ /var/lib/awx/.ansible/tmp/ansible-tmp-1508741611.03-141536980839774/vmware_guest.py &amp;&amp; sleep 0'
&lt;127.0.0.1&gt; EXEC /bin/sh -c '/usr/bin/python2 /var/lib/awx/.ansible/tmp/ansible-tmp-1508741611.03-141536980839774/vmware_guest.py; rm -rf &quot;/var/lib/awx/.ansible/tmp/ansible-tmp-1508741611.03-141536980839774/&quot; &gt; /dev/null 2&gt;&amp;1 &amp;&amp; sleep 0'

The full traceback is:

Traceback (most recent call last):  File &quot;/tmp/ansible_wB67_F/ansible_module_vmware_guest.py&quot;, line 1547, in &lt;module&gt;
    main()
  File &quot;/tmp/ansible_wB67_F/ansible_module_vmware_guest.py&quot;, line 1538, in main
    result = pyv.deploy_vm()
  File &quot;/tmp/ansible_wB67_F/ansible_module_vmware_guest.py&quot;, line 1372, in deploy_vm
    self.wait_for_vm_ip(vm)
  File &quot;/tmp/ansible_wB67_F/ansible_module_vmware_guest.py&quot;, line 1457, in wait_for_vm_ip
    facts = self.gather_facts(newvm)
  File &quot;/tmp/ansible_wB67_F/ansible_module_vmware_guest.py&quot;, line 564, in gather_facts
    return gather_vm_facts(self.content, vm)
  File &quot;/tmp/ansible_wB67_F/ansible_modlib.zip/ansible/module_utils/vmware.py&quot;, line 266, in gather_vm_facts AttributeError: 'NoneType' object has no attribute 'config'

fatal: [127.0.0.1]: FAILED! =&gt; {…

PLAY RECAP *********************************************************************07:54:15
127.0.0.1                  : ok=1    changed=0    unreachable=0    failed=1"><pre class="notranslate"><code class="notranslate">ansible-playbook 2.5.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/var/lib/awx/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible-2.5.0-py2.7.egg/ansible
  executable location = /usr/bin/ansible-playbook
  python version = 2.7.5 (default, May  3 2017, 07:55:04) [GCC 4.8.5 20150623 (Red Hat 4.8.5-14)]
Using /etc/ansible/ansible.cfg as config file
SSH password:
Parsed /tmp/awx_95_x_P4Re/tmpEiKzAH.awxrest.py inventory source with script plugin

PLAYBOOK: create_vm.yml ********************************************************
1 plays in create_vm.yml

PLAY [VM from template] ********************************************************07:53:30
META: ran handlers
TASK [set the template name] ***************************************************07:53:30
task path: /var/lib/awx/projects/_10__bss_infrastructure_playbooks/create_vm.yml:1107:53:30
ok: [127.0.0.1] =&gt; {
    "ansible_facts": {
        "vmtemplate": "RHEL7.3_Template"
    },
    "changed": false,
    "failed": false
}

TASK [Create VM from template] *************************************************07:53:30
task path: /var/lib/awx/projects/_10__bss_infrastructure_playbooks/create_vm.yml:1507:53:30
Using module file /usr/lib/python2.7/site-packages/ansible-2.5.0-py2.7.egg/ansible/modules/cloud/vmware/vmware_guest.py
&lt;127.0.0.1&gt; ESTABLISH LOCAL CONNECTION FOR USER: awx
&lt;127.0.0.1&gt; EXEC /bin/sh -c 'echo ~ &amp;&amp; sleep 0'
&lt;127.0.0.1&gt; EXEC /bin/sh -c '( umask 77 &amp;&amp; mkdir -p "` echo /var/lib/awx/.ansible/tmp/ansible-tmp-1508741611.03-141536980839774 `" &amp;&amp; echo ansible-tmp-1508741611.03-141536980839774="` echo /var/lib/awx/.ansible/tmp/ansible-tmp-1508741611.03-141536980839774 `" ) &amp;&amp; sleep 0'
&lt;127.0.0.1&gt; PUT /tmp/tmp2E_Vnk TO /var/lib/awx/.ansible/tmp/ansible-tmp-1508741611.03-141536980839774/vmware_guest.py
&lt;127.0.0.1&gt; EXEC /bin/sh -c 'chmod u+x /var/lib/awx/.ansible/tmp/ansible-tmp-1508741611.03-141536980839774/ /var/lib/awx/.ansible/tmp/ansible-tmp-1508741611.03-141536980839774/vmware_guest.py &amp;&amp; sleep 0'
&lt;127.0.0.1&gt; EXEC /bin/sh -c '/usr/bin/python2 /var/lib/awx/.ansible/tmp/ansible-tmp-1508741611.03-141536980839774/vmware_guest.py; rm -rf "/var/lib/awx/.ansible/tmp/ansible-tmp-1508741611.03-141536980839774/" &gt; /dev/null 2&gt;&amp;1 &amp;&amp; sleep 0'

The full traceback is:

Traceback (most recent call last):  File "/tmp/ansible_wB67_F/ansible_module_vmware_guest.py", line 1547, in &lt;module&gt;
    main()
  File "/tmp/ansible_wB67_F/ansible_module_vmware_guest.py", line 1538, in main
    result = pyv.deploy_vm()
  File "/tmp/ansible_wB67_F/ansible_module_vmware_guest.py", line 1372, in deploy_vm
    self.wait_for_vm_ip(vm)
  File "/tmp/ansible_wB67_F/ansible_module_vmware_guest.py", line 1457, in wait_for_vm_ip
    facts = self.gather_facts(newvm)
  File "/tmp/ansible_wB67_F/ansible_module_vmware_guest.py", line 564, in gather_facts
    return gather_vm_facts(self.content, vm)
  File "/tmp/ansible_wB67_F/ansible_modlib.zip/ansible/module_utils/vmware.py", line 266, in gather_vm_facts AttributeError: 'NoneType' object has no attribute 'config'

fatal: [127.0.0.1]: FAILED! =&gt; {…

PLAY RECAP *********************************************************************07:54:15
127.0.0.1                  : ok=1    changed=0    unreachable=0    failed=1
</code></pre></div>