On 8/3/20 12:36 PM, Sagi Shnaidman wrote:
Hi, Bogdan
thanks for raising this up, although I'm not sure I understand what it is the problem with using action plugins. Action plugins are well known official extensions for Ansible, as any other plugins - callback, strategy, inventory etc [1]. It is not any hack or unsupported workaround, it's a known and official feature of Ansible. Why can't we use it? What makes it different from filter,
I believe the cases that require the use of those should be justified. For the given example, that manages containers in a loop via calling a module, what the written custom callback plugin buys for us? That brings code to maintain, extra complexity, like handling possible corner cases in async mode, dry-run mode etc. But what is justification aside of looks handy?
lookup, inventory or any other plugin we already use? Action plugins are also used wide in Ansible itself, for example templates plugin is implemented with action plugin [2]. If Ansible can use it, why can't we? I don't think there is something with "fixing" Ansible, it's not a bug, this is a useful extension. What regards the mentioned action plugin for podman containers, it allows to spawn containers remotely while skipping the connection part for every cycle. I'm not sure you can "fix" Ansible not to do that, it's not a bug. We may not see the difference in a few hosts in CI, but it might be very efficient when we deploy on 100+ hosts oro even 1000+ hosts. In order to evaluate this on bigger setups to understand its value we configured both options - to use action plugin or usual module. If better performance of action plugin will be proven, we can switch to use it, if it doesn't make a difference on bigger setups - then I think we can easily switch back to using an usual module.
Thanks
[1] https://docs.ansible.com/ansible/latest/plugins/plugins.html [2] https://github.com/ansible/ansible/blob/devel/lib/ansible/plugins/action/tem...
On Mon, Aug 3, 2020 at 11:19 AM Bogdan Dobrelya <bdobreli@redhat.com <mailto:bdobreli@redhat.com>> wrote:
There is a trend of writing action plugins, see [0], for simple things, like just calling a module in a loop. I'm not sure that is the direction TripleO should go. If ansible is inefficient in this sort of tasks without custom python code written, we should fix ansible. Otherwise, what is the ultimate goal of that trend? Is that having only action plugins in roles and playbooks?
Please kindly asking the community to stop that, make a step back and reiterate with the taken approach. Thank you.
[0] https://review.opendev.org/716108
-- Best regards, Bogdan Dobrelya, Irc #bogdando
-- Best regards Sagi Shnaidman
-- Best regards, Bogdan Dobrelya, Irc #bogdando