Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
349 views
in Technique[技术] by (71.8m points)

Calling Netscaler CLI commands from Ansible

I'm trying to use the "cli_command" module from Ansible to configure Netscaler appliances. For 2 of them, running version "12.0 - build 60.9.nc" a simple task like this works perfectly :

- name: call NS CLI
  cli_command:
    command: show nsconf
  register: cs_vserver
  delegate_to: netscaler_dmz

Changing, the "delegate_to" to an appliance running version "NS11.1: Build 56.19.nc", I get the error :

The full traceback is: WARNING: The below traceback may not be related to the actual failure. File "/tmp/ansible_cli_command_payload_4w503v/ansible_cli_command_payload.zip/ansible/modules/network/cli/cli_command.py", line 167, in main File "/tmp/ansible_cli_command_payload_4w503v/ansible_cli_command_payload.zip/ansible/module_utils/connection.py", line 185, in rpc raise ConnectionError(to_text(msg, errors='surrogate_then_replace'), code=code) fatal: [localhost -> 172.26.58.112]: FAILED! => { "changed": false, "invocation": { "module_args": { "answer": null, "check_all": false, "command": "show nsconf", "newline": true, "prompt": null, "sendonly": false } }, "msg": "command timeout triggered, timeout value is 30 secs. See the timeout setting options in the Network Debug and Troubleshooting Guide." }

Authentication uses RSA keys for all 3 devices, logs show welcome banner and connection is fine (manual connection using ssh works fine too), but soon after above error occurs. Strangely, Netscaler is not listed in the list of availiable network platforms (https://docs.ansible.com/ansible/latest/network/user_guide/platform_index.html#settings-by-platform) but using parameters as follow work fine on the two others Netscalers (inventory file) :

all:
  hosts:
    localhost:
      ansible_connection: local
    netscaler_dmz_int: <= OK
      ansible_host: 192.168.XXX.XXX
      ansible_connection: network_cli
      ansible_network_os: ios
      ansible_user: nsroot
    netscaler_dmz_prod: <= OK
      ansible_host: 192.168.XXX.XXX
      ansible_connection: network_cli
      ansible_network_os: ios
      ansible_user: nsroot
    netscaler_dc: <= KO
      ansible_host: 172.26.XXX.XXX
      ansible_connection: network_cli
      ansible_network_os: ios
      ansible_user: nsroot

Upgrading firmware is not feasible in the short terms. Does the problem come from the older version ? Is there a more adequate parameters to make it woorks on all 3 devices ? Thanks.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...