oracle.oci.oci_dns_steering_policy_facts (5.0.0) — module

Fetches details about one or multiple SteeringPolicy resources in Oracle Cloud Infrastructure

| "added in version" 2.9.0 of oracle.oci"

Authors: Oracle (@oracle)

preview | supported by community

Install collection

Install with ansible-galaxy collection install oracle.oci:==5.0.0


Add to requirements.yml

  collections:
    - name: oracle.oci
      version: 5.0.0

Description

Fetches details about one or multiple SteeringPolicy resources in Oracle Cloud Infrastructure

Gets a list of all steering policies in the specified compartment.

If I(steering_policy_id) is specified, the details of a single SteeringPolicy will be returned.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Get a specific steering_policy
  oci_dns_steering_policy_facts:
    # required
    steering_policy_id: "ocid1.steeringpolicy.oc1..xxxxxxEXAMPLExxxxxx"

    # optional
    if_modified_since: if_modified_since_example
    scope: GLOBAL
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: List steering_policies
  oci_dns_steering_policy_facts:
    # required
    compartment_id: "ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx"

    # optional
    display_name: display_name_example
    display_name_contains: display_name_contains_example
    health_check_monitor_id: "ocid1.healthcheckmonitor.oc1..xxxxxxEXAMPLExxxxxx"
    time_created_greater_than_or_equal_to: 2013-10-20T19:20:30+01:00
    time_created_less_than: 2013-10-20T19:20:30+01:00
    template: template_example
    lifecycle_state: ACTIVE
    sort_by: displayName
    sort_order: ASC
    scope: GLOBAL

Inputs

    
scope:
    choices:
    - GLOBAL
    - PRIVATE
    description:
    - Specifies to operate only on resources that have a matching DNS scope.
    type: str

region:
    description:
    - 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 C(config_file_location)).
      Please refer to U(https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/regions.htm)
      for more information on OCI regions.
    type: str

sort_by:
    choices:
    - displayName
    - timeCreated
    - template
    description:
    - The field by which to sort steering policies. If unspecified, defaults to `timeCreated`.
    type: str

tenancy:
    description:
    - 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 C(config_file_location)). To get the tenancy OCID, please
      refer U(https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm)
    type: str

api_user:
    description:
    - The OCID of the user, on whose behalf, OCI APIs are invoked. If not set, then the
      value of the OCI_USER_ID environment variable, if any, is used. This option is required
      if the user is not specified through a configuration file (See C(config_file_location)).
      To get the user's OCID, please refer U(https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm).
    type: str

template:
    description:
    - Search by steering template type. Will match any resource whose template type matches
      the provided value.
    type: str

