Ansible 네트워크 자동화 – 6

Ansible 네트워크 자동화 – 6

앤시블을 이용한 익스트림 스위치 점검하기

익스트림 스위치의 팬, 온도, 파워서플라이 점검을 위해 playbook 작성한다. 임의의 명령을 실행하기 위해서 exos_command 모듈을 사용한다.

만약, extreme 스위치 지원을 위한 모듈이 없으면, ansible-galaxy 명령으로 컬렉션을 설치한다.

$ ansible-galaxy collection install extreme.exos

플레이북을 아래처럼 작성했다.

---
- name: Extreme Switch Check Playbook
  connection: ansible.netcommon.network_cli
  gather_facts: false
  hosts: all

  tasks:
    - name: Check Extreme switches...
      exos_command:
        commands:
          - show fan
            #- show temp
            #- show power
      register: result

    - name: output
      debug:
        var: result.stdout_lines[0]

아래는 작성한 인벤토리 파일의 일부이다.

$ cat inventory.yml
---
wifi_l3:
  hosts:
    WIFI_Backbone:
      ansible_host: 192.168.245.62
  vars:
    ansible_network_os: extreme.exos.exos
    ansible_user: admin
    ansible_password: !vault |
          $ANSIBLE_VAULT;1.2;AES256;admin
          65313661663130383939613338633237313230386365653739383831653364343634333230366130
          3334666636373466626661653634373032666139393462310a383233303037316162366565363936
          37366331366566633030373364623663633836653431316561656166353531636133323938363233
          3464373339303739370a306362363030366635373063376231613731303830353736313463306337
          3462

wifi_l2:
  hosts:
    w_l2_1:
      ansible_host: 192.168.245.1
    w_l2_2:
      ansible_host: 192.168.245.2
...

    w_l2_37:
      ansible_host: 165.132.245.37
  vars:
    ansible_network_os: extreme.exos.exos
    ansible_user: admin
    ansible_password: !vault |
          $ANSIBLE_VAULT;1.2;AES256;wadmin
          65313661663130383939613338633237313230386365653739383831653364343634333230366130
          3334666636373466626661653634373032666139393462310a383233303037316162366565363936
          37366331366566633030373364623663633836653431316561656166353531636133323938363233
          3464373339303739370a306362363030366635373063376231613731303830353736313463306337
          3462

플레이북 실행했더니 아래처럼 오류가 발생했다.

$ ansible-playbook book-check.yml -i inventory.yml -l wifi_l3  --vault-id admin@vault-pw.txt

PLAY [Extreme Switch Check Playbook] ***************************************************************************

TASK [Check Extreme switches...] *******************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ansible.module_utils.connection.ConnectionError: [Errno -3] Temporary failure in name resolution
fatal: [WIFI_Backbone]: FAILED! => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python3"}, "changed": false, "module_stderr": "Traceback (most recent call last):\n  File \"/home/snowfox/.ansible/tmp/ansible-local-1910xnwo29tt/ansible-tmp-1617855926.5648549-210651342340014/AnsiballZ_exos_command.py\", line 102, in <module>\n    _ansiballz_main()\n  File \"/home/snowfox/.ansible/tmp/ansible-local-1910xnwo29tt/ansible-tmp-1617855926.5648549-210651342340014/AnsiballZ_exos_command.py\", line 94, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/home/snowfox/.ansible/tmp/ansible-local-1910xnwo29tt/ansible-tmp-1617855926.5648549-210651342340014/AnsiballZ_exos_command.py\", line 40, in invoke_module\n    runpy.run_module(mod_name='ansible.modules.network.exos.exos_command', init_globals=None, run_name='__main__', alter_sys=True)\n  File \"/usr/lib/python3.8/runpy.py\", line 207, in run_module\n    return _run_module_code(code, init_globals, run_name, mod_spec)\n  File \"/usr/lib/python3.8/runpy.py\", line 97, in _run_module_code\n    _run_code(code, mod_globals, init_globals,\n  File \"/usr/lib/python3.8/runpy.py\", line 87, in _run_code\n    exec(code, run_globals)\n  File \"/tmp/ansible_exos_command_payload_s_w7l8j4/ansible_exos_command_payload.zip/ansible/modules/network/exos/exos_command.py\", line 221, in <module>\n  File \"/tmp/ansible_exos_command_payload_s_w7l8j4/ansible_exos_command_payload.zip/ansible/modules/network/exos/exos_command.py\", line 191, in main\n  File \"/tmp/ansible_exos_command_payload_s_w7l8j4/ansible_exos_command_payload.zip/ansible/module_utils/network/exos/exos.py\", line 187, in run_commands\n  File \"/tmp/ansible_exos_command_payload_s_w7l8j4/ansible_exos_command_payload.zip/ansible/module_utils/network/exos/exos.py\", line 164, in get_connection\n  File \"/tmp/ansible_exos_command_payload_s_w7l8j4/ansible_exos_command_payload.zip/ansible/module_utils/connection.py\", line 185, in __rpc__\nansible.module_utils.connection.ConnectionError: [Errno -3] Temporary failure in name resolution\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}

PLAY RECAP *****************************************************************************************************
WIFI_Backbone              : ok=0    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0

플레이북의 connection 부분에서 오류가 발생한 것으로 생각되어, connection 부분을 주석처리했다.

  # connection: ansible.netcommon.network_cli

다시 플레이북 실행하면 아래처럼 sshpass 프로그램을 설치하라는 메시지 보임.

$ ansible-playbook book-check.yml -i inventory.yml -l wifi_l3  --vault-id admin@vault-pw.txt

PLAY [Extreme Switch Check Playbook] ***************************************************************************

TASK [Check Extreme switches...] *******************************************************************************
fatal: [WIFI_Backbone]: FAILED! => {"msg": "to use the 'ssh' connection type with passwords, you must install the sshpass program"}

PLAY RECAP *****************************************************************************************************
WIFI_Backbone              : ok=0    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0

sshpass 패키지를 설치한다.

$ sudo apt install sshpass

플레이북의 connection 부분의 주석을 제거한다. 이제, 최종 버전의 플레이북은 아래와 같다.

$ cat book-check.yml
---

- name: Extreme Switch Check Playbook
  connection: ansible.netcommon.network_cli
  gather_facts: false
  hosts: all

  tasks:
    - name: Check Extreme switches...
      exos_command:
        commands:
          - show fan
          - show temp
          - show power
      register: result

    - name: output
      debug:
        var: result.stdout_lines

이제, 플레이북을 실행하면 아래처럼 원하는 결과를 볼 수 있다.

$ ansible-playbook book-check.yml -i inventory.yml -l WIFI_Backbone  --vault-id admin@vault-pw.txt

PLAY [Extreme Switch Check Playbook] ***************************************************************************

TASK [Check Extreme switches...] *******************************************************************************
ok: [WIFI_Backbone]

