univention / ansible-modules

Ansible Modules for UCS
GNU General Public License v3.0
11 stars 6 forks source link

Univention Config Registry: manually read registry files #4

Closed mbunkus closed 2 years ago

mbunkus commented 2 years ago

So far Univention's own config registry backend module was loaded & its functionality used for reading the UCR. This is unfortunately incompatible with using the Mitogen connection strategy plugin & Python 3. See this bug report for more details.

My understanding is that Mitogen works by streaming Python modules from the Ansible host to the target machine, meaning the imported modules must exist on the host machine, too, which would limit the Ansible host to being a Univention system, too.

Interestingly this only manifests when Python 3 is used as the Python interpreter on the target; it works fine with Python 2. The reason is unclear.

This PR converts using Univention's own backend modules to reading the files directly/using ucr commit for committing files.

The other commit solely fixes three spelling mistakes.

zumvorde commented 2 years ago

Thank you very much for the pull request. We are having a look at it and will come back to you. We did not have mitogen and compatibility to it on our radar so far. Therefore we need to make the general decision if we want to support it or not. Our biggest concern right now is if we can continue using the python API for UCS specific functionality. This decision might not only impact the UCR module but also the UDM module and the new one that is still in development.

mbunkus commented 2 years ago

I can totally understand your hesitation and do see your points. That being said, for me being able to use Mitogen turns Ansible usage from "barely tolerable" to "actually OK". For example, running through my not-so-complex full setup playbook without Mitogen takes more than five minutes, but it finishes in less than one minute with Mitogen — without any changes in both runs. Having to wait for more than five minutes for each run means that I will definitely task-switch to something else, really killing my productivity.

I just want to impress that using Mitogen isn't just a nice to have with little gain, it is actually substantial.

zumvorde commented 2 years ago

we are sorry to inform you that we will not merge this branch into main. The reason is that the python library for UCR is not used.

Why do we want to use the Univention Python APIs? Because the user base of these Ansible Modules is still small and they are not officially supported, we can only invest limited time into their maintenance. We need to keep the maintenance effort sufficiently small. For UCR this would be ok, but if we make one module mitogen compatible we should also do this for all other modules, for them to become really useful. If we however stay with the python API, we make all this simpler.

Why is mitogen less important to us right now? We are still in the process of building a complete set of UCS modules. Once we have finished with this task, users will be able to configure a complete UCS environment using Ansible. Right now this is not possible for the appcenter, for example. We will look at optimization and usability improvements, like mitogen compatibility, once all the basic features are there.

What are your alternatives? I understand your frustration with the speed of the playbook execution. As you likely already know, you can use your own module locally as is described here https://docs.ansible.com/ansible/latest/dev_guide/developing_locally.html#adding-standalone-local-modules-for-selected-playbooks-or-a-single-role .

How will we continue? For now we will continue using the UCS python APIs. However, mitogen will be considered in the future as a possibility for optimization.

mbunkus commented 2 years ago

Alright, disappointing but definitely understandable. Thanks for the detailed explanation.