auth_type:
    choices:
    - api_key
    - instance_principal
    - instance_obo_user
    - resource_principal
    - security_token
    default: api_key
    description:
    - The type of authentication to use for making API requests. By default C(auth_type="api_key")
      based authentication is performed and the API key (see I(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 C(auth_type="instance_principal")
      to use instance principal based authentication when running ansible playbooks within
      an OCI compute instance.
    type: str

sort_order:
    choices:
    - ASC
    - DESC
    description:
    - The order to sort the resources.
    type: str

cert_bundle:
    description:
    - The full path to a CA certificate bundle to be used for SSL verification. This will
      override the default CA certificate bundle. If not set, then the value of the OCI_ANSIBLE_CERT_BUNDLE
      variable, if any, is used.
    type: str

auth_purpose:
    choices:
    - service_principal
    description:
    - The auth purpose which can be used in conjunction with 'auth_type=instance_principal'.
      The default auth_purpose for instance_principal is None.
    type: str

display_name:
    aliases:
    - name
    description:
    - The displayName of a resource.
    type: str

compartment_id:
    description:
    - The OCID of the compartment the resource belongs to.
    - Required to list multiple steering_policies.
    type: str

lifecycle_state:
    choices:
    - ACTIVE
    - CREATING
    - DELETED
    - DELETING
    description:
    - The state of a resource.
    type: str

api_user_key_file:
    description:
    - 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 C(config_file_location)).
      If the key is encrypted with a pass-phrase, the C(api_user_key_pass_phrase) option
      must also be provided.
    type: str

if_modified_since:
    description:
    - The `If-Modified-Since` header field makes a GET or HEAD request method conditional
      on the selected representation's modification date being more recent than the date
      provided in the field-value.  Transfer of the selected representation's data is
      avoided if that data has not changed.
    type: str

steering_policy_id:
    aliases:
    - id
    description:
    - The OCID of the target steering policy.
    - Required to get a specific steering_policy.
    type: str

config_profile_name:
    description:
    - The profile to load from the config file referenced by C(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 C(config_file_location).
    type: str

api_user_fingerprint:
    description:
    - 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 C(config_file_location)). To
      get the key pair's fingerprint value please refer U(https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm).
    type: str

config_file_location:
    description:
    - 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.
    type: str

display_name_contains:
    description:
    - The partial displayName of a resource. Will match any resource whose name (case-insensitive)
      contains the provided value.
    type: str

time_created_less_than:
    description:
    - An L(RFC 3339,https://www.ietf.org/rfc/rfc3339.txt) timestamp that states all returned
      resources were created before the indicated time.
    type: str

health_check_monitor_id:
    description:
    - Search by health check monitor OCID. Will match any resource whose health check
      monitor ID matches the provided value.
    type: str

api_user_key_pass_phrase:
    description:
    - Passphrase used by the key referenced in C(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 C(config_file_location)).
    type: str

time_created_greater_than_or_equal_to:
    description:
    - An L(RFC 3339,https://www.ietf.org/rfc/rfc3339.txt) timestamp that states all returned
      resources were created on or after the indicated time.
    type: str

realm_specific_endpoint_template_enabled:
    description:
    - Enable/Disable realm specific endpoint template for service client. By Default,
      realm specific endpoint template is disabled. If not set, then the value of the
      OCI_REALM_SPECIFIC_SERVICE_ENDPOINT_TEMPLATE_ENABLED variable, if any, is used.
    type: bool

Outputs

steering_policies:
  contains:
    _self:
      description:
      - The canonical absolute URL of the resource.
      returned: on success
      sample: _self_example
      type: str
    answers:
      contains:
        is_disabled:
          description:
          - Set this property to `true` to indicate that the answer is administratively
            disabled, such as when the corresponding server is down for maintenance.
            An answer's `isDisabled` property can be referenced in `answerCondition`
            properties in rules using `answer.isDisabled`.
          - "\"**Example:**\n  \\\"rules\\\": [\n    {\n      \\\"ruleType\\\": \\\
            \"FILTER\\\",\n      \\\"defaultAnswerData\\\": [\n        {\n       \
            \   \\\"answerCondition\\\": \\\"answer.isDisabled != true\\\",\n    \
            \      \\\"shouldKeep\\\": true\n        }\n      ]\n    },\"\n"
          returned: on success
          sample: true
          type: bool
        name:
          description:
          - A user-friendly name for the answer, unique within the steering policy.
            An answer's `name` property can be referenced in `answerCondition` properties
            of rules using `answer.name`.
          - '**Example:**'
          - "\" \\\"rules\\\": [\n    {\n      \\\"ruleType\\\": \\\"FILTER\\\",\n\
            \      \\\"defaultAnswerData\\\":  [\n        {\n          \\\"answerCondition\\\
            \": \\\"answer.name == 'server 1'\\\",\n          \\\"shouldKeep\\\":\
            \ true\n        }\n      ]\n    }\n  ]\"\n"
          returned: on success
          sample: name_example
          type: str
        pool:
          description:
          - The freeform name of a group of one or more records in which this record
            is included, such as "LAX data center". An answer's `pool` property can
            be referenced in `answerCondition` properties of rules using `answer.pool`.
          - '**Example:**'
          - "\" \\\"rules\\\": [\n    {\n      \\\"ruleType\\\": \\\"FILTER\\\",\n\
            \      \\\"defaultAnswerData\\\":  [\n        {\n          \\\"answerCondition\\\
            \": \\\"answer.pool == 'US East Servers'\\\",\n          \\\"shouldKeep\\\
            \": true\n        }\n      ]\n    }\n  ]\"\n"
          returned: on success
          sample: pool_example
          type: str
        rdata:
          description:
          - The record's data, as whitespace-delimited tokens in type-specific presentation
            format. All RDATA is normalized and the returned presentation of your
            RDATA may differ from its initial input. For more information about RDATA,
            see L(Supported DNS Resource Record Types,https://docs.cloud.oracle.com/iaas/Content/DNS/Reference/supporteddnsresource.htm).
          returned: on success
          sample: rdata_example
          type: str
        rtype:
          description:
          - The type of DNS record, such as A or CNAME. Only A, AAAA, and CNAME are
            supported. For more information, see L(Supported DNS Resource Record Types,https://docs.cloud.oracle.com/iaas/Content/DNS/Reference/supporteddnsresource.htm).
          returned: on success
          sample: rtype_example
          type: str
      description:
      - The set of all answers that can potentially issue from the steering policy.
      - Returned for get operation
      returned: on success
      type: complex
    compartment_id:
      description:
      - The OCID of the compartment containing the steering policy.
      returned: on success
      sample: ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx
      type: str
    defined_tags:
      description:
      - Defined tags for this resource. Each key is predefined and scoped to a namespace.
        For more information, see L(Resource Tags,https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm).
      - '**Example:** `{"Operations": {"CostCenter": "42"}}`'
      returned: on success
      sample:
        Operations:
          CostCenter: US
      type: dict
    display_name:
      description:
      - A user-friendly name for the steering policy. Does not have to be unique and
        can be changed. Avoid entering confidential information.
      returned: on success
      sample: display_name_example
      type: str
    freeform_tags:
      description:
      - Free-form tags for this resource. Each tag is a simple key-value pair with
        no predefined name, type, or namespace. For more information, see L(Resource
        Tags,https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm).
      - '**Example:** `{"Department": "Finance"}`'
      returned: on success
      sample:
        Department: Finance
      type: dict
    health_check_monitor_id:
      description:
      - The OCID of the health check monitor providing health data about the answers
        of the steering policy. A steering policy answer with `rdata` matching a monitored
        endpoint will use the health data of that endpoint. A steering policy answer
        with `rdata` not matching any monitored endpoint will be assumed healthy.
      - '**Note:** To use the Health Check monitoring feature in a steering policy,
        a monitor must be created using the Health Checks service first. For more
        information on how to create a monitor, please see L(Managing Health Checks,https://docs.cloud.oracle.com/iaas/Content/HealthChecks/Tasks/managinghealthchecks.htm).'
      returned: on success
      sample: ocid1.healthcheckmonitor.oc1..xxxxxxEXAMPLExxxxxx
      type: str
    id:
      description:
      - The OCID of the resource.
      returned: on success
      sample: ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx
      type: str
    lifecycle_state:
      description:
      - The current state of the resource.
      returned: on success
      sample: ACTIVE
      type: str
    rules:
      contains:
        cases:
          contains:
            answer_data:
              contains:
                answer_condition:
                  description:
                  - An expression that is used to select a set of answers that match
                    a condition. For example, answers with matching pool properties.
                  returned: on success
                  sample: answer_condition_example
                  type: str
                should_keep:
                  description:
                  - Keeps the answer only if the value is `true`.
                  returned: on success
                  sample: true
                  type: bool
                value:
                  description:
                  - The rank assigned to the set of answers that match the expression
                    in `answerCondition`. Answers with the lowest values move to the
                    beginning of the list without changing the relative order of those
                    with the same value. Answers can be given a value between `0`
                    and `255`.
                  returned: on success
                  sample: 56
                  type: int
              description:
              - An array of `SteeringPolicyFilterAnswerData` objects.
              returned: on success
              type: complex
            case_condition:
              description:
              - An expression that uses conditions at the time of a DNS query to indicate
                whether a case matches. Conditions may include the geographical location,
                IP subnet, or ASN the DNS query originated. **Example:** If you have
                an office that uses the subnet `192.0.2.0/24` you could use a `caseCondition`
                expression `query.client.address in ('192.0.2.0/24')` to define a
                case that matches queries from that office.
              returned: on success
              sample: case_condition_example
              type: str
            count:
              description:
              - 'The number of answers allowed to remain after the limit rule has
                been processed, keeping only the first of the remaining answers in
                the list. Example: If the `count` property is set to `2` and four
                answers remain before the limit rule is processed, only the first
                two answers in the list will remain after the limit rule has been
                processed.'
              returned: on success
              sample: 56
              type: int
          description:
          - An array of `caseConditions`. A rule may optionally include a sequence
            of cases defining alternate configurations for how it should behave during
            processing for any given DNS query. When a rule has no sequence of `cases`,
            it is always evaluated with the same configuration during processing.
            When a rule has an empty sequence of `cases`, it is always ignored during
            processing. When a rule has a non-empty sequence of `cases`, its behavior
            during processing is configured by the first matching `case` in the sequence.
            When a rule has no matching cases the rule is ignored. A rule case with
            no `caseCondition` always matches. A rule case with a `caseCondition`
            matches only when that expression evaluates to true for the given query.
          returned: on success
          type: complex
        default_answer_data:
          contains:
            answer_condition:
              description:
              - An expression that is used to select a set of answers that match a
                condition. For example, answers with matching pool properties.
              returned: on success
              sample: answer_condition_example
              type: str
            should_keep:
              description:
              - Keeps the answer only if the value is `true`.
              returned: on success
              sample: true
              type: bool
            value:
              description:
              - The rank assigned to the set of answers that match the expression
                in `answerCondition`. Answers with the lowest values move to the beginning
                of the list without changing the relative order of those with the
                same value. Answers can be given a value between `0` and `255`.
              returned: on success
              sample: 56
              type: int
          description:
          - Defines a default set of answer conditions and values that are applied
            to an answer when `cases` is not defined for the rule, or a matching case
            does not have any matching `answerCondition`s in its `answerData`. `defaultAnswerData`
            is not applied if `cases` is defined and there are no matching cases.
            In this scenario, the next rule will be processed.
          returned: on success
          type: complex
        default_count:
          description:
          - Defines a default count if `cases` is not defined for the rule or a matching
            case does not define `count`. `defaultCount` is **not** applied if `cases`
            is defined and there are no matching cases. In this scenario, the next
            rule will be processed. If no rules remain to be processed, the answer
            will be chosen from the remaining list of answers.
          returned: on success
          sample: 56
          type: int
        description:
          description:
          - A user-defined description of the rule's purpose or behavior.
          returned: on success
          sample: description_example
          type: str
        rule_type:
          description:
          - The type of a rule determines its sorting/filtering behavior. * `FILTER`
            - Filters the list of answers based on their defined boolean data. Answers
            remain only if their `shouldKeep` value is `true`.
          - '* `HEALTH` - Removes answers from the list if their `rdata` matches a
            target in the health check monitor referenced by the steering policy and
            the target is reported down.'
          - '* `WEIGHTED` - Uses a number between 0 and 255 to determine how often
            an answer will be served in relation to other answers. Anwers with a higher
            weight will be served more frequently.'
          - '* `PRIORITY` - Uses a defined rank value of answers to determine which
            answer to serve, moving those with the lowest values to the beginning
            of the list without changing the relative order of those with the same
            value. Answers can be given a value between `0` and `255`.'
          - '* `LIMIT` - Filters answers that are too far down the list. Parameter
            `defaultCount` specifies how many answers to keep. **Example:** If `defaultCount`
            has a value of `2` and there are five answers left, when the `LIMIT` rule
            is processed, only the first two answers will remain in the list.'
          returned: on success
          sample: FILTER
          type: str
      description:
      - The series of rules that will be processed in sequence to reduce the pool
        of answers to a response for any given request.
      - The first rule receives a shuffled list of all answers, and every other rule
        receives the list of answers emitted by the one preceding it. The last rule
        populates the response.
      - Returned for get operation
      returned: on success
      type: complex
    template:
      description:
      - A set of predefined rules based on the desired purpose of the steering policy.
        Each template utilizes Traffic Management's rules in a different order to
        produce the desired results when answering DNS queries.
      - '**Example:** The `FAILOVER` template determines answers by filtering the
        policy''s answers using the `FILTER` rule first, then the following rules
        in succession: `HEALTH`, `PRIORITY`, and `LIMIT`. This gives the domain dynamic
        failover capability.'
      - It is **strongly recommended** to use a template other than `CUSTOM` when
        creating a steering policy.
      - All templates require the rule order to begin with an unconditional `FILTER`
        rule that keeps answers contingent upon `answer.isDisabled != true`, except
        for `CUSTOM`. A defined `HEALTH` rule must follow the `FILTER` rule if the
        policy references a `healthCheckMonitorId`. The last rule of a template must
        must be a `LIMIT` rule. For more information about templates and code examples,
        see L(Traffic Management API Guide,https://docs.cloud.oracle.com/iaas/Content/TrafficManagement/Concepts/trafficmanagementapi.htm).
      - '**Template Types**'
      - '* `FAILOVER` - Uses health check information on your endpoints to determine
        which DNS answers to serve. If an endpoint fails a health check, the answer
        for that endpoint will be removed from the list of available answers until
        the endpoint is detected as healthy.'
      - '* `LOAD_BALANCE` - Distributes web traffic to specified endpoints based on
        defined weights.'
      - '* `ROUTE_BY_GEO` - Answers DNS queries based on the query''s geographic location.
        For a list of geographic locations to route by, see L(Traffic Management Geographic
        Locations,https://docs.cloud.oracle.com/iaas/Content/TrafficManagement/Reference/trafficmanagementgeo.htm).'
      - '* `ROUTE_BY_ASN` - Answers DNS queries based on the query''s originating
        ASN.'
      - '* `ROUTE_BY_IP` - Answers DNS queries based on the query''s IP address.'
      - '* `CUSTOM` - Allows a customized configuration of rules.'
      returned: on success
      sample: FAILOVER
      type: str
    time_created:
      description:
      - The date and time the resource was created, expressed in RFC 3339 timestamp
        format.
      - '**Example:** `2016-07-22T17:23:59:60Z`'
      returned: on success
      sample: '2013-10-20T19:20:30+01:00'
      type: str
    ttl:
      description:
      - The Time To Live (TTL) for responses from the steering policy, in seconds.
        If not specified during creation, a value of 30 seconds will be used.
      returned: on success
      sample: 56
      type: int
  description:
  - List of SteeringPolicy resources
  returned: on success
  sample:
  - _self: _self_example
    answers:
    - is_disabled: true
      name: name_example
      pool: pool_example
      rdata: rdata_example
      rtype: rtype_example
    compartment_id: ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx
    defined_tags:
      Operations:
        CostCenter: US
    display_name: display_name_example
    freeform_tags:
      Department: Finance
    health_check_monitor_id: ocid1.healthcheckmonitor.oc1..xxxxxxEXAMPLExxxxxx
    id: ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx
    lifecycle_state: ACTIVE
    rules:
    - cases:
      - answer_data:
        - answer_condition: answer_condition_example
          should_keep: true
          value: 56
        case_condition: case_condition_example
        count: 56
      default_answer_data:
      - answer_condition: answer_condition_example
        should_keep: true
        value: 56
      default_count: 56
      description: description_example
      rule_type: FILTER
    template: FAILOVER
    time_created: '2013-10-20T19:20:30+01:00'
    ttl: 56
  type: complex