TASK [output] **************************************************************************************************
ok: [WIFI_Backbone] => {
    "result.stdout_lines": [
        [
            "FanTray information:",
            " State:                  Operational",
            " NumFan:                 6",
            " PartInfo:               1126G-00738 450307-00-03",
            " Revision:               3.0",
            " Odometer:               3107 days 21 hours 30 minutes  since Jun-24-2011",
            " Upper-Left   Fan-1:     Operational at 3060 RPM",
            " Lower-Left   Fan-2:     Operational at 3060 RPM",
            " Upper-Center Fan-3:     Operational at 3000 RPM",
            " Lower-Center Fan-4:     Operational at 3000 RPM",
            " Upper-Right  Fan-5:     Operational at 3000 RPM",
            " Lower-Right  Fan-6:     Operational at 3060 RPM"
        ],
        [
            "Field Replaceable Units               Temp (C)   Status   Min  Normal   Max",
            "---------------------------------------------------------------------------",
            "Slot-1         : G24Xc                  26.50    Normal   -10    0-50  60",
            "Slot-2         : G24Xc                  25.50    Normal   -10    0-50  60",
            "Slot-3         : ",
            "Slot-4         : ",
            "Slot-5         : 10G8Xc                 30.50    Normal   -10    0-50  60",
            "Slot-6         : G48Tc                  28.00    Normal   -10    0-50  60",
            "MSM-A          : MSM-48c                38.00    Normal   -10    0-50  60",
            "MSM-B          : MSM-48c                38.00    Normal   -10    0-50  60",
            "PSUCTRL-1      :                        32.06    Normal   -10    0-50  60",
            "PSUCTRL-1      : ",
            "PSUCTRL-2      :                        33.92    Normal   -10    0-50  60",
            "PSUCTRL-2      :"
        ],
        [
            "PowerSupply 1 information:",
            " State             : Powered On",
            " PartInfo          : PS 2431 1130J-02193 4300-00161",
            " Revision          : 5.0",
            " Odometer          : 3133 days 19 hours 30 minutes ",
            " Temperature       : 31.0 deg C",
            " Fan 1             : 6473 RPM",
            " Fan 2             : 6473 RPM",
            " Input             : 232.00 V AC",
            "",
            "PowerSupply 2 information:",
            " State             : Powered On",
            " PartInfo          : PS 2431 1124J-02096 4300-00161",
            " Revision          : 5.0",
            " Odometer          : 3144 days 13 hours 30 minutes ",
            " Temperature       : 33.0 deg C",
            " Fan 1             : 6732 RPM",
            " Fan 2             : 6473 RPM",
            " Input             : 232.00 V AC",
            "",
            "PowerSupply 3 information:",
            " State             : Empty",
            "",
            "PowerSupply 4 information:",
            " State             : Powered On",
            " PartInfo          : PS 2431 1124J-02058 4300-00161",
            " Revision          : 5.0",
            " Odometer          : 3144 days 13 hours 30 minutes ",
            " Temperature       : 33.0 deg C",
            " Fan 1             : 6233 RPM",
            " Fan 2             : 6233 RPM",
            " Input             : 232.00 V AC",
            "",
            "PowerSupply 5 information:",
            " State             : Empty",
            "",
            "PowerSupply 6 information:",
            " State             : Empty",
            " Poll Interval     : 60 s",
            " Change Threshold  : N/A",
            " Change Action     : N/A"
        ]
    ]
}

PLAY RECAP *****************************************************************************************************
WIFI_Backbone              : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0

플레이북 실행시 아래와 같은 오류가 발생한다면,

$ ansible-playbook book-check.yml -i inventory.yml -l w_l2_4  --vault-id admin@vault-pw.txt

PLAY [Extreme Switch Check Playbook] ***************************************************************************

TASK [Check Extreme switches...] *******************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: The ssh-rsa key fingerprint is b'05cdc22ae2e047d00f80df36bac04848'.
fatal: [w_l2_4]: FAILED! => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python3"}, "changed": false, "module_stderr": "Traceback (most recent call last):\n  File \"/home/snowfox/.ansible/tmp/ansible-local-4405xkf_p4bb/ansible-tmp-1617868410.5432293-83755622591598/AnsiballZ_exos_command.py\", line 102, in <module>\n    _ansiballz_main()\n  File \"/home/snowfox/.ansible/tmp/ansible-local-4405xkf_p4bb/ansible-tmp-1617868410.5432293-83755622591598/AnsiballZ_exos_command.py\", line 94, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/home/snowfox/.ansible/tmp/ansible-local-4405xkf_p4bb/ansible-tmp-1617868410.5432293-83755622591598/AnsiballZ_exos_command.py\", line 40, in invoke_module\n    runpy.run_module(mod_name='ansible.modules.network.exos.exos_command', init_globals=None, run_name='__main__', alter_sys=True)\n  File \"/usr/lib/python3.8/runpy.py\", line 207, in run_module\n    return _run_module_code(code, init_globals, run_name, mod_spec)\n  File \"/usr/lib/python3.8/runpy.py\", line 97, in _run_module_code\n    _run_code(code, mod_globals, init_globals,\n  File \"/usr/lib/python3.8/runpy.py\", line 87, in _run_code\n    exec(code, run_globals)\n  File \"/tmp/ansible_exos_command_payload_zvf8yvaj/ansible_exos_command_payload.zip/ansible/modules/network/exos/exos_command.py\", line 221, in <module>\n  File \"/tmp/ansible_exos_command_payload_zvf8yvaj/ansible_exos_command_payload.zip/ansible/modules/network/exos/exos_command.py\", line 191, in main\n  File \"/tmp/ansible_exos_command_payload_zvf8yvaj/ansible_exos_command_payload.zip/ansible/module_utils/network/exos/exos.py\", line 187, in run_commands\n  File \"/tmp/ansible_exos_command_payload_zvf8yvaj/ansible_exos_command_payload.zip/ansible/module_utils/network/exos/exos.py\", line 164, in get_connection\n  File \"/tmp/ansible_exos_command_payload_zvf8yvaj/ansible_exos_command_payload.zip/ansible/module_utils/connection.py\", line 185, in __rpc__\nansible.module_utils.connection.ConnectionError: paramiko: The authenticity of host '192.168.245.4' can't be established.\nThe ssh-rsa key fingerprint is b'05cdc22ae2e047d00f80df36bac04848'.\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}

PLAY RECAP *****************************************************************************************************
w_l2_4                     : ok=0    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0

위의 에러는 ssh 접속을 한번도 하지 않아 발생함. 쉘에서 ssh 접속 작업을 해주면 오류가 발생하지 않는다.

$ ssh admin@192.168.245.4
The authenticity of host '192.168.245.4 (192.168.245.4)' can't be established.
RSA key fingerprint is SHA256:n85V8oxBp1zoRKVuET2AwjzHzrIDIb1d7gSMOE53Ccs.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '192.168.245.4' (RSA) to the list of known hosts.

이렇게 접속해보고 다시 시도하면 잘 된다.

$ ansible-playbook book-check.yml -i inventory.yml -l w_l2_4  --vault-id admin@vault-pw.txt

PLAY [Extreme Switch Check Playbook] ***************************************************************************

TASK [Check Extreme switches...] *******************************************************************************
ok: [w_l2_4]

TASK [output] **************************************************************************************************
ok: [w_l2_4] => {
    "result.stdout_lines": [
        [
            "FanTray information:",
            " State:                  Operational",
            " NumFan:                 4",
            " Fan-1:                  Operational at 11000 RPM",
            " Fan-2:                  Operational at 11000 RPM",
            " Fan-3:                  Operational at 11000 RPM",
            " Fan-4:                  Operational at 11000 RPM"
        ],
        [
            "Field Replaceable Units               Temp (C)   Status   Min  Normal   Max",
            "---------------------------------------------------------------------------",
            "Switch         : X440-24p               25.00    Normal   -10    0-48  55"
        ],
        [
            "PowerSupply 1 information:",
            " State             : Powered On",
            " PartInfo          : Internal Power Supply  ",
            "",
            "PowerSupply 2 information:",
            " State             : Empty",
            " Poll Interval     : 60 s",
            " Change Threshold  : N/A",
            " Change Action     : N/A"
        ]
    ]
}

PLAY RECAP *****************************************************************************************************
w_l2_4                     : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0

인벤토리에 등록된 wifi_l2 그룹의 모든 장비를 점검하기위해 플레이북을 실행한다.

