Forum Discussion

Jeff_42386's avatar
Jeff_42386
Icon for Nimbostratus rankNimbostratus
Feb 02, 2017

Modifying Auth TACACS config with Python or REST

Is it possible to use Python SDK or the REST API to change the TACACS+ configuration? I am running 11.5.3 and am having trouble finding documentation on either the REST calls themselves or how to script the calls using Python.

Ultimately I'll need to change a couple hundred vCMP hosts, LTM's and GTM's to point to a new TACACS+ server. I wanted to write a quick pythons script to look through my devices something like this...

for loadBalancer in loadBalancers:
    mgmt = ManagementRoot(loadBalancer['DeviceName'], username, password)
    tacacs = mgmt.tm.auth.tacacs.modify(\
        name="system-auth",\
        description="new tacacs server",\
        protocol="ip",\
        secret="$M$*******************",\
        servers="{ 10.10.10.1 10.10.10.2 }",\
        service="ppp"\
        )

Thanks in advance for any help!

Jeff

  • Jeff, I have not used the SDK before, but have you been able to make the config change in TMSH ? If you can do it in TMSH most of the time you can do things in REST. The only thing that might cause issues is how the secret is passed as an argument.

     

  • Yes, I was having that problem as well that the secret couldn't be decrypted. I ended up getting by it escaping special chars with '/'.