Ansible-Playbook to display output of multiple show commands (using stdout_lines with Loop)
In this playbook, we we'll see how we can get display of multiple show commands in stdout_lines format. We can make use of loops (or with_items) for submitting multiple commands, but debug output with stdout_lines does not gives the formatted result as it would give for single command. So in case of multiple commands, we can debug the output of each command separately in stdout_lines format. #Ansible-Playbook to display Output of multiple show commands - name: Display Output of multiple show commands hosts: all gather_facts: no connection: network_cli become: no become_method: enable tasks: - name: Get the config cli_command: command: "{{ item }}" register: result with_items: - show ip access-lists TestACL-1 | include 150 - show ip access-lists TestACL-2 | include 250 ...