$ ansible-playbook book-check.yml -i inventory.yml -l wifi_l2  --vault-id admin@vault-pw.txt

PLAY [Extreme Switch Check Playbook] ***************************************************************************

TASK [Check Extreme switches...] *******************************************************************************
ok: [w_l2_1]
ok: [w_l2_2]
ok: [w_l2_4]
ok: [w_l2_3]
ok: [w_l2_5]
ok: [w_l2_7]
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ansible.module_utils.connection.ConnectionError: [Errno None] Unable to connect to port 22 on 192.168.245.8
fatal: [w_l2_8]: FAILED! => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python3"}, "changed": false, "module_stderr": "Traceback (most recent call last):\n  File \"/home/snowfox/.ansible/tmp/ansible-local-4548l9gf2u0w/ansible-tmp-1617869098.102443-185559981947035/AnsiballZ_exos_command.py\", line 102, in <module>\n    _ansiballz_main()\n  File \"/home/snowfox/.ansible/tmp/ansible-local-4548l9gf2u0w/ansible-tmp-1617869098.102443-185559981947035/AnsiballZ_exos_command.py\", line 94, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/home/snowfox/.ansible/tmp/ansible-local-4548l9gf2u0w/ansible-tmp-1617869098.102443-185559981947035/AnsiballZ_exos_command.py\", line 40, in invoke_module\n    runpy.run_module(mod_name='ansible.modules.network.exos.exos_command', init_globals=None, run_name='__main__', alter_sys=True)\n  File \"/usr/lib/python3.8/runpy.py\", line 207, in run_module\n    return _run_module_code(code, init_globals, run_name, mod_spec)\n  File \"/usr/lib/python3.8/runpy.py\", line 97, in _run_module_code\n    _run_code(code, mod_globals, init_globals,\n  File \"/usr/lib/python3.8/runpy.py\", line 87, in _run_code\n    exec(code, run_globals)\n  File \"/tmp/ansible_exos_command_payload_obhmicmj/ansible_exos_command_payload.zip/ansible/modules/network/exos/exos_command.py\", line 221, in <module>\n  File \"/tmp/ansible_exos_command_payload_obhmicmj/ansible_exos_command_payload.zip/ansible/modules/network/exos/exos_command.py\", line 191, in main\n  File \"/tmp/ansible_exos_command_payload_obhmicmj/ansible_exos_command_payload.zip/ansible/module_utils/network/exos/exos.py\", line 187, in run_commands\n  File \"/tmp/ansible_exos_command_payload_obhmicmj/ansible_exos_command_payload.zip/ansible/module_utils/network/exos/exos.py\", line 164, in get_connection\n  File \"/tmp/ansible_exos_command_payload_obhmicmj/ansible_exos_command_payload.zip/ansible/module_utils/connection.py\", line 185, in __rpc__\nansible.module_utils.connection.ConnectionError: [Errno None] Unable to connect to port 22 on 192.168.245.8\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
ok: [w_l2_9]
ok: [w_l2_10]
ok: [w_l2_11]
ok: [w_l2_12]
ok: [w_l2_13]
ok: [w_l2_14]
ok: [w_l2_15]
ok: [w_l2_16]
ok: [w_l2_17]
ok: [w_l2_18]
ok: [w_l2_19]
ok: [w_l2_21]
ok: [w_l2_20]
ok: [w_l2_24]
ok: [w_l2_22]
ok: [w_l2_23]
ok: [w_l2_26]
ok: [w_l2_25]
ok: [w_l2_27]
ok: [w_l2_29]
ok: [w_l2_30]
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: The ssh-rsa key fingerprint is b'103683633be7b3188de49779cbb99a71'.
fatal: [w_l2_32]: FAILED! => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python3"}, "changed": false, "module_stderr": "Traceback (most recent call last):\n  File \"/home/snowfox/.ansible/tmp/ansible-local-4548l9gf2u0w/ansible-tmp-1617869144.9660954-54392215703597/AnsiballZ_exos_command.py\", line 102, in <module>\n    _ansiballz_main()\n  File \"/home/snowfox/.ansible/tmp/ansible-local-4548l9gf2u0w/ansible-tmp-1617869144.9660954-54392215703597/AnsiballZ_exos_command.py\", line 94, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/home/snowfox/.ansible/tmp/ansible-local-4548l9gf2u0w/ansible-tmp-1617869144.9660954-54392215703597/AnsiballZ_exos_command.py\", line 40, in invoke_module\n    runpy.run_module(mod_name='ansible.modules.network.exos.exos_command', init_globals=None, run_name='__main__', alter_sys=True)\n  File \"/usr/lib/python3.8/runpy.py\", line 207, in run_module\n    return _run_module_code(code, init_globals, run_name, mod_spec)\n  File \"/usr/lib/python3.8/runpy.py\", line 97, in _run_module_code\n    _run_code(code, mod_globals, init_globals,\n  File \"/usr/lib/python3.8/runpy.py\", line 87, in _run_code\n    exec(code, run_globals)\n  File \"/tmp/ansible_exos_command_payload_z_fis9mj/ansible_exos_command_payload.zip/ansible/modules/network/exos/exos_command.py\", line 221, in <module>\n  File \"/tmp/ansible_exos_command_payload_z_fis9mj/ansible_exos_command_payload.zip/ansible/modules/network/exos/exos_command.py\", line 191, in main\n  File \"/tmp/ansible_exos_command_payload_z_fis9mj/ansible_exos_command_payload.zip/ansible/module_utils/network/exos/exos.py\", line 187, in run_commands\n  File \"/tmp/ansible_exos_command_payload_z_fis9mj/ansible_exos_command_payload.zip/ansible/module_utils/network/exos/exos.py\", line 164, in get_connection\n  File \"/tmp/ansible_exos_command_payload_z_fis9mj/ansible_exos_command_payload.zip/ansible/module_utils/connection.py\", line 185, in __rpc__\nansible.module_utils.connection.ConnectionError: paramiko: The authenticity of host '192.168.245.32' can't be established.\nThe ssh-rsa key fingerprint is b'103683633be7b3188de49779cbb99a71'.\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
ok: [w_l2_31]
ok: [w_l2_33]
ok: [w_l2_34]
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: The ssh-rsa key fingerprint is b'811c7430fec13ec93948d32c238973ee'.
fatal: [w_l2_35]: FAILED! => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python3"}, "changed": false, "module_stderr": "Traceback (most recent call last):\n  File \"/home/snowfox/.ansible/tmp/ansible-local-4548l9gf2u0w/ansible-tmp-1617869151.2843916-116017751998271/AnsiballZ_exos_command.py\", line 102, in <module>\n    _ansiballz_main()\n  File \"/home/snowfox/.ansible/tmp/ansible-local-4548l9gf2u0w/ansible-tmp-1617869151.2843916-116017751998271/AnsiballZ_exos_command.py\", line 94, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/home/snowfox/.ansible/tmp/ansible-local-4548l9gf2u0w/ansible-tmp-1617869151.2843916-116017751998271/AnsiballZ_exos_command.py\", line 40, in invoke_module\n    runpy.run_module(mod_name='ansible.modules.network.exos.exos_command', init_globals=None, run_name='__main__', alter_sys=True)\n  File \"/usr/lib/python3.8/runpy.py\", line 207, in run_module\n    return _run_module_code(code, init_globals, run_name, mod_spec)\n  File \"/usr/lib/python3.8/runpy.py\", line 97, in _run_module_code\n    _run_code(code, mod_globals, init_globals,\n  File \"/usr/lib/python3.8/runpy.py\", line 87, in _run_code\n    exec(code, run_globals)\n  File \"/tmp/ansible_exos_command_payload_x5fymbpx/ansible_exos_command_payload.zip/ansible/modules/network/exos/exos_command.py\", line 221, in <module>\n  File \"/tmp/ansible_exos_command_payload_x5fymbpx/ansible_exos_command_payload.zip/ansible/modules/network/exos/exos_command.py\", line 191, in main\n  File \"/tmp/ansible_exos_command_payload_x5fymbpx/ansible_exos_command_payload.zip/ansible/module_utils/network/exos/exos.py\", line 187, in run_commands\n  File \"/tmp/ansible_exos_command_payload_x5fymbpx/ansible_exos_command_payload.zip/ansible/module_utils/network/exos/exos.py\", line 164, in get_connection\n  File \"/tmp/ansible_exos_command_payload_x5fymbpx/ansible_exos_command_payload.zip/ansible/module_utils/connection.py\", line 185, in __rpc__\nansible.module_utils.connection.ConnectionError: paramiko: The authenticity of host '192.168.245.35' can't be established.\nThe ssh-rsa key fingerprint is b'811c7430fec13ec93948d32c238973ee'.\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
ok: [w_l2_36]
ok: [w_l2_37]

