Skip to content

Bug no attribute 'ruleset' - no attribute 'service' #1628

Open
@tsiamer

Description

@tsiamer
SUMMARY

Hi All, cannot seem to enable services , firewall rules keep getting no attribute 'ruleset' - no attribute 'service'. https://docs.ansible.com/ansible/latest/collections/community/vmware/vmware_host_service_manager_module.html

ISSUE TYPE
  • Bug Report
COMPONENT NAME
ANSIBLE VERSION

ansible [core 2.13.7]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /root/.local/lib/python3.8/site-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.8.10 (default, Nov 14 2022, 12:59:47) [GCC 9.4.0]
  jinja version = 3.1.2
  libyaml = True

COLLECTION VERSION
# /root/.ansible/collections/ansible_collections
Collection       Version
---------------- -------
community.vmware 3.3.0  
CONFIGURATION
DEFAULT_BECOME(/etc/ansible/ansible.cfg) = True
DEFAULT_BECOME_ASK_PASS(/etc/ansible/ansible.cfg) = False
DEFAULT_BECOME_METHOD(/etc/ansible/ansible.cfg) = sudo
DEFAULT_BECOME_USER(/etc/ansible/ansible.cfg) = root
DEFAULT_HOST_LIST(/etc/ansible/ansible.cfg) = ['/etc/ansible/inventory']
DEFAULT_ROLES_PATH(/etc/ansible/ansible.cfg) = ['/etc/ansible/roles']
OS / ENVIRONMENT

Description: Ubuntu 20.04.5 LTS
Release: 20.04
Codename: focal

STEPS TO REPRODUCE
  • name: Start ntpd service setting for all ESXi Host in given Cluster
    community.vmware.vmware_host_service_manager:
    hostname: "{{ vcenter_hostname }}"
    username: "{{ vcenter_user }}"
    password: "{{ vc_password }}"
    cluster_name: "{{ cluster_name }}"
    validate_certs: no
    service_name: ntpd
    state: present
    delegate_to: localhost
EXPECTED RESULTS

NTP should be enabled on all esxi host in the cluster.

ACTUAL RESULTS
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: AttributeError: 'NoneType' object has no attribute 'service'
fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n  File \"/root/.ansible/tmp/ansible-tmp-1675806999.485564-458859-6265074440197/AnsiballZ_vmware_host_service_manager.py\", line 107, in <module>\n    _ansiballz_main()\n  File \"/root/.ansible/tmp/ansible-tmp-1675806999.485564-458859-6265074440197/AnsiballZ_vmware_host_service_manager.py\", line 99, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/root/.ansible/tmp/ansible-tmp-1675806999.485564-458859-6265074440197/AnsiballZ_vmware_host_service_manager.py\", line 47, in invoke_module\n    runpy.run_module(mod_name='ansible_collections.community.vmware.plugins.modules.vmware_host_service_manager', init_globals=dict(_module_fqn='ansible_collections.community.vmware.plugins.modules.vmware_host_service_manager', _modlib_path=modlib_path),\n  File \"/usr/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/lib/python3.8/runpy.py\", line 97, in _run_module_code\n    _run_code(code, mod_globals, init_globals,\n  File \"/usr/lib/python3.8/runpy.py\", line 87, in _run_code\n    exec(code, run_globals)\n  File \"/tmp/ansible_community.vmware.vmware_host_service_manager_payload_4f8_45if/ansible_community.vmware.vmware_host_service_manager_payload.zip/ansible_collections/community/vmware/plugins/modules/vmware_host_service_manager.py\", line 219, in <module>\n  File \"/tmp/ansible_community.vmware.vmware_host_service_manager_payload_4f8_45if/ansible_community.vmware.vmware_host_service_manager_payload.zip/ansible_collections/community/vmware/plugins/modules/vmware_host_service_manager.py\", line 215, in main\n  File \"/tmp/ansible_community.vmware.vmware_host_service_manager_payload_4f8_45if/ansible_community.vmware.vmware_host_service_manager_payload.zip/ansible_collections/community/vmware/plugins/modules/vmware_host_service_manager.py\", line 135, in service_ctrl\n  File \"/tmp/ansible_community.vmware.vmware_host_service_manager_payload_4f8_45if/ansible_community.vmware.vmware_host_service_manager_payload.zip/ansible_collections/community/vmware/plugins/modules/vmware_host_service_manager.py\", line 183, in check_service_state\nAttributeError: 'NoneType' object has no attribute 'service'\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}

And for firewall playbook:

*
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: AttributeError: 'NoneType' object has no attribute 'ruleset'
fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n  File \"/root/.ansible/tmp/ansible-tmp-1675807285.0901964-459136-253271644854354/AnsiballZ_vmware_host_firewall_manager.py\", line 107, in <module>\n    _ansiballz_main()\n  File \"/root/.ansible/tmp/ansible-tmp-1675807285.0901964-459136-253271644854354/AnsiballZ_vmware_host_firewall_manager.py\", line 99, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/root/.ansible/tmp/ansible-tmp-1675807285.0901964-459136-253271644854354/AnsiballZ_vmware_host_firewall_manager.py\", line 47, in invoke_module\n    runpy.run_module(mod_name='ansible_collections.community.vmware.plugins.modules.vmware_host_firewall_manager', init_globals=dict(_module_fqn='ansible_collections.community.vmware.plugins.modules.vmware_host_firewall_manager



Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue/PR relates to a bugneeds_triageNeeds a first human triage before being processed.python3traceback

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions