Watch this video demo about the OmniSwitch AOS Ansible collection, a powerful automation tool for managing Alcatel-Lucent OmniSwitch network devices. The video will cover an introduction to the AOS Ansible collection, its benefits, and its key features. Walk through practical examples, showing how to use Ansible playbooks to automate configuration tasks, streamline network management, and ensure consistent deployment across multiple devices. This demonstration will highlight the ease and efficiency of integrating Ansible with OmniSwitch AOS for network automation, providing viewers with actionable insights and a hands-on overview.
You can share your comments and questions here.
1 Like
Hello Community,
I need your assistance with understanding/fixing issue with my Alcatel-Lucent Getting Switch Status playbook.
Please find data about my systems and steps to reproduce.
Ansible Control Node:
cat /etc/os-release
NAME="Rocky Linux"
VERSION="9.6 (Blue Onyx)"
ID="rocky"
ID_LIKE="rhel centos fedora"
VERSION_ID="9.6"
PLATFORM_ID="platform:el9"
PRETTY_NAME="Rocky Linux 9.6 (Blue Onyx)"
Ansible:
ansible-playbook [core 2.14.18]
config file = /etc/ansible/ansible.cfg
configured module search path = ['/home/###/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3.9/site-packages/ansible
ansible collection location = /home/###/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/bin/ansible-playbook
python version = 3.9.21 (main, Aug 19 2025, 00:00:00) [GCC 11.5.0 20240719 (Red Hat 11.5.0-5)] (/usr/bin/python3)
jinja version = 3.1.2
libyaml = True
Using /etc/ansible/ansible.cfg as config file
Collection installed:
ansible-galaxy collection list | grep aos
ale.aos8 1.0.0
My inventory:
all:
children:
switches:
hosts:
switch-test:
ansible_host: switch_IP
ansible_network_os: ale.aos8.aos8
ansible_connection: network_cli
ansible_user: admin
ansible_password: password
ansible_persistent_command_timeout: 120
My Playbook:
- name: Check Alcatel-Lucent switches status
hosts: all
connection: network_cli
gather_facts: no
vars:
ansible_command_timeout: 120
tasks:
- name: Run show system command
ale.aos8.aos8_command:
commands: show system
My verbose output of playbook run:
ansible-playbook -i ale.yml -u admin aos8.yml -vvvv
ansible-playbook [core 2.14.18]
config file = /etc/ansible/ansible.cfg
configured module search path = ['/home/###/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3.9/site-packages/ansible
ansible collection location = /home/###/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/bin/ansible-playbook
python version = 3.9.21 (main, Aug 19 2025, 00:00:00) [GCC 11.5.0 20240719 (Red Hat 11.5.0-5)] (/usr/bin/python3)
jinja version = 3.1.2
libyaml = True
Using /etc/ansible/ansible.cfg as config file
setting up inventory plugins
host_list declined parsing /home/###/test-playbook/ale.yml as it did not pass its verify_file() method
script declined parsing /home/###/test-playbook/ale.yml as it did not pass its verify_file() method
Parsed /home/###/test-playbook/ale.yml inventory source with yaml plugin
Loading collection ale.aos8 from /home/###/.ansible/collections/ansible_collections/ale/aos8
Loading callback plugin default of type stdout, v2.0 from /usr/lib/python3.9/site-packages/ansible/plugins/callback/default.py
Skipping callback 'default', as we already have a stdout callback.
Skipping callback 'minimal',
as we already have a stdout callback.
Skipping callback 'oneline', as we already have a stdout callback.
PLAYBOOK: aos8.yml ***********************************************************************************************************************************************
Positional arguments: aos8.yml
verbosity: 4
remote_user: admin
connection: smart
timeout: 10
become_method: sudo
tags: ('all',)
inventory: ('/home/###/test-playbook/ale.yml',)
forks: 5
1 plays in aos8.yml
PLAY [Check Alcatel-Lucent switches status] **********************************************************************************************************************
TASK [Run show system command] ***********************************************************************************************************************************
task path: /home/###/test-playbook/aos8.yml:9
redirecting (type: connection) ansible.builtin.network_cli to ansible.netcommon.network_cli
Loading collection ansible.netcommon from /home/###/.ansible/collections/ansible_collections/ansible/netcommon
[WARNING]: Collection ansible.netcommon does not support Ansible version 2.14.18
Loading collection ansible.utils from /home/###/.ansible/collections/ansible_collections/ansible/utils
[WARNING]: Collection ansible.utils does not support Ansible version 2.14.18
<switch_IP> attempting to start connection
<switch_IP> using connection plugin ansible.netcommon.network_cli
Found ansible-connection at path /usr/bin/ansible-connection
<switch_IP> local domain socket does not exist, starting it
<switch_IP> control socket path is /home/###/.ansible/pc/13c33b8384
<switch_IP> redirecting (type: connection) ansible.builtin.network_cli to ansible.netcommon.network_cli
<switch_IP> Loading collection ansible.netcommon from /home/###/.ansible/collections/ansible_collections/ansible/netcommon
<switch_IP> Loading collection ansible.utils from /home/###/.ansible/collections/ansible_collections/ansible/utils
<switch_IP> Loading collection ale.aos8 from /home/###/.ansible/collections/ansible_collections/ale/aos8
<switch_IP> local domain socket listeners started successfully
<switch_IP> loaded cliconf plugin ansible_collections.ale.aos8.plugins.cliconf.aos8 from path /home/###/.ansible/collections/ansible_collections/ale/aos8/plugins/cliconf/aos8.py for network_os ale.aos8.aos8
[WARNING]: Persistent connection logging is enabled for switch_IP. This will log ALL interactions to /home/###/ansible.log and WILL NOT redact sensitive
configuration like passwords. USE WITH CAUTION!
<switch_IP> ssh type is set to auto
<switch_IP> autodetecting ssh_type
<switch_IP> ssh type is now set to libssh
<switch_IP>
<switch_IP> local domain socket path is /home/###/.ansible/pc/13c33b8384
<switch_IP> ESTABLISH LOCAL CONNECTION FOR USER: nataliia
<switch_IP> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/###/.ansible/tmp/ansible-local-712498rwvbxv4u `"&& mkdir "` echo /home/###/.ansible/tmp/ansible-local-712498rwvbxv4u/ansible-tmp-1761130506.5201569-712506-56667609980510 `" && echo ansible-tmp-1761130506.5201569-712506-56667609980510="` echo /home/###/.ansible/tmp/ansible-local-712498rwvbxv4u/ansible-tmp-1761130506.5201569-712506-56667609980510 `" ) && sleep 0'
Using module file /home/###/.ansible/collections/ansible_collections/ale/aos8/plugins/modules/aos8_command.py
<switch_IP> PUT /home/###/.ansible/tmp/ansible-local-712498rwvbxv4u/tmp4fpme_k6 TO /home/###/.ansible/tmp/ansible-local-712498rwvbxv4u/ansible-tmp-1761130506.5201569-712506-56667609980510/AnsiballZ_aos8_command.py
<switch_IP> EXEC /bin/sh -c 'chmod u+x /home/###/.ansible/tmp/ansible-local-712498rwvbxv4u/ansible-tmp-1761130506.5201569-712506-56667609980510/ /home/###/.ansible/tmp/ansible-local-712498rwvbxv4u/ansible-tmp-1761130506.5201569-712506-56667609980510/AnsiballZ_aos8_command.py && sleep 0'
<switch_IP> EXEC /bin/sh -c '/usr/bin/python3 /home/###/.ansible/tmp/ansible-local-712498rwvbxv4u/ansible-tmp-1761130506.5201569-712506-56667609980510/AnsiballZ_aos8_command.py && sleep 0'
<switch_IP> EXEC /bin/sh -c 'rm -f -r /home/###/.ansible/tmp/ansible-local-712498rwvbxv4u/ansible-tmp-1761130506.5201569-712506-56667609980510/ > /dev/null 2>&1 && sleep 0'
The full traceback is:
File "/tmp/ansible_ale.aos8.aos8_command_payload_r9cyjmu8/ansible_ale.aos8.aos8_command_payload.zip/ansible_collections/ale/aos8/plugins/module_utils/network/aos8/aos8.py", line 60, in get_capabilities
capabilities = Connection(module._socket_path).get_capabilities()
File "/tmp/ansible_ale.aos8.aos8_command_payload_r9cyjmu8/ansible_ale.aos8.aos8_command_payload.zip/ansible/module_utils/connection.py", line 200, in __rpc__
raise ConnectionError(to_text(msg, errors='surrogate_then_replace'), code=code)
fatal: [switch-test]: FAILED! => {
"changed": false,
"invocation": {
"module_args": {
"commands": [
"show system"
],
"output": null
}
},
"msg": "command timeout triggered, timeout value is 120 secs.\nSee the timeout setting options in the Network Debug and Troubleshooting Guide."
}
PLAY RECAP *******************************************************************************************************************************************************
switch-test : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
as well as log:
2025-10-22 12:57:06,776 p=712498 u=nataliia n=ansible | The full traceback is:
File "/tmp/ansible_ale.aos8.aos8_command_payload_r9cyjmu8/ansible_ale.aos8.aos8_command_payload.zip/ansible_collections/ale/aos8/plugins/module_utils/network/aos8/aos8.py", line 60, in get_capabilities
capabilities = Connection(module._socket_path).get_capabilities()
File "/tmp/ansible_ale.aos8.aos8_command_payload_r9cyjmu8/ansible_ale.aos8.aos8_command_payload.zip/ansible/module_utils/connection.py", line 200, in __rpc__
raise ConnectionError(to_text(msg, errors='surrogate_then_replace'), code=code)
2025-10-22 12:57:06,776 p=712498 u=nataliia n=ansible | fatal: [switch-test]: FAILED! => {
"changed": false,
"invocation": {
"module_args": {
"commands": [
"show system"
],
"output": null
}
},
"msg": "command timeout triggered, timeout value is 120 secs.\nSee the timeout setting options in the Network Debug and Troubleshooting Guide."
}
2025-10-22 12:57:06,777 p=712518 u=nataliia n=ansible | jsonrpc request: b'{"jsonrpc": "2.0", "method": "reset", "id": "6dfc8ecc-f4ef-4824-a025-c8ed83069563", "params": [[], {}]}'
2025-10-22 12:57:06,777 p=712518 u=nataliia n=ansible | jsonrpc response: {"jsonrpc": "2.0", "id": "6dfc8ecc-f4ef-4824-a025-c8ed83069563", "result_type": "pickle", "result": "N."}
2025-10-22 12:57:06,778 p=712498 u=nataliia n=ansible | PLAY RECAP *******************************************************************************************************************************************************
2025-10-22 12:57:06,778 p=712498 u=nataliia n=ansible | switch-test : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
2025-10-22 12:57:06,878 p=712518 u=nataliia n=ansible | invoked shell using ssh_type: libssh
2025-10-22 12:57:06,878 p=712518 u=nataliia n=ansible | ssh connection done, setting terminal
2025-10-22 12:57:06,878 p=712518 u=nataliia n=ansible | loaded terminal plugin for network_os ale.aos8.aos8
2025-10-22 12:57:06,878 p=712518 u=nataliia n=ansible | command: None
2025-10-22 12:57:06,878 p=712518 u=nataliia n=ansible | response-1: b'\r\n'
2025-10-22 12:57:06,878 p=712518 u=nataliia n=ansible | response-2: b'Alcatel-Switch '
2025-10-22 12:57:06,878 p=712518 u=nataliia n=ansible | resetting persistent connection for socket_path /home/###/.ansible/pc/13c33b8384
2025-10-22 12:57:06,878 p=712518 u=nataliia n=ansible | closing ssh connection to device
2025-10-22 12:57:06,878 p=712518 u=nataliia n=ansible | firing event: on_close_shell()
2025-10-22 12:57:06,878 p=712518 u=nataliia n=ansible | cli session is now closed
2025-10-22 12:57:06,878 p=712518 u=nataliia n=ansible | ssh connection has been closed successfully
2025-10-22 12:57:06,878 p=712518 u=nataliia n=ansible | reset call on connection instance
2025-10-22 12:57:06,878 p=712518 u=nataliia n=ansible | shutdown complete
I am able to connect from my control node via ssh on the switch and perform the same command:
Alcatel-Switch show system
System:
Description: Alcatel-Lucent Enterprise OS6560-P24Z24 8.9.94.R04 GA,
Is that a problem with Switch version that is not supported by collection or any other possible issue?
Thank you in advance for assistance.
1 Like