TASK [output] **************************************************************************************************
ok: [w_l2_4] => {
    "result.stdout_lines": [
        [
            "FanTray information:",
            " State:                  Operational",
            " NumFan:                 4",
            " Fan-1:                  Operational at 11000 RPM",
            " Fan-2:                  Operational at 11000 RPM",
            " Fan-3:                  Operational at 11000 RPM",
            " Fan-4:                  Operational at 11000 RPM"
        ],
        [
            "Field Replaceable Units               Temp (C)   Status   Min  Normal   Max",
            "---------------------------------------------------------------------------",
            "Switch         : X440-24p               24.50    Normal   -10    0-48  55"
        ],
        [
            "PowerSupply 1 information:",
            " State             : Powered On",
            " PartInfo          : Internal Power Supply  ",
            "",
            "PowerSupply 2 information:",
            " State             : Empty",
            " Poll Interval     : 60 s",
            " Change Threshold  : N/A",
            " Change Action     : N/A"
        ]
    ]
}
ok: [w_l2_2] => {
    "result.stdout_lines": [
        [
            "FanTray information:",
            " State:                  Operational",
            " NumFan:                 4",
            " Fan-1:                  Operational at 11000 RPM",
            " Fan-2:                  Operational at 11000 RPM",
            " Fan-3:                  Operational at 11000 RPM",
            " Fan-4:                  Operational at 11000 RPM"
        ],
        [
            "Field Replaceable Units               Temp (C)   Status   Min  Normal   Max",
            "---------------------------------------------------------------------------",
            "Switch         : X440-24p               22.50    Normal   -10    0-48  55"
        ],
        [
            "PowerSupply 1 information:",
            " State             : Powered On",
            " PartInfo          : Internal Power Supply  ",
            "",
            "PowerSupply 2 information:",
            " State             : Empty",
            " Poll Interval     : 60 s",
            " Change Threshold  : N/A",
            " Change Action     : N/A"
        ]
    ]
}
ok: [w_l2_1] => {
    "result.stdout_lines": [
        [
            "FanTray information:",
            " State:                  Operational",
            " NumFan:                 4",
            " Fan-1:                  Operational at 11000 RPM",
            " Fan-2:                  Operational at 11000 RPM",
            " Fan-3:                  Operational at 11000 RPM",
            " Fan-4:                  Operational at 11000 RPM"
        ],
        [
            "Field Replaceable Units               Temp (C)   Status   Min  Normal   Max",
            "---------------------------------------------------------------------------",
            "Switch         : X440-24p               26.50    Normal   -10    0-48  55"
        ],
        [
            "PowerSupply 1 information:",
            " State             : Powered On",
            " PartInfo          : Internal Power Supply  ",
            "",
            "PowerSupply 2 information:",
            " State             : Empty",
            " Poll Interval     : 60 s",
            " Change Threshold  : N/A",
            " Change Action     : N/A"
        ]
    ]
}
ok: [w_l2_3] => {
    "result.stdout_lines": [
        [
            "FanTray information:",
            " State:                  Operational",
            " NumFan:                 4",
            " Fan-1:                  Operational at 11000 RPM",
            " Fan-2:                  Operational at 11000 RPM",
            " Fan-3:                  Operational at 11000 RPM",
            " Fan-4:                  Operational at 11000 RPM"
        ],
        [
            "Field Replaceable Units               Temp (C)   Status   Min  Normal   Max",
            "---------------------------------------------------------------------------",
            "Switch         : X440-24p               25.00    Normal   -10    0-48  55"
        ],
        [
            "PowerSupply 1 information:",
            " State             : Powered On",
            " PartInfo          : Internal Power Supply  ",
            "",
            "PowerSupply 2 information:",
            " State             : Empty",
            " Poll Interval     : 60 s",
            " Change Threshold  : N/A",
            " Change Action     : N/A"
        ]
    ]
}
ok: [w_l2_5] => {
    "result.stdout_lines": [
        [
            "FanTray-1 information:",
            " State:                  Operational",
            " NumFan:                 4",
            " Fan-1:                  Operational at 11000 RPM",
            " Fan-2:                  Operational at 11000 RPM",
            " Fan-3:                  Operational at 11000 RPM",
            " Fan-4:                  Operational at 11000 RPM",
            "",
            "FanTray-2 information:",
            " State:                  Operational",
            " NumFan:                 4",
            " Fan-1:                  Operational at 11000 RPM",
            " Fan-2:                  Operational at 11000 RPM",
            " Fan-3:                  Operational at 11000 RPM",
            " Fan-4:                  Operational at 11000 RPM",
            "",
            "FanTray-3 information:",
            " State:                  Empty",
            "",
            "FanTray-4 information:",
            " State:                  Empty",
            "",
            "FanTray-5 information:",
            " State:                  Empty",
            "",
            "FanTray-6 information:",
            " State:                  Empty",
            "",
            "FanTray-7 information:",
            " State:                  Empty",
            "",
            "FanTray-8 information:",
            " State:                  Empty"
        ],
        [
            "Field Replaceable Units               Temp (C)   Status   Min  Normal   Max",
            "---------------------------------------------------------------------------",
            "Slot-1         : X440-24p               26.50    Normal   -10    0-48  55",
            "Slot-2         : X440-24p               26.50    Normal   -10    0-48  55",
            "Slot-3         : ",
            "Slot-4         : ",
            "Slot-5         : ",
            "Slot-6         : ",
            "Slot-7         : ",
            "Slot-8         :"
        ],
        [
            "PSU-1 or  PSU-2 or",
            "                     Internal  External  External  External  Power",
            "Slots  Type          PSU       PSU       PSU       PSU       Usage",
            "-------------------------------------------------------------------",
            "Slot-1 X440-24p        P         -         -         -         N/A",
            "Slot-2 X440-24p        P         -         -         -         N/A",
            "Slot-3 ",
            "Slot-4 ",
            "Slot-5 ",
            "Slot-6 ",
            "Slot-7 ",
            "Slot-8 ",
            "",
            "",
            "Flags : (P) Power available, (F) Failed or no power,",
            "        (O) 48V powered off when 2 or 3 external PSUs are powered on,",
            "        (-) Empty"
        ]
    ]
}
ok: [w_l2_7] => {
    "result.stdout_lines": [
        [
            "FanTray information:",
            " State:                  Operational",
            " NumFan:                 4",
            " Fan-1:                  Operational at 11000 RPM",
            " Fan-2:                  Operational at 11000 RPM",
            " Fan-3:                  Operational at 11000 RPM",
            " Fan-4:                  Operational at 11000 RPM"
        ],
        [
            "Field Replaceable Units               Temp (C)   Status   Min  Normal   Max",
            "---------------------------------------------------------------------------",
            "Switch         : X440-24p               27.00    Normal   -10    0-48  55"
        ],
        [
            "PowerSupply 1 information:",
            " State             : Powered On",
            " PartInfo          : Internal Power Supply  ",
            "",
            "PowerSupply 2 information:",
            " State             : Empty",
            " Poll Interval     : 60 s",
            " Change Threshold  : N/A",
            " Change Action     : N/A"
        ]
    ]
}
ok: [w_l2_9] => {
    "result.stdout_lines": [
        [
            "FanTray information:",
            " State:                  Operational",
            " NumFan:                 4",
            " Fan-1:                  Operational at 11000 RPM",
            " Fan-2:                  Operational at 11000 RPM",
            " Fan-3:                  Operational at 11000 RPM",
            " Fan-4:                  Operational at 11000 RPM"
        ],
        [
            "Field Replaceable Units               Temp (C)   Status   Min  Normal   Max",
            "---------------------------------------------------------------------------",
            "Switch         : X440-24p               26.50    Normal   -10    0-48  55"
        ],
        [
            "PowerSupply 1 information:",
            " State             : Powered On",
            " PartInfo          : Internal Power Supply  ",
            "",
            "PowerSupply 2 information:",
            " State             : Empty",
            " Poll Interval     : 60 s",
            " Change Threshold  : N/A",
            " Change Action     : N/A"
        ]
    ]
}
ok: [w_l2_10] => {
    "result.stdout_lines": [
        [
            "FanTray information:",
            " State:                  Operational",
            " NumFan:                 4",
            " Fan-1:                  Operational at 11000 RPM",
            " Fan-2:                  Operational at 11000 RPM",
            " Fan-3:                  Operational at 11000 RPM",
            " Fan-4:                  Operational at 11000 RPM"
        ],
        [
            "Field Replaceable Units               Temp (C)   Status   Min  Normal   Max",
            "---------------------------------------------------------------------------",
            "Switch         : X440-24p               27.00    Normal   -10    0-48  55"
        ],
        [
            "PowerSupply 1 information:",
            " State             : Powered On",
            " PartInfo          : Internal Power Supply  ",
            "",
            "PowerSupply 2 information:",
            " State             : Empty",
            " Poll Interval     : 60 s",
            " Change Threshold  : N/A",
            " Change Action     : N/A"
        ]
    ]
}
ok: [w_l2_11] => {
    "result.stdout_lines": [
        [
            "FanTray information:",
            " State:                  Operational",
            " NumFan:                 4",
            " Fan-1:                  Operational at 11000 RPM",
            " Fan-2:                  Operational at 11000 RPM",
            " Fan-3:                  Operational at 11000 RPM",
            " Fan-4:                  Operational at 11000 RPM"
        ],
        [
            "Field Replaceable Units               Temp (C)   Status   Min  Normal   Max",
            "---------------------------------------------------------------------------",
            "Switch         : X440-24p               26.50    Normal   -10    0-48  55"
        ],
        [
            "PowerSupply 1 information:",
            " State             : Powered On",
            " PartInfo          : Internal Power Supply  ",
            "",
            "PowerSupply 2 information:",
            " State             : Empty",
            " Poll Interval     : 60 s",
            " Change Threshold  : N/A",
            " Change Action     : N/A"
        ]
    ]
}
ok: [w_l2_12] => {
    "result.stdout_lines": [
        [
            "FanTray information:",
            " State:                  Operational",
            " NumFan:                 4",
            " Fan-1:                  Operational at 11000 RPM",
            " Fan-2:                  Operational at 11000 RPM",
            " Fan-3:                  Operational at 11000 RPM",
            " Fan-4:                  Operational at 11000 RPM"
        ],
        [
            "Field Replaceable Units               Temp (C)   Status   Min  Normal   Max",
            "---------------------------------------------------------------------------",
            "Switch         : X440-24p               26.00    Normal   -10    0-48  55"
        ],
        [
            "PowerSupply 1 information:",
            " State             : Powered On",
            " PartInfo          : Internal Power Supply  ",
            "",
            "PowerSupply 2 information:",
            " State             : Empty",
            " Poll Interval     : 60 s",
            " Change Threshold  : N/A",
            " Change Action     : N/A"
        ]
    ]
}
ok: [w_l2_13] => {
    "result.stdout_lines": [
        [
            "FanTray-1 information:",
            " State:                  Operational",
            " NumFan:                 4",
            " Fan-1:                  Operational at 11000 RPM",
            " Fan-2:                  Operational at 11000 RPM",
            " Fan-3:                  Operational at 11000 RPM",
            " Fan-4:                  Operational at 11000 RPM",
            "",
            "FanTray-2 information:",
            " State:                  Operational",
            " NumFan:                 4",
            " Fan-1:                  Operational at 11000 RPM",
            " Fan-2:                  Operational at 11000 RPM",
            " Fan-3:                  Operational at 11000 RPM",
            " Fan-4:                  Operational at 11000 RPM",
            "",
            "FanTray-3 information:",
            " State:                  Empty",
            "",
            "FanTray-4 information:",
            " State:                  Empty",
            "",
            "FanTray-5 information:",
            " State:                  Empty",
            "",
            "FanTray-6 information:",
            " State:                  Empty",
            "",
            "FanTray-7 information:",
            " State:                  Empty",
            "",
            "FanTray-8 information:",
            " State:                  Empty"
        ],
        [
            "Field Replaceable Units               Temp (C)   Status   Min  Normal   Max",
            "---------------------------------------------------------------------------",
            "Slot-1         : X440-24p               35.00    Normal   -10    0-48  55",
            "Slot-2         : X440-24p               36.00    Normal   -10    0-48  55",
            "Slot-3         : ",
            "Slot-4         : ",
            "Slot-5         : ",
            "Slot-6         : ",
            "Slot-7         : ",
            "Slot-8         :"
        ],
        [
            "PSU-1 or  PSU-2 or",
            "                     Internal  External  External  External  Power",
            "Slots  Type          PSU       PSU       PSU       PSU       Usage",
            "-------------------------------------------------------------------",
            "Slot-1 X440-24p        P         -         -         -         N/A",
            "Slot-2 X440-24p        P         -         -         -         N/A",
            "Slot-3 ",
            "Slot-4 ",
            "Slot-5 ",
            "Slot-6 ",
            "Slot-7 ",
            "Slot-8 ",
            "",
            "",
            "Flags : (P) Power available, (F) Failed or no power,",
            "        (O) 48V powered off when 2 or 3 external PSUs are powered on,",
            "        (-) Empty"
        ]
    ]
}
ok: [w_l2_14] => {
    "result.stdout_lines": [
        [
            "FanTray information:",
            " State:                  Operational",
            " NumFan:                 4",
            " Fan-1:                  Operational at 11000 RPM",
            " Fan-2:                  Operational at 11000 RPM",
            " Fan-3:                  Operational at 11000 RPM",
            " Fan-4:                  Operational at 11000 RPM"
        ],
        [
            "Field Replaceable Units               Temp (C)   Status   Min  Normal   Max",
            "---------------------------------------------------------------------------",
            "Switch         : X440-24p               39.00    Normal   -10    0-48  55"
        ],
        [
            "PowerSupply 1 information:",
            " State             : Powered On",
            " PartInfo          : Internal Power Supply  ",
            "",
            "PowerSupply 2 information:",
            " State             : Empty",
            " Poll Interval     : 60 s",
            " Change Threshold  : N/A",
            " Change Action     : N/A"
        ]
    ]
}
ok: [w_l2_15] => {
    "result.stdout_lines": [
        [
            "FanTray information:",
            " State:                  Operational",
            " NumFan:                 4",
            " Fan-1:                  Operational at 11000 RPM",
            " Fan-2:                  Operational at 11000 RPM",
            " Fan-3:                  Operational at 11000 RPM",
            " Fan-4:                  Operational at 11000 RPM"
        ],
        [
            "Field Replaceable Units               Temp (C)   Status   Min  Normal   Max",
            "---------------------------------------------------------------------------",
            "Switch         : X440-24p               29.50    Normal   -10    0-48  55"
        ],
        [
            "PowerSupply 1 information:",
            " State             : Powered On",
            " PartInfo          : Internal Power Supply  ",
            "",
            "PowerSupply 2 information:",
            " State             : Empty",
            " Poll Interval     : 60 s",
            " Change Threshold  : N/A",
            " Change Action     : N/A"
        ]
    ]
}
ok: [w_l2_16] => {
    "result.stdout_lines": [
        [
            "FanTray information:",
            " State:                  Operational",
            " NumFan:                 4",
            " Fan-1:                  Operational at 11000 RPM",
            " Fan-2:                  Operational at 11000 RPM",
            " Fan-3:                  Operational at 11000 RPM",
            " Fan-4:                  Operational at 11000 RPM"
        ],
        [
            "Field Replaceable Units               Temp (C)   Status   Min  Normal   Max",
            "---------------------------------------------------------------------------",
            "Switch         : X440-24p               28.50    Normal   -10    0-48  55"
        ],
        [
            "PowerSupply 1 information:",
            " State             : Powered On",
            " PartInfo          : Internal Power Supply  ",
            "",
            "PowerSupply 2 information:",
            " State             : Empty",
            " Poll Interval     : 60 s",
            " Change Threshold  : N/A",
            " Change Action     : N/A"
        ]
    ]
}
ok: [w_l2_17] => {
    "result.stdout_lines": [
        [
            "FanTray information:",
            " State:                  Operational",
            " NumFan:                 4",
            " Fan-1:                  Operational at 11000 RPM",
            " Fan-2:                  Operational at 11000 RPM",
            " Fan-3:                  Operational at 11000 RPM",
            " Fan-4:                  Operational at 11000 RPM"
        ],
        [
            "Field Replaceable Units               Temp (C)   Status   Min  Normal   Max",
            "---------------------------------------------------------------------------",
            "Switch         : X440-24p               29.50    Normal   -10    0-48  55"
        ],
        [
            "PowerSupply 1 information:",
            " State             : Powered On",
            " PartInfo          : Internal Power Supply  ",
            "",
            "PowerSupply 2 information:",
            " State             : Empty",
            " Poll Interval     : 60 s",
            " Change Threshold  : N/A",
            " Change Action     : N/A"
        ]
    ]
}
ok: [w_l2_22] => {
    "result.stdout_lines": [
        [
            "FanTray information:",
            " State:                  Operational",
            " NumFan:                 4",
            " Fan-1:                  Operational at 11000 RPM",
            " Fan-2:                  Operational at 11000 RPM",
            " Fan-3:                  Operational at 11000 RPM",
            " Fan-4:                  Operational at 11000 RPM"
        ],
        [
            "Field Replaceable Units               Temp (C)   Status   Min  Normal   Max",
            "---------------------------------------------------------------------------",
            "Switch         : X440-24p               28.50    Normal   -10    0-48  55"
        ],
        [
            "PowerSupply 1 information:",
            " State             : Powered On",
            " PartInfo          : Internal Power Supply  ",
            "",
            "PowerSupply 2 information:",
            " State             : Empty",
            " Poll Interval     : 60 s",
            " Change Threshold  : N/A",
            " Change Action     : N/A"
        ]
    ]
}
ok: [w_l2_21] => {
    "result.stdout_lines": [
        [
            "FanTray information:",
            " State:                  Operational",
            " NumFan:                 4",
            " Fan-1:                  Operational at 11000 RPM",
            " Fan-2:                  Operational at 11000 RPM",
            " Fan-3:                  Operational at 11000 RPM",
            " Fan-4:                  Operational at 11000 RPM"
        ],
        [
            "Field Replaceable Units               Temp (C)   Status   Min  Normal   Max",
            "---------------------------------------------------------------------------",
            "Switch         : X440-24p               32.50    Normal   -10    0-48  55"
        ],
        [
            "PowerSupply 1 information:",
            " State             : Powered On",
            " PartInfo          : Internal Power Supply  ",
            "",
            "PowerSupply 2 information:",
            " State             : Empty",
            " Poll Interval     : 60 s",
            " Change Threshold  : N/A",
            " Change Action     : N/A"
        ]
    ]
}
ok: [w_l2_19] => {
    "result.stdout_lines": [
        [
            "FanTray information:",
            " State:                  Operational",
            " NumFan:                 4",
            " Fan-1:                  Operational at 11000 RPM",
            " Fan-2:                  Operational at 11000 RPM",
            " Fan-3:                  Operational at 11000 RPM",
            " Fan-4:                  Operational at 11000 RPM"
        ],
        [
            "Field Replaceable Units               Temp (C)   Status   Min  Normal   Max",
            "---------------------------------------------------------------------------",
            "Switch         : X440-24p               27.50    Normal   -10    0-48  55"
        ],
        [
            "PowerSupply 1 information:",
            " State             : Powered On",
            " PartInfo          : Internal Power Supply  ",
            "",
            "PowerSupply 2 information:",
            " State             : Empty",
            " Poll Interval     : 60 s",
            " Change Threshold  : N/A",
            " Change Action     : N/A"
        ]
    ]
}
ok: [w_l2_20] => {
    "result.stdout_lines": [
        [
            "FanTray information:",
            " State:                  Operational",
            " NumFan:                 4",
            " Fan-1:                  Operational at 11000 RPM",
            " Fan-2:                  Operational at 11000 RPM",
            " Fan-3:                  Operational at 11000 RPM",
            " Fan-4:                  Operational at 11000 RPM"
        ],
        [
            "Field Replaceable Units               Temp (C)   Status   Min  Normal   Max",
            "---------------------------------------------------------------------------",
            "Switch         : X440-24p               29.00    Normal   -10    0-48  55"
        ],
        [
            "PowerSupply 1 information:",
            " State             : Powered On",
            " PartInfo          : Internal Power Supply  ",
            "",
            "PowerSupply 2 information:",
            " State             : Empty",
            " Poll Interval     : 60 s",
            " Change Threshold  : N/A",
            " Change Action     : N/A"
        ]
    ]
}
ok: [w_l2_18] => {
    "result.stdout_lines": [
        [
            "FanTray information:",
            " State:                  Operational",
            " NumFan:                 4",
            " Fan-1:                  Operational at 11000 RPM",
            " Fan-2:                  Operational at 11000 RPM",
            " Fan-3:                  Operational at 11000 RPM",
            " Fan-4:                  Operational at 11000 RPM"
        ],
        [
            "Field Replaceable Units               Temp (C)   Status   Min  Normal   Max",
            "---------------------------------------------------------------------------",
            "Switch         : X440-24p               29.50    Normal   -10    0-48  55"
        ],
        [
            "PowerSupply 1 information:",
            " State             : Powered On",
            " PartInfo          : Internal Power Supply  ",
            "",
            "PowerSupply 2 information:",
            " State             : Empty",
            " Poll Interval     : 60 s",
            " Change Threshold  : N/A",
            " Change Action     : N/A"
        ]
    ]
}
ok: [w_l2_24] => {
    "result.stdout_lines": [
        [
            "FanTray information:",
            " State:                  Operational",
            " NumFan:                 4",
            " Fan-1:                  Operational at 11000 RPM",
            " Fan-2:                  Operational at 11000 RPM",
            " Fan-3:                  Operational at 11000 RPM",
            " Fan-4:                  Operational at 11000 RPM"
        ],
        [
            "Field Replaceable Units               Temp (C)   Status   Min  Normal   Max",
            "---------------------------------------------------------------------------",
            "Switch         : X440-24p               40.50    Normal   -10    0-48  55"
        ],
        [
            "PowerSupply 1 information:",
            " State             : Powered On",
            " PartInfo          : Internal Power Supply  ",
            "",
            "PowerSupply 2 information:",
            " State             : Empty",
            " Poll Interval     : 60 s",
            " Change Threshold  : N/A",
            " Change Action     : N/A"
        ]
    ]
}
ok: [w_l2_26] => {
    "result.stdout_lines": [
        [
            "FanTray information:",
            " State:                  Operational",
            " NumFan:                 4",
            " Fan-1:                  Operational at 11000 RPM",
            " Fan-2:                  Operational at 11000 RPM",
            " Fan-3:                  Operational at 11000 RPM",
            " Fan-4:                  Operational at 11000 RPM"
        ],
        [
            "Field Replaceable Units               Temp (C)   Status   Min  Normal   Max",
            "---------------------------------------------------------------------------",
            "Switch         : X440-24p               32.00    Normal   -10    0-48  55"
        ],
        [
            "PowerSupply 1 information:",
            " State             : Powered On",
            " PartInfo          : Internal Power Supply  ",
            "",
            "PowerSupply 2 information:",
            " State             : Empty",
            " Poll Interval     : 60 s",
            " Change Threshold  : N/A",
            " Change Action     : N/A"
        ]
    ]
}
ok: [w_l2_25] => {
    "result.stdout_lines": [
        [
            "FanTray information:",
            " State:                  Operational",
            " NumFan:                 4",
            " Fan-1:                  Operational at 11000 RPM",
            " Fan-2:                  Operational at 11000 RPM",
            " Fan-3:                  Operational at 11000 RPM",
            " Fan-4:                  Operational at 11000 RPM"
        ],
        [
            "Field Replaceable Units               Temp (C)   Status   Min  Normal   Max",
            "---------------------------------------------------------------------------",
            "Switch         : X440-24p               25.00    Normal   -10    0-48  55"
        ],
        [
            "PowerSupply 1 information:",
            " State             : Powered On",
            " PartInfo          : Internal Power Supply  ",
            "",
            "PowerSupply 2 information:",
            " State             : Empty",
            " Poll Interval     : 60 s",
            " Change Threshold  : N/A",
            " Change Action     : N/A"
        ]
    ]
}
ok: [w_l2_27] => {
    "result.stdout_lines": [
        [
            "FanTray information:",
            " State:                  Operational",
            " NumFan:                 4",
            " Fan-1:                  Operational at 11000 RPM",
            " Fan-2:                  Operational at 11000 RPM",
            " Fan-3:                  Operational at 11000 RPM",
            " Fan-4:                  Operational at 11000 RPM"
        ],
        [
            "Field Replaceable Units               Temp (C)   Status   Min  Normal   Max",
            "---------------------------------------------------------------------------",
            "Switch         : X440-24p               27.00    Normal   -10    0-48  55"
        ],
        [
            "PowerSupply 1 information:",
            " State             : Powered On",
            " PartInfo          : Internal Power Supply  ",
            "",
            "PowerSupply 2 information:",
            " State             : Empty",
            " Poll Interval     : 60 s",
            " Change Threshold  : N/A",
            " Change Action     : N/A"
        ]
    ]
}
ok: [w_l2_23] => {
    "result.stdout_lines": [
        [
            "FanTray information:",
            " State:                  Operational",
            " NumFan:                 4",
            " Fan-1:                  Operational at 11000 RPM",
            " Fan-2:                  Operational at 11000 RPM",
            " Fan-3:                  Operational at 11000 RPM",
            " Fan-4:                  Operational at 11000 RPM"
        ],
        [
            "Field Replaceable Units               Temp (C)   Status   Min  Normal   Max",
            "---------------------------------------------------------------------------",
            "Switch         : X440-24p               27.00    Normal   -10    0-48  55"
        ],
        [
            "PowerSupply 1 information:",
            " State             : Powered On",
            " PartInfo          : Internal Power Supply  ",
            "",
            "PowerSupply 2 information:",
            " State             : Empty",
            " Poll Interval     : 60 s",
            " Change Threshold  : N/A",
            " Change Action     : N/A"
        ]
    ]
}
ok: [w_l2_29] => {
    "result.stdout_lines": [
        [
            "FanTray information:",
            " State:                  Operational",
            " NumFan:                 4",
            " Fan-1:                  Operational at 11000 RPM",
            " Fan-2:                  Operational at 11000 RPM",
            " Fan-3:                  Operational at 11000 RPM",
            " Fan-4:                  Operational at 11000 RPM"
        ],
        [
            "Field Replaceable Units               Temp (C)   Status   Min  Normal   Max",
            "---------------------------------------------------------------------------",
            "Switch         : X440-24p               23.50    Normal   -10    0-48  55"
        ],
        [
            "PowerSupply 1 information:",
            " State             : Powered On",
            " PartInfo          : Internal Power Supply  ",
            "",
            "PowerSupply 2 information:",
            " State             : Empty",
            " Poll Interval     : 60 s",
            " Change Threshold  : N/A",
            " Change Action     : N/A"
        ]
    ]
}
ok: [w_l2_30] => {
    "result.stdout_lines": [
        [
            "FanTray information:",
            " State:                  Operational",
            " NumFan:                 4",
            " Fan-1:                  Operational at 11000 RPM",
            " Fan-2:                  Operational at 11000 RPM",
            " Fan-3:                  Operational at 11000 RPM",
            " Fan-4:                  Operational at 11000 RPM"
        ],
        [
            "Field Replaceable Units               Temp (C)   Status   Min  Normal   Max",
            "---------------------------------------------------------------------------",
            "Switch         : X440-24p               25.00    Normal   -10    0-48  55"
        ],
        [
            "PowerSupply 1 information:",
            " State             : Powered On",
            " PartInfo          : Internal Power Supply  ",
            "",
            "PowerSupply 2 information:",
            " State             : Empty",
            " Poll Interval     : 60 s",
            " Change Threshold  : N/A",
            " Change Action     : N/A"
        ]
    ]
}
ok: [w_l2_31] => {
    "result.stdout_lines": [
        [
            "FanTray information:",
            " State:                  Operational",
            " NumFan:                 4",
            " Fan-1:                  Operational at 11000 RPM",
            " Fan-2:                  Operational at 11000 RPM",
            " Fan-3:                  Operational at 11000 RPM",
            " Fan-4:                  Operational at 11000 RPM"
        ],
        [
            "Field Replaceable Units               Temp (C)   Status   Min  Normal   Max",
            "---------------------------------------------------------------------------",
            "Switch         : X440-24p               35.50    Normal   -10    0-48  55"
        ],
        [
            "PowerSupply 1 information:",
            " State             : Powered On",
            " PartInfo          : Internal Power Supply  ",
            "",
            "PowerSupply 2 information:",
            " State             : Empty",
            " Poll Interval     : 60 s",
            " Change Threshold  : N/A",
            " Change Action     : N/A"
        ]
    ]
}
ok: [w_l2_33] => {
    "result.stdout_lines": [
        [
            "FanTray information:",
            " State:                  Operational",
            " NumFan:                 4",
            " Fan-1:                  Operational at 11000 RPM",
            " Fan-2:                  Operational at 11000 RPM",
            " Fan-3:                  Operational at 11000 RPM",
            " Fan-4:                  Operational at 11000 RPM"
        ],
        [
            "Field Replaceable Units               Temp (C)   Status   Min  Normal   Max",
            "---------------------------------------------------------------------------",
            "Switch         : X440-24p               30.00    Normal   -10    0-48  55"
        ],
        [
            "PowerSupply 1 information:",
            " State             : Powered On",
            " PartInfo          : Internal Power Supply  ",
            "",
            "PowerSupply 2 information:",
            " State             : Empty",
            " Poll Interval     : 60 s",
            " Change Threshold  : N/A",
            " Change Action     : N/A"
        ]
    ]
}
ok: [w_l2_34] => {
    "result.stdout_lines": [
        [
            "FanTray information:",
            " State:                  Operational",
            " NumFan:                 4",
            " Fan-1:                  Operational at 11000 RPM",
            " Fan-2:                  Operational at 11000 RPM",
            " Fan-3:                  Operational at 11000 RPM",
            " Fan-4:                  Operational at 11000 RPM"
        ],
        [
            "Field Replaceable Units               Temp (C)   Status   Min  Normal   Max",
            "---------------------------------------------------------------------------",
            "Switch         : X440-24p               28.50    Normal   -10    0-48  55"
        ],
        [
            "PowerSupply 1 information:",
            " State             : Powered On",
            " PartInfo          : Internal Power Supply  ",
            "",
            "PowerSupply 2 information:",
            " State             : Empty",
            " Poll Interval     : 60 s",
            " Change Threshold  : N/A",
            " Change Action     : N/A"
        ]
    ]
}
ok: [w_l2_37] => {
    "result.stdout_lines": [
        [
            "FanTray information:",
            " State:                  Unsupported",
            " NumFan:                 0"
        ],
        [
            "Field Replaceable Units               Temp (C)   Status   Min  Normal   Max",
            "---------------------------------------------------------------------------",
            "Switch         : X430-8p                47.50    Normal    15   20-64  69"
        ],
        [
            "PowerSupply 1 information:",
            " State             : Powered On",
            " PartInfo          : Internal Power Supply  ",
            " Poll Interval     : 60 s",
            " Change Threshold  : N/A",
            " Change Action     : N/A"
        ]
    ]
}
ok: [w_l2_36] => {
    "result.stdout_lines": [
        [
            "FanTray information:",
            " State:                  Operational",
            " NumFan:                 4",
            " Fan-1:                  Operational at 11000 RPM",
            " Fan-2:                  Operational at 11000 RPM",
            " Fan-3:                  Operational at 11000 RPM",
            " Fan-4:                  Operational at 11000 RPM"
        ],
        [
            "Field Replaceable Units               Temp (C)   Status   Min  Normal   Max",
            "---------------------------------------------------------------------------",
            "Switch         : X440-24p               30.50    Normal   -10    0-48  55"
        ],
        [
            "PowerSupply 1 information:",
            " State             : Powered On",
            " PartInfo          : Internal Power Supply  ",
            "",
            "PowerSupply 2 information:",
            " State             : Empty",
            " Poll Interval     : 60 s",
            " Change Threshold  : N/A",
            " Change Action     : N/A"
        ]
    ]
}

