COMPONENT NAME
bigip_device_info (AS3 subset)
Environment
ANSIBLE VERSION
ansible [core 2.18.4]
BIGIP VERSION
BIG-IP 17.5.1.3
CONFIGURATION
Default ansible.cfg
No specific ANSIBLE_* environment variables set.
OS / ENVIRONMENT
Control node: Linux Ubuntu
Managed node: F5 BIG-IP
SUMMARY
The as3 subset of the bigip_device_info module always returns an empty
as3_config, even when AS3 is installed, used and properly configured on the BIG-IP.
STEPS TO REPRODUCE
Run the following playbook against:
- a BIG-IP with AS3 installed
- a BIG-IP without AS3 installed
The result is identical in both cases.
``
- name: Gather AS3 information
hosts: localhost
gather_facts: no
collections:
-
f5networks.f5_modules
tasks:
-
name: Get BIG-IP AS3 configuration
bigip_device_info:
provider:
server: "{{ server }}"
user: admin
password: "{{ password }}"
validate_certs: no
gather_subset:
-
debug:
var: result.as3_config
``
EXPECTED RESULTS
- When AS3 is installed,
as3_config should contain the AS3 declaration
retrieved from /mgmt/shared/appsvcs/declare.
- When AS3 is not installed,
as3_config should be an empty list.
ACTUAL RESULTS
as3_config is always an empty list ([]), regardless of whether AS3 is
installed or not.
"as3_config": []
ROOT CAUSE ANALYSIS
In As3FactManager.__init__(), installed_packages is evaluated before
calling BaseManager.__init__():
self.installed_packages = packages_installed(self.client)
super(As3FactManager, self).init(**kwargs)
At this stage, the client is not fully initialized, causing
packages_installed() to return an empty list.
As a result, the following condition always evaluates to true:
if 'as3' not in self.installed_packages:
return []
PROPOSED FIX
Move the packages_installed(self.client) call after
super().__init__() so the client is fully initialized:
def init(self, *args, **kwargs):
self.client = kwargs.get('client', None)
self.module = kwargs.get('module', None)
super(As3FactManager, self).init(**kwargs)
self.installed_packages = packages_installed(self.client)
This change correctly detects AS3 when installed and restores expected behavior.
COMPONENT NAME
bigip_device_info (AS3 subset)
Environment
ANSIBLE VERSION
ansible [core 2.18.4]
BIGIP VERSION
BIG-IP 17.5.1.3
CONFIGURATION
Default ansible.cfg
No specific ANSIBLE_* environment variables set.
OS / ENVIRONMENT
Control node: Linux Ubuntu
Managed node: F5 BIG-IP
SUMMARY
The
as3subset of thebigip_device_infomodule always returns an emptyas3_config, even when AS3 is installed, used and properly configured on the BIG-IP.STEPS TO REPRODUCE
Run the following playbook against:
The result is identical in both cases.
``
hosts: localhost
gather_facts: no
collections:
f5networks.f5_modules
tasks:
name: Get BIG-IP AS3 configuration
bigip_device_info:
provider:
server: "{{ server }}"
user: admin
password: "{{ password }}"
validate_certs: no
gather_subset:
register: result
debug:
var: result.as3_config
``
EXPECTED RESULTS
as3_configshould contain the AS3 declarationretrieved from
/mgmt/shared/appsvcs/declare.as3_configshould be an empty list.ACTUAL RESULTS
as3_configis always an empty list ([]), regardless of whether AS3 isinstalled or not.
"as3_config": []
ROOT CAUSE ANALYSIS
In
As3FactManager.__init__(),installed_packagesis evaluated beforecalling
BaseManager.__init__():self.installed_packages = packages_installed(self.client)
super(As3FactManager, self).init(**kwargs)
At this stage, the client is not fully initialized, causing
packages_installed()to return an empty list.As a result, the following condition always evaluates to true:
if 'as3' not in self.installed_packages:
return []
PROPOSED FIX
Move the
packages_installed(self.client)call aftersuper().__init__()so the client is fully initialized:def init(self, *args, **kwargs):
self.client = kwargs.get('client', None)
self.module = kwargs.get('module', None)
super(As3FactManager, self).init(**kwargs)
self.installed_packages = packages_installed(self.client)
This change correctly detects AS3 when installed and restores expected behavior.