Forum Discussion

PJ_Willow's avatar
PJ_Willow
Icon for Nimbostratus rankNimbostratus
Jun 13, 2022

How To Get Sync-Status From Ansible

Hi All
I am trying to automate our F5 checks in Ansible. I have been able to ge the active/standy part functioning but I'm struggling with the sync status. It seems that the version the F5 LTM module in Ansible Galaxy does not have a module to get the sync status. In the GIT repo I can see the "bigip_device_info" module has a "sync-status". I could try and add the new vesion locally but I would have issues doing this in Ansible Tower.

I thought I would try and interact with the API directly but when testing in Postman I dont' get a response from the following request.

 

GET https://10.x.x.x/mgmt/tm/cm/sync-status
200
51 ms
Warning: Unable to verify the first certificate
Network
Request Headers
bigip_a_auth_token: 
X-F5-Auth-Token: UCJB4QL34B5KUBIGHYG65J6XT2
Content-Type: application/json
User-Agent: PostmanRuntime/7.29.0
Accept: */*
Postman-Token: b7513718-e85a-4591-800c-4e377f52ec8b
Host: 10.x.x.x
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Cookie: BIGIPAuthCookie=DEihWNJW0rncm10rwvB4MXNWihLY969IJ89Ede4v; BIGIPAuthUsernameCookie=SVC-PRD-NET-F5-RO

 

In my auth request I am setting the provider to tmos, not sure if this is correct as we use TACACS but it works.

Can anoyne advise the easiest way for me to get the sync status?

2 Replies

  • that is the right method. check your logs to see if there was a local error on the BIG-IP. From bigrest in python:

    In[3]: from bigrest.bigip import BIGIP
    In[4]: b = BIGIP('ltm3.test.local', 'admin', 'admin', request_token=True)
    In[5]: x = b.load('/mgmt/tm/cm/sync-status')
    In[6]: print(x.properties.get('entries'))
    Out[6]: {'https://localhost/mgmt/tm/cm/sync-status/0': {'nestedStats': {'entries': {'color': {'description': 'green'}, 'https://localhost/mgmt/tm/cm/syncStatus/0/details': {'nestedStats': {'entries': {'https://localhost/mgmt/tm/cm/syncStatus/0/details/0': {'nestedStats': {'entries': {'details': {'description': 'Optional action: Add a device to the trust domain'}}}}}}}, 'mode': {'description': 'standalone'}, 'status': {'description': 'Standalone'}, 'summary': {'description': ' '}}}}}
    
  • PJ_Willow - If your post was solved it would be helpful to the community if you selected *Accept As Solution* on the relevant reply (or replies). This helps future readers find answers more quickly and confirms the efforts of those who helped.

    Thanks for being part of our community.
    Lief