service_facts - Facts about service elements in the SMC

New in version 2.5.

Synopsis

  • Service elements can be used as references in many areas of the configuration. This fact module provides the ability to retrieve information related to elements and their values.

Options

parameter required default choices comments
case_sensitive
no True

Whether to do a case sensitive match on the filter specified

element
no *
  • protocol
  • tcp_service
  • udp_service
  • ip_service
  • icmp_service
  • url_category
  • icmp_ipv6_service
  • ethernet_service
  • application_situation

Type of service element to retrieve

exact_match
no

Whether to do an exact match on the filter specified

filter
no *

String value to match against when making query. Matches all if not specified. A filter will attempt to find a match in the name, primary key field or comment field of a given record.

limit
no 10

Limit the number of results. Set to 0 to remove limit.

smc_address
no

FQDN with port of SMC. The default value is the environment variable SMC_ADDRESS

smc_alt_filepath
no

Provide an alternate path location to read the credentials from. File is expected to be stored in ~.smcrc. If provided, url and api_key settings are not required and will be ignored.

smc_api_key
no

API key for api client. The default value is the environment variable SMC_API_KEY Required if url

smc_api_version
no

Optional API version to connect to. If none is provided, the latest SMC version API will be used based on the Management Center version. Can be set though the environment variable SMC_API_VERSION

smc_domain
no

Optional domain to log in to. If no domain is provided, 'Shared Domain' is used. Can be set throuh the environment variable SMC_DOMAIN

smc_extra_args
no
Extra arguments to pass to login constructor. These are generally only used if specifically requested by support personnel.
Dictionary object smc_extra_args
parameter required default choices comments
verify
no True
Is the connection to SMC is HTTPS, you can set this to True, or provide a path to a client certificate to verify the SMC SSL certificate. You can also explicitly set this to False.
smc_timeout
no

Optional timeout for connections to the SMC. Can be set through environment SMC_TIMEOUT


Examples

- name: Return all services with limit
  service_facts:
    limit: 10

- name: Return only tcp service elements
  service_facts:
    element: tcp_service

- name: Return services with 80 in the value (will match defined ports)
  service_facts:
    limit: 10
    element: tcp_service
    filter: 80

- name: Find applications related to facebook
  service_facts:
    element: application_situation
    filter: facebook

Return Values

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

name description returned type sample
services
All TCP services with filter of '80'
always list [{'comment': '', 'max_dst_port': None, 'type': 'tcp_service', 'name': 'tcp80443', 'min_dst_port': 443}, {'comment': 'Element created for NAT Service', 'max_dst_port': None, 'type': 'tcp_service', 'name': 'HTTP_tcp_port_80', 'min_dst_port': 80}]


Notes

Note

  • If a filter is not used in the query, this will return all results for the element type. The return data in this case will only contain the meta data for the element which will be name and type.

Author

  • David LePage (@gabstopper)

Status

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