Below ansible tasks display pip packages in dictionary format.
- name: Ganther pip packages
pip_package_info:
clients: pip3
register: pip_pkgs
And the output is:
{
"packages": {
pip3: {
"xxx": [
{
name: "xxx"
source: "pip3"
version: "1.0.0"
}
],
"yyy": [
{
name: "yyy"
source: "pip3"
version: "2.0.0"
}
]
}
}
}
I tried to loop through the registered variable, but, I am getting errors about undefined variable. How to get the name and version from the above dictionary?