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

Collection confluent.platform 7.6.1 filters.py file differs from the GitHub version #1719

Open
rouba002 opened this issue Jul 8, 2024 · 5 comments

Comments

@rouba002
Copy link

rouba002 commented Jul 8, 2024

File filters.py used for definition of custom filters is different in collection .tar file from the version available via git. This causes issues when running playbook. Namely construction of kafka_broker_final_properties or any task where confluent.platform.listener_properties() filter is called stops with error, due to different number of input variables.

The error when running specific tasks with this filter being used (only part of the output):

TASK [kafka_broker : Assert log.dirs Property not Misconfigured] **************************************************************************************************************************************************************************************************************
Thursday 04 July 2024  14:54:16 +0200 (0:00:00.092)       0:00:26.895 *********
fatal: [kf01.edc.ttc-noviq.cz]: FAILED! => {"msg": "The conditional check 'kafka_broker_final_properties['log.dirs'].split(',')[0] != \"/\"' failed. The error was: An unhandled exception occurred while templating '{{ kafka_broker_combined_properties | combine(kafka_broker_custom_properties) }}'. Error was a <class 'ansible.errors.AnsibleError'>, original message: An unhandled exception occurred while templating 
...
...
... FilterModule.listener_properties() takes 20 positional arguments but 27 were given. FilterModule.listener_properties() takes 20 positional arguments but 27 were given"}

To Reproduce

  • install confluent.platform from ansible galaxy
  • clone git repository of confluent playbook
  • run configuration with basic playbook

Expected behaviour
No errors should occur.

Logs
See above

Environment (please complete the following information):

  • OS: Debian 12.6.
  • Ansible Version: ansible [core 2.14.3]

FIX:
Just replace the filters.py from plugins/filter/filters.py in the collection firectory. In my case
cp plugins/filter/filters.py /home/ansible-user/.ansible/collections/ansible_collections/confluent/platform/plugins/filter/filters.py

Additional context
I have not performed the whole instalation, just took over after my colleague, when things went in the wrong direction. So maybe there where some extra steps in the install procedure done. From what I tell, this specific file is definitely differrent and copying the GIT version into collection dir fixes the situation.

Thank you for the investigation
r.

@rouba002 rouba002 changed the title confluent.platform 7.6.1 filters.py differs from the GitHub version Collection confluent.platform 7.6.1 filters.py file differs from the GitHub version Jul 8, 2024
@mansisinha
Copy link
Member

why do you need to install from ansible galaxy and then git clone as well? Adding to this, please check that you're cloning the correct branch, it might be that you are cloning master branch, which has more arguments for this python function compared to 7.6.1

@flisak-robert
Copy link

flisak-robert commented Jul 24, 2024

we're experiencing a similar issue with version 7.6.2. Playbook is failing with listener_properties() takes 20 positional arguments but 22 were given

@mansisinha
Copy link
Member

mansisinha commented Jul 24, 2024

hey @flisak-robert , could you please add the steps and commands that you followed to run into this behaviour? Also, could you please share the git branch that you are using?

@flisak-robert
Copy link

flisak-robert commented Jul 24, 2024

hey @flisak-robert , could you please add the steps that you followed to run into this behaviour? Also, could you please share the git branch that you are using?

I have a fork of this repository and currently I'm version at 7.3.4, I created a new branch based on this repo's tag v7.6.2 and ran ansible.

Filters.py file matches exactly with the one in this git tag v7.6.2.

@mansisinha
Copy link
Member

we have added 2 new arguments in listener_properties 7.6.2. You might be running into that. You might run into issues if you're using custom playbooks on top of cp-ansible playbooks which are overwriting listener_properties somewhere

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

No branches or pull requests

3 participants