viya-ark icon indicating copy to clipboard operation
viya-ark copied to clipboard

Perform package installs in a single transaction rather than using a loop

Open AWSmith0216 opened this issue 1 year ago • 1 comments

Is your feature request related to a problem? Please describe. Not really. In my environment, during the package pre-install phase, I had some packages succeed and some fail with SSL errors. That brought my attention to the fact the packages were installing as separate transactions, although I don't think that it's necessarily the reason for my failure.

Describe the solution you'd like Currently when installing packages, the package module is being used along with a with_items loop. This causes the package module to install each package one at a time. If the list of packages was instead passed as direct input to the name parameter, then the packages would be installed in a single transaction. That would likely be a bit faster and perhaps more reliable.

Refer to https://github.com/ansible/ansible/issues/24581 for some discussion.

Describe alternatives you've considered None. This seems to be the preferred approach.

Additional context Example of current output:

TASK [viya-ark.preinstall : Ensures required packages are present] *************
changed: [10.11.12.13] => (item=numactl) => {"ansible_loop_var": "item", "changed": true, "item": "numactl", "msg": "", "rc": 0, "results": ["Installed: numactl-2.0.12-13.el8.x86_64"]}
changed: [10.11.12.13] => (item=libXp.x86_64) => {"ansible_loop_var": "item", "changed": true, "item": "libXp.x86_64", "msg": "", "rc": 0, "results": ["Installed: libXp-1.0.3-3.el8.x86_64"]}
ok: [10.11.12.13] => (item=libXext) => {"ansible_loop_var": "item", "changed": false, "item": "libXext", "msg": "Nothing to do", "rc": 0, "results": []}
changed: [10.11.12.13] => (item=libXmu) => {"ansible_loop_var": "item", "changed": true, "item": "libXmu", "msg": "", "rc": 0, "results": ["Installed: libICE-1.0.9-15.el8.x86_64", "Installed: libXmu-1.1.3-1.el8.x86_64", "Installed: libSM-1.2.3-1.el8.x86_64", "Installed: libXt-1.1.5-12.el8.x86_64"]}
changed: [10.11.12.13] => (item=libXtst) => {"ansible_loop_var": "item", "changed": true, "item": "libXtst", "msg": "", "rc": 0, "results": ["Installed: libXi-1.7.10-1.el8.x86_64", "Installed: libXtst-1.2.3-7.el8.x86_64"]}
changed: [10.11.12.13] => (item=xterm) => {"ansible_loop_var": "item", "changed": true, "item": "xterm", "msg": "", "rc": 0, "results": ["Installed: pkgconf-1.4.2-1.el8.x86_64", "Installed: pkgconf-m4-1.4.2-1.el8.noarch", "Installed: pkgconf-pkg-config-1.4.2-1.el8.x86_64", "Installed: libfontenc-1.1.3-8.el8.x86_64", "Installed: xorg-x11-fonts-misc-7.5-19.el8.noarch", "Installed: libXpm-3.5.12-9.el8_7.x86_64", "Installed: libXft-2.3.3-1.el8.x86_64", "Installed: xorg-x11-font-utils-1:7.5-41.el8.x86_64", "Installed: libXaw-1.0.13-10.el8.x86_64", "Installed: libpkgconf-1.4.2-1.el8.x86_64", "Installed: xterm-331-1.el8_3.2.x86_64", "Installed: xterm-resize-331-1.el8_3.2.x86_64"]}
changed: [10.11.12.13] => (item=net-tools) => {"ansible_loop_var": "item", "changed": true, "item": "net-tools", "msg": "", "rc": 0, "results": ["Installed: net-tools-2.0-0.52.20160912git.el8.x86_64"]}

There should instead be a single "changed" line.

AWSmith0216 avatar Aug 14 '23 14:08 AWSmith0216

Thank you @AWSmith0216 for your interest in this project and the time you took to submit this enhancement request. Unfortunately, we are not able to consider enhancement requests for this project at this time.
We are able to consider contributions from the user community. If you are interested and able, please submit a pull request covering your suggested enhancement. Pull requests should target the develop branch.

kevinlinglesas avatar Aug 14 '23 18:08 kevinlinglesas