oci_load_balancer_facts - Fetches details of the OCI Load Balancer

New in version 2.5.

Synopsis

  • Fetches details of the OCI Load Balancer.

Requirements

The below requirements are needed on the host that executes this module.

Parameters

Parameter Choices/Defaults Comments
api_user
The OCID of the user, on whose behalf, OCI APIs are invoked. If not set, then the value of the OCI_USER_OCID environment variable, if any, is used. This option is required if the user is not specified through a configuration file (See config_file_location). To get the user's OCID, please refer https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm.
api_user_fingerprint
Fingerprint for the key pair being used. If not set, then the value of the OCI_USER_FINGERPRINT environment variable, if any, is used. This option is required if the key fingerprint is not specified through a configuration file (See config_file_location). To get the key pair's fingerprint value please refer https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm.
api_user_key_file
Full path and filename of the private key (in PEM format). If not set, then the value of the OCI_USER_KEY_FILE variable, if any, is used. This option is required if the private key is not specified through a configuration file (See config_file_location). If the key is encrypted with a pass-phrase, the api_user_key_pass_phrase option must also be provided.
api_user_key_pass_phrase
Passphrase used by the key referenced in api_user_key_file, if it is encrypted. If not set, then the value of the OCI_USER_KEY_PASS_PHRASE variable, if any, is used. This option is required if the key passphrase is not specified through a configuration file (See config_file_location).
auth_type
    Choices:
  • api_key ←
  • instance_principal
The type of authentication to use for making API requests. By default auth_type="api_key" based authentication is performed and the API key (see api_user_key_file) in your config file will be used. If this 'auth_type' module option is not specified, the value of the OCI_ANSIBLE_AUTH_TYPE, if any, is used. Use auth_type="instance_principal" to use instance principal based authentication when running ansible playbooks within an OCI compute instance.
compartment_id
Identifier of the compartment in which this Load Balancer exists
config_file_location
Path to configuration file. If not set then the value of the OCI_CONFIG_FILE environment variable, if any, is used. Otherwise, defaults to ~/.oci/config.
config_profile_name
The profile to load from the config file referenced by config_file_location. If not set, then the value of the OCI_CONFIG_PROFILE environment variable, if any, is used. Otherwise, defaults to the "DEFAULT" profile in config_file_location.
detail
    Choices:
  • full
  • simple
The level of detail to return for each result.
display_name
Use display_name along with the other options to return only resources that match the given display name exactly.
lifecycle_state
    Choices:
  • CREATING
  • FAILED
  • ACTIVE
  • DELETING
  • DELETED
A filter to return only resources that match the given lifecycle state.
load_balancer_id
Identifier of the Load Balancer whose details needs to be fetched.

aliases: id
region
The Oracle Cloud Infrastructure region to use for all OCI API requests. If not set, then the value of the OCI_REGION variable, if any, is used. This option is required if the region is not specified through a configuration file (See config_file_location). Please refer to https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/regions.htm for more information on OCI regions.
tenancy
OCID of your tenancy. If not set, then the value of the OCI_TENANCY variable, if any, is used. This option is required if the tenancy OCID is not specified through a configuration file (See config_file_location). To get the tenancy OCID, please refer https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm

Examples

#Fetch Load Balancer
- name: List Load Balancer
  oci_load_balancer_facts:
      compartment_id: 'ocid1.loadbalancer.oc1.iad.xxxxxEXAMPLExxxxx'

#Fetch specific Load Balancer
- name: List a specific Load Balancer
  oci_load_balancer_facts:
      load_balancer_id: 'ocid1.loadbalancer.oc1.iad.xxxxxEXAMPLExxxxx'

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description
load_balancers
complex
success
Attributes of the Load Balancers.

