Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vmware_guest: 'AnsibleModule' object has no attribute 'fail' #1401

Closed
Tomorrow9 opened this issue Jul 19, 2022 · 0 comments · Fixed by #1402
Closed

vmware_guest: 'AnsibleModule' object has no attribute 'fail' #1401

Tomorrow9 opened this issue Jul 19, 2022 · 0 comments · Fixed by #1402

Comments

@Tomorrow9
Copy link
Collaborator

SUMMARY

Task failed when try to enable VBS on Windows VM

ISSUE TYPE
  • Bug Report
COMPONENT NAME

vmware_guest

ANSIBLE VERSION
ansible [core 2.13.0]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.8/site-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.8.12 (default, Dec 12 2021, 11:39:22) [GCC 7.3.0]
  jinja version = 3.0.3
  libyaml = True
COLLECTION VERSION

CONFIGURATION

OS / ENVIRONMENT

Windows 10

STEPS TO REPRODUCE
- hosts: localhost
  tasks:
    - name: test vbs config
      vmware_guest:
        hostname: "{{ vsphere_host_name }}"
        username: "{{ vsphere_host_user }}"
        password: "{{ vsphere_host_user_password }}"
        validate_certs: "{{ validate_certs | default(false) }}"
        datacenter: "{{ vsphere_host_datacenter }}"
        folder: "{{ vm_folder }}"
        name: "{{ vm_name }}"
        hardware:
          virt_based_security: "{{ win_enable_vbs }}"
      register: vm_config_vbs_result
    - debug: var=vm_config_vbs_result
EXPECTED RESULTS

Windows VM VBS enabled

ACTUAL RESULTS

Task failed

The full traceback is:
Traceback (most recent call last):
  File "/root/.ansible/tmp/ansible-tmp-1658208036.0432546-5446-152058052578346/AnsiballZ_vmware_guest.py", line 107, in <module>
    _ansiballz_main()
  File "/root/.ansible/tmp/ansible-tmp-1658208036.0432546-5446-152058052578346/AnsiballZ_vmware_guest.py", line 99, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File "/root/.ansible/tmp/ansible-tmp-1658208036.0432546-5446-152058052578346/AnsiballZ_vmware_guest.py", line 47, in invoke_module
    runpy.run_module(mod_name='ansible_collections.community.vmware.plugins.modules.vmware_guest', init_globals=dict(_module_fqn='ansible_collections.community.vmware.plugins.modules.vmware_guest', _modlib_path=modlib_path),
  File "/usr/local/lib/python3.8/runpy.py", line 207, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "/usr/local/lib/python3.8/runpy.py", line 97, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/usr/local/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/tmp/ansible_vmware_guest_payload_ik7gb7i0/ansible_vmware_guest_payload.zip/ansible_collections/community/vmware/plugins/modules/vmware_guest.py", line 3463, in <module>
  File "/tmp/ansible_vmware_guest_payload_ik7gb7i0/ansible_vmware_guest_payload.zip/ansible_collections/community/vmware/plugins/modules/vmware_guest.py", line 3376, in main
AttributeError: 'AnsibleModule' object has no attribute 'fail'
fatal: [localhost]: FAILED! => {
    "changed": false,
    "module_stderr": "Traceback (most recent call last):\n  File \"/root/.ansible/tmp/ansible-tmp-1658208036.0432546-5446-152058052578346/AnsiballZ_vmware_guest.py\", line 107, in <module>\n    _ansiballz_main()\n  File \"/root/.ansible/tmp/ansible-tmp-1658208036.0432546-5446-152058052578346/AnsiballZ_vmware_guest.py\", line 99, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/root/.ansible/tmp/ansible-tmp-1658208036.0432546-5446-152058052578346/AnsiballZ_vmware_guest.py\", line 47, in invoke_module\n    runpy.run_module(mod_name='ansible_collections.community.vmware.plugins.modules.vmware_guest', init_globals=dict(_module_fqn='ansible_collections.community.vmware.plugins.modules.vmware_guest', _modlib_path=modlib_path),\n  File \"/usr/local/lib/python3.8/runpy.py\", line 207, in run_module\n    return _run_module_code(code, init_globals, run_name, mod_spec)\n  File \"/usr/local/lib/python3.8/runpy.py\", line 97, in _run_module_code\n    _run_code(code, mod_globals, init_globals,\n  File \"/usr/local/lib/python3.8/runpy.py\", line 87, in _run_code\n    exec(code, run_globals)\n  File \"/tmp/ansible_vmware_guest_payload_ik7gb7i0/ansible_vmware_guest_payload.zip/ansible_collections/community/vmware/plugins/modules/vmware_guest.py\", line 3463, in <module>\n  File \"/tmp/ansible_vmware_guest_payload_ik7gb7i0/ansible_vmware_guest_payload.zip/ansible_collections/community/vmware/plugins/modules/vmware_guest.py\", line 3376, in main\nAttributeError: 'AnsibleModule' object has no attribute 'fail'\n",
    "module_stdout": "",
    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
    "rc": 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant