I wrote this task
- name: Enabling the repoistory
shell: subscription-manager repos --enable={{ item }}
register: _repostatus
loop: "{{ repo_id }}"
- debug:
msg: "{{ item.stdout }}"
loop: "{{ _repostatus.stdout_lines }}"
And it print all the variables which i dont need to see
_repostatus:
changed: true
msg: All items completed
results:
- ansible_loop_var: item
changed: true
cmd: subscription-manager repos --enable=rhel-7-server-extras-rpms
delta: '0:00:04.035395'
end: '2024-02-19 10:43:14.323637'
failed: false
invocation:
module_args:
_raw_params: subscription-manager repos --enable=rhel-7-server-extras-rpms
_uses_shell: true
argv: null
chdir: null
creates: null
executable: null
removes: null
stdin: null
stdin_add_newline: true
strip_empty_ends: true
warn: false
item: rhel-7-server-extras-rpms
rc: 0
start: '2024-02-19 10:43:10.288242'
stderr: ''
stderr_lines: []
stdout: Repository 'rhel-7-server-extras-rpms' is enabled for this system.
stdout_lines:
- Repository 'rhel-7-server-extras-rpms' is enabled for this system.
I only want to see "stdout_lines:" and its content. Normally if it is not a loop then everything is ok but there is results key in out and i dont know how to printout _repostatus.stdout_lines.
It gives this error
msg: '''dict object'' has no attribute ''stdout_lines'''
Tried to search for solution but didnt find exactly what i am looking for