Hi friends hope you're being well.
I got this very basic task i need to accomplish via ansible but i'm stuck with variable resiter :
i need to collect some packages version with ansible and display the output as :
host has 'this software : version'
here is the play:
---
- name: Collect All Package Versions
hosts: all
become: yes
tasks:
- name: Update APT package cache
apt:
update_cache: yes
become: yes
- name: Collect Package Versions
shell: dpkg-query -f '${binary:Package}\t${Version}\n' -W "{{ item }}"
with_items:
- firefox
- libwebp6
- thunderbird
register: package_versions
- name: Display Package Versions
debug:
var: package_versions.stdout_lines
When i execute it i got this message:
"package_versions.stdout_lines": "VARIABLE IS NOT DEFINED!"
I know there is a problem with variable registration but i need a little hint.
Thank you ;)