Sample:
[{'lifecycle_state': 'ACTIVE', 'display_name': 'ansible_lb955', 'shape_name': '100Mbps', 'compartment_id': 'ocid1.compartment.oc1..xxxxxEXAMPLExxxxx', 'ip_addresses': [{'is_public': True, 'ip_address': '129.213.72.32'}], 'time_created': '2018-01-06T18:22:17.198000+00:00', 'id': 'ocid1.loadbalancer.oc1.iad.xxxxxEXAMPLExxxxx', 'listeners': {'listener1': {'ssl_configuration': None, 'protocol': 'HTTP', 'name': 'listerner1', 'default_backend_set_name': 'backend1', 'connection_configuration': {'idle_timeout': 1200}, 'port': 80}}, 'certificates': {'certs1': {'certificate_name': 'certs1', 'public_certificate': '-----BEGIN CERTIFICATE-----\nMIIFKTCCBBGgAwIBAgISBIs5aiZ1fWapuAl2P9POFMXjMA0GCSqGSIb3DQEBCwUA\n- ----END CERTIFICATE-----', 'ca_certificate': '-----BEGIN CERTIFICATE-----\nMIIFKTCCBBGgAwIBAgISBIs5aiZ1fWapuAl2P9POFMXjMA0GCSqGSIb3DQEBCwUA\n-----END CERTIFICATE -----\n-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----'}}, 'subnet_ids': ['ocid1.subnet.oc1.iad.xxxxxEXAMPLExxxxx', 'ocid1.subnet.oc1.iad.xxxxxEXAMPLExxxxx'], 'backend_sets': {'backend1': {'ssl_configuration': None, 'backends': [{'drain': False, 'name': '10.159.34.21:8080', 'weight': 1, 'ip_address': '10.159.34.21', 'offline': False, 'backup': False, 'port': 8080}], 'health_checker': {'retries': 3, 'protocol': 'HTTP', 'response_body_regex': '^(500|40[1348])$', 'return_code': 200, 'timeout_in_millis': 6000, 'interval_in_millis': 30000, 'url_path': '/healthcheck', 'port': 8080}, 'name': 'backend1', 'policy': 'LEAST_CONNECTIONS', 'session_persistence_configuration': None}}, 'path_route_sets': {'ansible_path_route_set': {'path_routes': [{'path': '/example/user', 'backend_set_name': 'ansible_backend_set', 'path_match_type': {'match_type': 'EXACT_MATCH'}}]}}, 'is_private': False}]
  lifecycle_state
string
always
The current state of the Load Balancer

Sample:
ACTIVE
  display_name
string
always
Name assigned to the Load Balancer during creation

Sample:
ansible_lb
  shape_name
string
always
A template that determines the total pre-provisioned bandwidth (ingress plus egress).

Sample:
100Mbps
  compartment_id
string
always
The identifier of the compartment containing the Load Balancer

Sample:
ocid1.loadbalancer.oc1.iad.xxxxxEXAMPLExxxxx
  time_created
datetime
always
Date and time when the Load Balancer was created, in the format defined by RFC3339

Sample:
2016-08-25 21:10:29.600000
  id
string
always
Identifier of the Load Balancer

Sample:
ocid1.loadbalancer.oc1.iad.xxxxxEXAMPLExxxxx
  listeners
dict
always
The listener configuration details.

Sample:
{'listerner1': {'ssl_configuration': None, 'protocol': 'HTTP', 'name': 'listerner1', 'default_backend_set_name': 'backend1', 'connection_configuration': {'idle_timeout': 1200}, 'port': 80}}
  certificates
dict
always
The configuration details for a listener certificate bundle.

Sample:
{'certs1': {'certificate_name': 'certs1', 'public_certificate': '-----BEGIN CERTIFICATE----- MIIFKTCCBBGgAwIBAgISBIs5aiZ1fWapuAl2P9POFMXjMA0GCSqGSIb3DQEBCwUA\n -----END CERTIFICATE-----', 'ca_certificate': '-----BEGIN CERTIFICATE-----\nMIIFKTCCBBGgAwIBAgISBIs5aiZ1fWapuAl2P9POFMXjMA0GCSqGSIb3DQEBCwUA\n -----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----'}}
  subnet_ids
list
always
An array of subnet OCIDs.

Sample:
['ocid1.subnet.oc1.iad.xxxxxEXAMPLExxxxx', 'ocid1.subnet.oc1.iad.xxxxxEXAMPLExxxxx']
  backend_sets
dict
always
The configuration details for a load balancer backend set

Sample:
{'backend1': {'backends': [{'drain': False, 'name': '10.159.34.21:8080', 'weight': 1, 'ip_address': '10.159.34.21', 'offline': False, 'backup': False, 'port': 8080}], 'health_checker': {'retries': 3, 'protocol': 'HTTP', 'name': 'backend1', 'response_body_regex': '^(500|40[1348])$', 'return_code': 200, 'ssl_configuration': None, 'timeout_in_millis': 6000, 'policy': 'LEAST_CONNECTIONS', 'interval_in_millis': 30000, 'url_path': '/healthcheck', 'port': 8080, 'session_persistence_configuration': None}}}
  path_route_sets
dict
always
The path route sets configuration details.

Sample:
{'ansible_path_route_set': {'path_routes': [{'path': '/example/user', 'backend_set_name': 'ansible_backend_set', 'path_match_type': {'match_type': 'EXACT_MATCH'}}]}}


Status

This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.

This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.

Author

  • Debayan Gupta(@debayan_gupta)

Hint

If you notice any issues in this documentation you can edit this document to improve it.