Issue 1:
ISSUE TYPE

Bug Report

COMPONENT NAME

modules/cloud/vmware/vmware_guest.py

ANSIBLE VERSION

ansible 2.4.1.0
config file = /home/jzimmett/.ansible.cfg
configured module search path = [u'/home/jzimmett/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.7/site-packages/ansible
executable location = /usr/bin/ansible
python version = 2.7.5 (default, May 3 2017, 07:55:04) [GCC 4.8.5 20150623 (Red Hat 4.8.5-14)]

CONFIGURATION

DEFAULT_ROLES_PATH(env: ANSIBLE_ROLES_PATH) = [u'/home/xxxx/workspace/devops/platform-roles

HOST_KEY_CHECKING(/home/xxxx/.ansible.cfg) = False

RETRY_FILES_ENABLED(/home/xxxx/.ansible.cfg) = False

OS / ENVIRONMENT

Red Hat 7.4

SUMMARY

Same issue as #30879. vmware_guest is not handling the "cluster" option correctly and fails that it can not find the data store.

I have modified the vmware_guest.py to work properly and will do a pull request.

STEPS TO REPRODUCE

- name: "Create DHCP VM {{ vm_name }}"
vmware_guest:
hostname: "{{ vc_hostname }}"
username: "{{ vc_user }}"
password: "{{ vc_pass }}"
cluster: "{{ vc_cluster }}"
datacenter: "{{ vc_datacenter }}"
template: "{{ vm_template }}"
name: "{{ vm_name }}"
networks:
- vlan: "{{ vm_vlan }}"
type: "dhcp"
annotation: "{{ vm_notes }}"
folder: "{{ vc_folder }}"
disk:
- size_gb: 30
type: thin
datastore: "{{ vm_datastore }}"
hardware:
memory_mb: "{{ vm_memory }}"
num_cpus: "{{ vm_cpu }}"
customization:
hostname: "{{ vm_name }}"
domain: "{{ vm_domain }}"
customvalues:
- { key: "Created By", value: "Ansible" }
- { key: "Department", value: "Engineering" }
- { key: "Requested By", value: "Jeff Yates" }
- { key: "Date Created", value: "{{ ansible_date_time.date }}" }
state: poweredon
validate_certs: no
force: yes
wait_for_ip_address: "{{ vm_wait_for | default('yes') }}"
register: newvm

EXPECTED RESULTS

Handle the Cluster option properly

ACTUAL RESULTS

Unable to access the virtual machine configuration: Unable to access file [Tintri-UAT-RPM]

Issue 2:
Issue Type:

Bug Report

Ansible Version:

$ ansible --version
ansible 2.1.0 (devel b2a6784a9f) last updated 2016/03/03 23:00:55 (GMT +000)
lib/ansible/modules/core: (detached HEAD 0bbb7ba38d) last updated 2016/03/03 23:00:59 (GMT +000)
lib/ansible/modules/extras: (detached HEAD 39e4040685) last updated 2016/03/03 23:01:00 (GMT +000)
config file =
configured module search path = /opt/ansible/ansible/library

Ansible Configuration:

N/A: No ansible.cfg / No settings changed from default

sourced included ENV script from: /opt/ansible/ansible/hacking/env-setup

ANSIBLE_HOME=/opt/ansible/ansible

PYTHONPATH=/opt/ansible/ansible/lib:

Environment:

OS running Docker build from: Ubuntu 14.04.3 LTS

OS running Ansible from: CentOS Linux 7 (from: Docker image: centos:7)

OS managing: N/A

Summary:

Integration tests for parsing make target (playbook: /opt/ansible/ansible/test/integration/roles/test_bad_parsing/tasks/main.yml:29) fail on current ansible/ansible@devel branch. Not sure whether to trust that this Ansible build is ok for production use, so I'm blocked on updating my built container to benefit from fixes since it was last built.

Steps To Reproduce:

Install ansible/ansible@b2a6784a9f to /opt/ansible/ansible on a test host

Run the included hacking/env-setup script: source /opt/ansible/ansible/hacking/env-setup

Run the included integration tests with cd /opt/ansible/ansible && make -j 1 parsing test_var_precedence test_templating_settings includes test_hash test_handlers test_group_by

test_bad_parsing fails at /opt/ansible/ansible/test/integration/roles/test_bad_parsing/tasks/main.yml:29

Error looks like:

An exception occurred during task execution. The full traceback is:
Traceback (most recent call last):
File "/root/.ansible/tmp/ansible-tmp-1457046096.64-209878160685501/file", line 2491, in <module>
main()
File "/root/.ansible/tmp/ansible-tmp-1457046096.64-209878160685501/file", line 409, in main
open(path, 'w').close()
IOError: [Errno 2] No such file or directory: '/root/ansible_testing/ansible_test_file'

fatal: [testhost]: FAILED! => {"changed": false, "failed": true, "invocation": {"module_name": "file"}, "parsed": false}

Expected Results:

Tests should pass, output should look like:

TASK [test_bad_parsing : file] *************************************************
task path: /opt/ansible/ansible/test/integration/roles/test_bad_parsing/tasks/main.yml:29
ESTABLISH LOCAL CONNECTION FOR USER: root
127.0.0.1 EXEC /bin/sh -c '( umask 22 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1456130434.04-39704483789163 `" && echo "` echo $HOME/.ansible/tmp/ansible-tmp-1456130434.04-39704483789163 `" )'
127.0.0.1 PUT /tmp/tmp6K5guK TO /root/.ansible/tmp/ansible-tmp-1456130434.04-39704483789163/file
127.0.0.1 EXEC /bin/sh -c '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-1456130434.04-39704483789163/file; rm -rf "/root/.ansible/tmp/ansible-tmp-1456130434.04-39704483789163/" > /dev/null 2>&1'
changed: [testhost] => {"changed": true, "dest": "/root/ansible_testing/ansible_test_file", "diff": {"after": {"path": "/root/ansible_testing/ansible_test_file", "state": "touch"}, "before": {"path": "/root/ansible_testing/ansible_test_file", "state": "absent"}}, "gid": 0, "group": "root", "invocation": {"module_args": {"backup": null, "content": null, "delimiter": null, "diff_peek": null, "directory_mode": null, "follow": false, "force": false, "group": null, "mode": null, "name": "~/ansible_testing/ansible_test_file", "original_basename": null, "owner": null, "path": "/root/ansible_testing/ansible_test_file", "recurse": false, "regexp": null, "remote_src": null, "selevel": null, "serole": null, "setype": null, "seuser": null, "src": null, "state": "touch", "validate": null}, "module_name": "file"}, "mode": "0644", "owner": "root", "size": 0, "state": "file", "uid": 0}

TASK [test_bad_parsing : include test that we cannot insert arguments] *********
task path: /opt/ansible/ansible/test/integration/roles/test_bad_parsing/tasks/main.yml:32
included: /opt/ansible/ansible/test/integration/roles/test_bad_parsing/tasks/scenario1.yml for testhost

TASK [test_bad_parsing : include test that we cannot duplicate arguments] ******
task path: /opt/ansible/ansible/test/integration/roles/test_bad_parsing/tasks/main.yml:36
included: /opt/ansible/ansible/test/integration/roles/test_bad_parsing/tasks/scenario2.yml for testhost

TASK [test_bad_parsing : include test that we can't do this for the shell module] ***
task path: /opt/ansible/ansible/test/integration/roles/test_bad_parsing/tasks/main.yml:40
included: /opt/ansible/ansible/test/integration/roles/test_bad_parsing/tasks/scenario3.yml for testhost

TASK [test_bad_parsing : include test that we can't go all Little Bobby Droptables on a quoted var to add more] ***
task path: /opt/ansible/ansible/test/integration/roles/test_bad_parsing/tasks/main.yml:44
included: /opt/ansible/ansible/test/integration/roles/test_bad_parsing/tasks/scenario4.yml for testhost

TASK [test_bad_parsing : test that a missing/malformed jinja2 filter fails] ****
task path: /opt/ansible/ansible/test/integration/roles/test_bad_parsing/tasks/main.yml:48
fatal: [testhost]: FAILED! => {"failed": true, "msg": "template error while templating string: no filter named 'badfiltername'. String: {{output_dir|badfiltername}}"}
...ignoring

PLAY RECAP *********************************************************************
testhost : ok=9 changed=2 unreachable=0 failed=0

Actual Results:

Build + integration tests failed with error:

TASK [test_bad_parsing : file] *************************************************
task path: /opt/ansible/ansible/test/integration/roles/test_bad_parsing/tasks/main.yml:29
ESTABLISH LOCAL CONNECTION FOR USER: root
127.0.0.1 EXEC /bin/sh -c '( umask 22 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1457046096.64-209878160685501 `" && echo "` echo $HOME/.ansible/tmp/ansible-tmp-1457046096.64-209878160685501 `" )'
127.0.0.1 PUT /tmp/tmpXbN09c TO /root/.ansible/tmp/ansible-tmp-1457046096.64-209878160685501/file
127.0.0.1 EXEC /bin/sh -c '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-1457046096.64-209878160685501/file; rm -rf "/root/.ansible/tmp/ansible-tmp-1457046096.64-209878160685501/" > /dev/null 2>&1'
An exception occurred during task execution. The full traceback is:
Traceback (most recent call last):
File "/root/.ansible/tmp/ansible-tmp-1457046096.64-209878160685501/file", line 2491, in <module>
main()
File "/root/.ansible/tmp/ansible-tmp-1457046096.64-209878160685501/file", line 409, in main
open(path, 'w').close()
IOError: [Errno 2] No such file or directory: '/root/ansible_testing/ansible_test_file'

fatal: [testhost]: FAILED! => {"changed": false, "failed": true, "invocation": {"module_name": "file"}, "parsed": false}

NO MORE HOSTS LEFT *************************************************************
to retry, use: --limit @bad_parsing.retry

PLAY RECAP *********************************************************************
testhost : ok=1 changed=0 unreachable=0 failed=1

make: *** [parsing] Error 2