Usually I tend to see this when the apt cache isn’t current. I am sure there are other reasons as well, but more than 80% of the time for me, that usually fixes my issue.
Anyone knows why is apt behaving differently here? I have this var
I don't think this is related to the apt module, but to how the
variable ends up being loaded. It seems to end up as a string, but not
as a sting in JSON format (which would be converted to a list), but in
Python format.
Without knowing how exactly you end up with the variable in this format.
(Also please note that both Ansible 2.4.x and 2.5.x are completely
outdated and End of Line.)
Of course it has everything to do with the module, what else? The 2.4.4 does the correct thing and takes the list as it is: a list. The module documentation also says it needs to be a list.
However, 2.5+ takes that list as a string for some reason and wraps it in a list ending in that silly state of a list inside a list. That can’t be right.