Developer

 View Only
last person joined: 3 hours ago 

Expand all | Collapse all

Ansible playbook special characters in password

This thread has been viewed 10 times
  • 1.  Ansible playbook special characters in password

    Posted Mar 26, 2024 05:06 PM

    Hello,

    I can configure the switch via ssh and rest api using the following options in my hosts file:

    10.0.232.254 ansible_network_os=arubanetworks.aos_switch.arubaoss ansible_connection=local ansible_user=admin

    I start the playbook with the following parameters and ask for the password:

    ANSIBLE_NETWORK_GROUP_MODULES=arubaoss ansible-playbook conf_vlan.yml -i hosts.txt --ask-pass

    normal passwords without special characters work just fine.

    when I use a password that includes special characters I get the following error:

    TASK [Create Vlan] *******************************************************************************************************************************************
    failed: [10.0.232.254] (item={'vlanid': '1000', 'vlanname': 'INT-Clients_1'}) => {"ansible_loop_var": "item", "body": "{\"message\":\"Authentication failed.\"}", "changed": false, "connection": "close", "content-type": "application/json", "item": {"vlanid": "1000", "vlanname": "INT-Clients_1"}, "msg": "HTTP Error 400: Bad Request", "requestid": "", "server": "eHTTP v2.0", "status": 400, "transfer-encoding": "chunked", "url": "http://10.0.232.254:80/rest/v6.0/login-sessions"}

    When I connect with ssh or the webui with the special character password there is no problem at all.

    If something is wrong or stupid, please enlighten me.

    Best Regards

    Marc



  • 2.  RE: Ansible playbook special characters in password

    MVP GURU
    Posted Mar 27, 2024 04:13 AM

    Hi Marc,

    What the special character do you are using ?

    What the switch model / firmware ?

    May be also report the issue on github repo issue

    https://github.com/aruba/aos-switch-ansible-collection/issues



    ------------------------------
    PowerArubaSW : Powershell Module to use Aruba Switch API for Vlan, VlanPorts, LACP, LLDP...

    PowerArubaCP: Powershell Module to use ClearPass API (create NAD, Guest...)

    PowerArubaCL: Powershell Module to use Aruba Central

    PowerArubaCX: Powershell Module to use ArubaCX API (get interface/vlan/ports info)..

    ACEP / ACMX #107 / ACDX #1281
    ------------------------------



  • 3.  RE: Ansible playbook special characters in password

    Posted 30 days ago

    Hi,

    it is because of \.

    I tried: to escape \, $, ', and ", use a double quotation mark around the password or use the back slash (\) as the escape character.

    But that doesn't seem to work.

    HPE Aruba 2930M 48G PoE+ Switch (JL322A) 

    Image             Size (bytes) Date     Version
    ----------------- ------------ -------- --------------
    Primary Image    :    30252184 05/17/23 WC.16.11.0012




  • 4.  RE: Ansible playbook special characters in password

    Posted 30 days ago

    Hi @Soenke Knipp I'll take a look and see if I can reproduce this & find a cause/solution - thank you for your patience as we investigate!



    ------------------------------
    Ti Chiapuzio-Wong (they/them)
    HPE Aruba Networking
    ------------------------------