Hi,

I don't know much about this module, or even F5 BigIP product API, but this 
path seems to be the default REST API uri path for ucs : 
https://clouddocs.f5.com/api/icontrol-rest/APIRef_tm_sys_ucs.html.
This path is indeed hardcoded in bigip_ucs_fetch module 
($ansibleCollectionsInstallPath/f5networks/f5_modules/plugins/modules/bigip_ucs_fetch.py)
 
:
def read_current_from_device(self):
        uri = "https://{0}:{1}/mgmt/tm/sys/ucs".format(
            self.client.provider['server'],
            self.client.provider['server_port'],
        )
        resp = self.client.api.get(uri)
        ...

This is for V2Manager class, whatever this means (seems to be in use for 
TMOS >=12.1.0). V1Manager class (so <12.1.0) uses this one : 
https://{0}:{1}/mgmt/tm/util/bash.

A version check happen at the start of the script :

    def is_version_v1(self):
        """Checks to see if the TMOS version is less than 12.1.0

        Versions prior to 12.1.0 have a bug which prevents the REST
        API from properly listing any UCS files when you query the
        /mgmt/tm/sys/ucs endpoint. Therefore you need to do everything
        through tmsh over REST.

        :return: bool
        """
        version = tmos_version(self.client)
        if Version(version) < Version('12.1.0'):
            return True
        else:
            return False

Which seems to indicate you could still query the REST API over tmsh 
<https://clouddocs.f5.com/api/tmsh/>. A quick Google search indicate that 
it uses /mgmt/tm/util/bash as path, therefore corresponding the V1Manager 
class referenced in ansible module.
I don't know why you can't seem to be able to reach the default ucs API 
endpoint path on your instances, if that's something expected or if F5 
changed something on more recent version, but you can perhaps still 
manually use the v1 path with ansible.builtin.uri module or shell / command 
to achieve what you're trying to do. You could also manually change path in 
module file and maintain a fork module of your own.

I'd start to look into changelog for a potential API path change or 
something like that. Maybe try to query this endpoint manually through 
curl, and some others so you might have a better idea on what is happening. 
The error message you got might not be accurate, or it might mask an 
underlying one.
Hope this helps !


Le lundi 31 juillet 2023 à 19:41:12 UTC+2, kyle jones a écrit :

> Hello,
>
> Using the Bigip_ucs_fetch module to pull a UCS backup. I keep getting not 
> found, since in the source code of the module its appending 
> /mgmt/tm/sys/ucs to the url path: https://IP:Port/mgmt/tm/sys/ucs.
>
> What is your f5 configuration doesn't use that path? Has anyone found a 
> workaround?
>
> Using F5 version 16.1.3.
>
> Regards,
>
> Kyle
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/86190842-ce04-4d04-801c-bb708b46e1d2n%40googlegroups.com.

Reply via email to