Hello - I attached the output of debug when i used {{ item }}. That is show ip interface brief {{ item }}. I am trying to capture the IP address in the output and reuse it in the script.Â
TASK [debug] ***************************************************************************************************************
ok: [labrtr2] => {
  "var_ip_addr_0": {
    "changed": false,Â
    "msg": "All items completed",Â
    "results": [
      {
        "_ansible_ignore_errors": null,Â
        "_ansible_item_label": "gigabitEthernet0/0/0",Â
        "_ansible_item_result": true,Â
        "_ansible_no_log": false,Â
        "_ansible_parsed": true,Â
        "changed": false,Â
        "failed": false,Â
        "invocation": {
          "module_args": {
            "auth_pass": null,Â
            "authorize": null,Â
            "commands": [
              "show ip interface brief gigabitEthernet0/0/0"
            ],Â
            "host": null,Â
            "interval": 1,Â
            "match": "all",Â
            "password": null,Â
            "port": null,Â
            "provider": {
              "auth_pass": null,Â
              "authorize": null,Â
              "host": null,Â
              "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",Â
              "port": null,Â
              "ssh_keyfile": null,Â
              "timeout": null,Â
              "username": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER"
            },Â
            "retries": 10,Â
            "ssh_keyfile": null,Â
            "timeout": null,Â
            "username": null,Â
            "wait_for": null
          }
        },Â
        "item": "gigabitEthernet0/0/0",Â
        "stdout": [
          "Interface       IP-Address   OK? Method Status        Protocol\nGigabitEthernet0/0/0 Â
42.151.182.42  YES DHCP  up          up"
        ],Â
        "stdout_lines": [
          [
            "Interface       IP-Address   OK? Method Status        Protocol",Â
            "GigabitEthernet0/0/0  42.151.182.42  YES DHCP  up          up"
          ]
        ]
      }
    ]
  }
}