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

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

Open
AWSmith0216 opened this issue Aug 14, 2023 · 1 comment

Comments

@AWSmith0216
Copy link

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 ansible/ansible#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.

@kevinlinglesas
Copy link
Collaborator

kevinlinglesas commented Aug 14, 2023

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.

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

2 participants