There is not error. It runs but doesn't remove the "!".
---
>
> - name: show version and other user level commands
>
> hosts: IOL_Routers
>
> gather_facts: false
>
> connection: network_cli
>
> become: yes
>
>
> tasks:
>
> - name: run multiple commands on remote nodes
>
> ios_command:
>
> commands:
>
> - show run
>
>
> register: print_output
>
>
> - name: result of running commands above
>
> debug: msg="{{ print_output.stdout_lines | reject('equalto', '^!')
> | list }}"
>
bnapwks120:ansible stevenwiliams$ ansible-playbook showrunrv1.yml -u cisco
-k
SSH password:
PLAY [show version and other user level commands]
***********************************************************************************************************
TASK [run multiple commands on remote nodes]
****************************************************************************************************************
ok: [R02]
ok: [R04]
ok: [R01]
ok: [R03]
TASK [result of running commands above]
*********************************************************************************************************************
ok: [R02] => {
"msg": [
[
"Building configuration...",
"",
"Current configuration : 1075 bytes",
"!",
"! Last configuration change at 18:03:17 EET Thu Aug 22 2019 by
cisco",
"!",
"version 15.4",
"service timestamps debug datetime msec",
"service timestamps log datetime msec",
"no service password-encryption",
"!",
"hostname R02",
"!",
"boot-start-marker",
"boot-end-marker",
"!",
"aqm-register-fnf",
"!",
"!",
"no aaa new-model",
"clock timezone EET 2 0",
"mmi polling-interval 60",
"no mmi auto-configure",
"no mmi pvc",
"mmi snmp-timeout 180",
"!",
"!",
"!",
"!",
"!",
"!",
"",
"",
"!",
"!",
"!",
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/084946a5-538a-4f73-b66c-e69229dda22e%40googlegroups.com.