PLAY RECAP *****************************************************************************************************
w_l2_1                     : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
w_l2_10                    : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
w_l2_11                    : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
w_l2_12                    : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
w_l2_13                    : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
w_l2_14                    : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
w_l2_15                    : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
w_l2_16                    : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
w_l2_17                    : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
w_l2_18                    : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
w_l2_19                    : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
w_l2_2                     : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
w_l2_20                    : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
w_l2_21                    : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
w_l2_22                    : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
w_l2_23                    : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
w_l2_24                    : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
w_l2_25                    : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
w_l2_26                    : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
w_l2_27                    : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
w_l2_29                    : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
w_l2_3                     : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
w_l2_30                    : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
w_l2_31                    : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
w_l2_32                    : ok=0    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0
w_l2_33                    : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
w_l2_34                    : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
w_l2_35                    : ok=0    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0
w_l2_36                    : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
w_l2_37                    : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
w_l2_4                     : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
w_l2_5                     : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
w_l2_7                     : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
w_l2_8                     : ok=0    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0
w_l2_9                     : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0

잘된다!!! 하지만, 위의 결과를 보면 3개의 장비에서 failed가 발생했다. w_l2_32, w_l2_35는 원인은 위의 ssh-key fingerprint가 앤시블 컨트롤 노드에 저장되어 있지 않아서이며, w_l2_8은 없는 장비여서 접속이 당연히 안되므로 실패한 경우다.

