ansible-collections / community.general

Ansible Community General Collection
https://galaxy.ansible.com/ui/repo/published/community/general/
GNU General Public License v3.0
787 stars 1.45k forks source link

[cobbler_system] XMLRPC api issue #8506

Open Algirdas-Z opened 3 weeks ago

Algirdas-Z commented 3 weeks ago

Summary

Hello,

It seems for some weird reason, cobbler_system module is passing more arguments to method as expected When you have "defined" system in cobbler and use module to modify it I encounter error with following output:

  File "/usr/local/Cellar/python@3.9/3.9.18/Frameworks/Python.framework/Versions/3.9/lib/python3.9/xmlrpc/client.py", line 668, in close
    raise Fault(**self._stack[0])
xmlrpc.client.Fault: <Fault 1: "<class 'TypeError'>:get_system_handle() takes 2 positional arguments but 3 were given">

Which seems to point to this place: https://github.com/ansible-collections/community.general/blob/2574cb0dea23008be2cc158310523b00e72354d4/plugins/modules/cobbler_system.py#L282

However here where my findings end, I have no idea how it happens so the method receives 3 arguments instead of 2.

ansible [core 2.16.0]

Issue Type

Bug Report

Component Name

cobbler_system

Ansible Version

ansible [core 2.15.9]

  python version = 3.9.18 (main, Aug 24 2023, 21:32:48) [Clang 14.0.3 (clang-1403.0.22.14.1)] (..../virtual_env/bin/python3.9)
  jinja version = 3.1.3
  libyaml = True

Community.general Version

Collection        Version
----------------- -------
community.general 9.0.1  

Configuration

$ ansible-config dump --only-changed

OS / Environment

No response

Steps to Reproduce


- name: Ensure the system exists in Cobbler
  cobbler_system:
    host: "{{ cobbler_master_api }}"
    name: "{{ cobbler_boot_enable.name }}"
    username: "{{ cobbler_api_user }}"
    password: "{{ cobbler_api_password }}"
    use_ssl: no
    sync: yes
    state: present
    properties:
      comment: "{{ cobbler_boot_enable.comment | default(omit, true) |string }}"
      kernel_options: "{{ cobbler_boot_enable.kernel_options | default(omit, true) }}"
      netboot_enabled: yes
      enable_ipxe: yes
      profile: "{{ cobbler_boot_enable.profile }}"
      name_servers: "{{ cobbler_boot_enable.name_servers | default('1.1.1.1') }}"
      interfaces: "{{ cobbler_boot_enable.interfaces }}"
      gateway: "{{ cobbler_boot_enable.gateway | default(omit, true) }}"
      autoinstall_meta: "{{ cobbler_boot_enable.metadata }}"
      hostname: "{{ cobbler_boot_enable.hostname }}"
  delegate_to: localhost

Expected Results

I expect (from code, seems like maintainer also expects) cobbler_system module to modify object if system is already defined

Actual Results

 <Fault 1: \"<class 'TypeError'>:get_system_handle() takes 2 positional arguments but 3 were given\">\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}

Code of Conduct

ansibullbot commented 3 weeks ago

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

ansibullbot commented 3 weeks ago

cc @dagwieers click here for bot help