infobloxopen / infoblox-ansible

Ansible modules for interfacing to Infoblox systems
GNU General Public License v3.0
55 stars 64 forks source link

Module nios_restartservices does not work #107

Open velotiger opened 2 years ago

velotiger commented 2 years ago

required function parameter missing: member_order

Whatever I try, the module «infoblox.nios_modules.nios_restartservices» always throws an error:

The full traceback is:
  File "/tmp/ansible_infoblox.nios_modules.nios_restartservices_payload_3i4ulbf1/ansible_infoblox.nios_modules.nios_restartservices_payload.zip/ansible_collections/infoblox/nios_modules/plugins/module_utils/api.py", line 209, in _invoke_method
    return method(*args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/infoblox_client/connector.py", line 50, in callee
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/infoblox_client/connector.py", line 417, in call_func
    raise ib_ex.InfobloxFuncException(
fatal: [labapic1.net.hr.de]: FAILED! => changed=false 
  code: Client.Ibap.Proto
  invocation:
    module_args:
      mode: SEQUENTIAL
      restart_option: RESTART_IF_NEEDED
      services:
      - DNS
  msg: 'required function parameter missing: member_order'
  operation: call_func
  type: AdmConProtoError

Task Example

- name: "Restart Infoblox DNS Services if needed."
  infoblox.nios_modules.nios_restartservices:
    mode: SEQUENTIAL
    restart_option: RESTART_IF_NEEDED
    services:
    - DNS
  connection: local

Infoblox provider dict is set in the playbook and is working ok for two other tasks (infoblox.nios_modules.nios_host_record, infoblox.nios_modules.nios_network).

Platform

ansible [core 2.12.1]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/…/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.9/dist-packages/ansible
  ansible collection location = /home/…/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.9.2 (default, Feb 28 2021, 17:03:44) [GCC 10.2.1 20210110]
  jinja version = 2.11.3
  libyaml = True
badnetmask commented 2 years ago

@velotiger -- I wrote this module while I was working on the other modules to manage DTC records, which require a minimum of API version 2.6. The problem you are facing is because the infoblox-client Python module defaults to WAPI 2.1, where you get this error. If you add wapi_version: "2.2" to your provider declaration, this problem will go away.

@anagha-infoblox -- would it make more sense to modify api.py and force a minimum of 2.6 (or even 2.11, which is the minimum version of the currently supported NIOS)?

velotiger commented 2 years ago

@badnetmask -- Hi Mauricio, thanks for your reply. Setting wapi_version: '2.10' in the provider dict did help. The handler is run. However, the task does not restart the services even if the Web UI states «restart needed». But that is another question an not related to this issue. Regards, Tilmann

badnetmask commented 1 year ago

@hemanthKa677 -- hey there, I see you took over the maintenance of this collection. I've had someone else reaching out directly to me about this very same problem. Any chance we can make the change I suggested in my comment above?

hemanthKa677 commented 1 year ago

Hi @badnetmask , I have made a PR for this wapi version update, in coming one or two weeks, the changes will be merged. Thanks.

badnetmask commented 8 months ago

@JchhatbarInfoblox @JkhatriInfobox - this commit already set a higher wapi_version, so I believe this issue can be closed.