w_l2_35 장비 접속 오류를 해결하고 플레이북을 실행해 보면,

$ ansible-playbook book-check.yml -i inventory.yml -l w_l2_35,w_l2_32  --vault-id admin@vault-pw.txt

PLAY [Extreme Switch Check Playbook] ***************************************************************************

TASK [Check Extreme switches...] *******************************************************************************
ok: [w_l2_32]
ok: [w_l2_35]

TASK [output] **************************************************************************************************
ok: [w_l2_32] => {
    "result.stdout_lines": [
        [
            "FanTray information:",
            " State:                  Operational",
            " NumFan:                 4",
            " Fan-1:                  Operational at 11000 RPM",
            " Fan-2:                  Operational at 11000 RPM",
            " Fan-3:                  Operational at 11000 RPM",
            " Fan-4:                  Operational at 11000 RPM"
        ],
        [
            "Field Replaceable Units               Temp (C)   Status   Min  Normal   Max",
            "---------------------------------------------------------------------------",
            "Switch         : X440-24p               29.50    Normal   -10    0-48  55"
        ],
        [
            "PowerSupply 1 information:",
            " State             : Powered On",
            " PartInfo          : Internal Power Supply  ",
            "",
            "PowerSupply 2 information:",
            " State             : Empty",
            " Poll Interval     : 60 s",
            " Change Threshold  : N/A",
            " Change Action     : N/A"
        ]
    ]
}
ok: [w_l2_35] => {
    "result.stdout_lines": [
        [
            "FanTray information:",
            " State:                  Operational",
            " NumFan:                 4",
            " Fan-1:                  Failed at 11000 RPM",
            " Fan-2:                  Failed at 11000 RPM",
            " Fan-3:                  Operational at 11000 RPM",
            " Fan-4:                  Operational at 11000 RPM"
        ],
        [
            "Field Replaceable Units               Temp (C)   Status   Min  Normal   Max",
            "---------------------------------------------------------------------------",
            "Switch         : X440-24p               32.50    Normal   -10    0-48  55"
        ],
        [
            "PowerSupply 1 information:",
            " State             : Powered On",
            " PartInfo          : Internal Power Supply  ",
            "",
            "PowerSupply 2 information:",
            " State             : Empty",
            " Poll Interval     : 60 s",
            " Change Threshold  : N/A",
            " Change Action     : N/A"
        ]
    ]
}

PLAY RECAP *****************************************************************************************************
w_l2_32                    : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
w_l2_35                    : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0

w_l2_35 장비에서 Fan-1, Fan-2 두개의 팬이 고장난 것이 보인다.

참고문서: https://galaxy.ansible.com/extreme/exos?extIdCarryOver=true&sc_cid=701f2000001OH6uAAG

답글 남기기

Your email address will not be published.

%d bloggers like this: