# Ansible and Huawei switch configuration

**URL:** <https://forum.ansible.com/t/ansible-and-huawei-switch-configuration/43667>\
**Category:** Get Help\
**Tags:** network\
**Created:** [July 1, 2025, 3:00pm UTC](https://forum.ansible.com/t/ansible-and-huawei-switch-configuration/43667 "2025-07-01T15:00:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dorian](https://avatars.discourse-cdn.com/v4/letter/d/35a633/32.png) [@dorian](https://forum.ansible.com/u/dorian)\
**Post date:** [July 1, 2025, 3:00pm UTC](https://forum.ansible.com/t/ansible-and-huawei-switch-configuration/43667/1 "2025-07-01T15:00:21Z")

</div>

Hi Everyone,

I work on a playbook to configure a Huawei CloudEngine S5735 but i’m stuck to SNMP V3 configuration.

Have you already configured huawei switches with Ansible?

Here are the simple command lines that work with the ce\_command module:

_ **snmp-agent sys-info version v3** _  
_ **snmp-agent mib-view included isoview iso** _  
_ **snmp-agent group v3 admin privacy read-view isoview write-view isoview notify-view isoview** _  
_ **snmp-agent target-host trap address udp-domain X.X.X.X params securityname XXXX v3** _  
_ **snmp-agent usm-user v3 XXXX** _  
_ **snmp-agent usm-user v3 XXXX group admin** _  
_ **snmp-agent protocol source-interface Vlanif999** _

When i indicate the authentication and privacy key encryption, that it doesn’t work with cli\_command module

_ **snmp-agent usm-user v3 XXXX authentication-mode sha2-256** _  
_ **snmp-agent usm-user v3 XXXX privacy-mode aes256** _

I don’t know how to interpreting prompts in my playbook when i send the keys

_**“Please configure the authentication password (8-255)”**_  
_ **“Enter Password:”** _  
_ **XXXXXX** _  
_ **“Confirm Password:”** _  
_ **XXXXXX** _

The result :

11:24:55 AM  
TASK [Authentification V3] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
11:24:58 AM  
ok: [X.X.X.X] =\> (item=system-view)  
11:25:28 AM  
failed: [X.X.X.X] (item=snmp-agent usm-user v3 XXXXX authentication-mode sha2-256) =\> {“ansible\_loop\_var”: “item”, “changed”: false, “item”: “snmp-agent usm-user v3 XXXX authentication-mode sha2-256”, “msg”: “command timeout triggered, timeout value is 30 secs.\nSee the timeout setting options in the Network Debug and Troubleshooting Guide.”}

Here is the ansible configuration :

ansible\_connection=network\_cli  
ansible\_network\_os=ce

Module

cli\_command  
ce\_command
