rundeck-plugins / ansible-plugin

Ansible Integration for Rundeck
MIT License
329 stars 99 forks source link

RUN-2448: ENH: Ansible plugin performance issue #368

Closed alexander-variacode closed 2 weeks ago

alexander-variacode commented 1 month ago

⛔️ Ticket:

https://pagerduty.atlassian.net/browse/RUN-2448

❌ Issue:

The method getNodes consume a lot CPU and RAM when it tries to process all Ansible nodes and converting them into Rundeck nodes.

✅ Solution:

When Gather Facts is set to false another Ansible command (ansible-inventory) is applied to bring in the nodes and convert them to Rundeck format. These nodes, now transformed, will have much less information but will not consume large CPU and RAM resources, which is what happened with the previous playbook when Gather Facts is true. In addition, in the file ansible.cfg it has to change this property to "duplicate_dict_key=ignore"

Documentation PR: https://github.com/rundeck/docs/pull/1490

ltamaster commented 1 month ago

we will also need to add a functional test for this case

ronaveva commented 3 weeks ago

what was the config that the client reporting the issue had? gather facts true or false?

alexander-variacode commented 2 weeks ago

what was the config that the client reporting the issue had? gather facts true or false?

The client had gather facts false.

alexander-variacode commented 2 weeks ago

I think the exception handling needs to be improved, right now we are loosing too much info when suppressing exceptions (not throwing or not logging the exception and just logging the message). It would be good to know how rundeck handles exceptions when being thrown from the plugin

alexander-variacode commented 2 weeks ago

I think the exception handling needs to be improved, right now we are loosing too much info when suppressing exceptions (not throwing or not logging the exception and just logging the message). It would be good to know how rundeck handles exceptions when being thrown from the plugin

Exception handler process changed

ahormazabal commented 2 weeks ago
Screenshot 2024-07-03 at 17 22 22

Should this be changed to "not recommended for large inventories"?

ahormazabal commented 2 weeks ago

Tested and worked OK. Just needs those minor adjustments.

alexander-variacode commented 2 weeks ago

not recommended for large inventories

Changed to: "Gather fresh facts before importing? (Not recommended for large inventories)"