Re:Replacing Ansible with salt-ssh
by Spivak on Thursday October 22, 2020 @12:50PM
(#24860112)
That’s not right either. It’s super wasteful since newer versions of Ansible don’t magic loops into a single call to your package manager anymore. You have to pass the list as a single item.
[ Parent
| on HN ]
Agreed, great callout for the example use case, my point was simply using the items list which could even be used for something like shell or win_shell
Note that it was possible to install multiple packages in one call by passing the whole list to yum/apt. This was undocumented but happened to work.
You just had to supply the list as space separated. i.e.
package: {{ packages|join(' ') }}
or similar
Re:Replacing Ansible with salt-ssh
by deeblering4 on Thursday October 22, 2020 @01:54PM
(#24860967)
Is this the case too with other resources, like users? I noticed that those loops can become pretty time consuming as the user list gets larger.
Re:Replacing Ansible with salt-ssh
by geerlingguy on Thursday October 22, 2020 @01:59PM
(#24861052)
It depends on the module; the user module works on one entity at a time, so you have to loop at the task level, which does take a little longer that trying to pass through a batch of user data at once.