Back to Ansible Reference

$ ansible-doc -t module cisco.sccfm.execute_ftd_cli

> MODULE cisco.sccfm.execute_ftd_cli (sccfm-ansible/plugins/modules/execute_ftd_cli.py)

  Execute a show command on one or more cdFMC-managed FTD devices.
  Devices can be selected by a Lucene query or by specifying a list of
  UIDs.
  Only show commands are supported (e.g. show version, show failover,
  show route).
  The command runs via the cdFMC bulk command proxy endpoint.
  See the SCC Firewall Manager API documentation for
  https://developer.cisco.com/docs/cisco-security-cloud-control-firewall-manager/create-bulk-command/
  endpoint details.

OPTIONS (= indicates it is required):

- command  The show command to execute on the FTD devices.
            Only show commands are supported (e.g. show version, show
            failover).
            Mutually exclusive with `commands'.
        default: null
        type: str

- commands  Single-item list containing the show command to execute
             on the FTD devices.
             Mutually exclusive with `command'. FTD bulk execution
             supports one command per request.
        default: null
        elements: str
        type: list

- config_path  Optional path to the canonical SCCFM profile
                configuration file.
        default: null
        type: path

- limit   Maximum number of devices to return when using `query'.
           Ignored when using `uids'.
        default: 50
        type: int

- offset  Pagination offset when using `query'.
           Ignored when using `uids'.
        default: 0
        type: int

- profile  Named SCCFM profile configured by `sccfm-cli configure'.
        default: default
        type: str

- query   Lucene query to filter cdFMC-managed FTD devices.
           Mutually exclusive with `uids'.
           The query is automatically combined with
           `deviceType:CDFMC_MANAGED_FTD'.
        default: null
        type: str

- uids    List of device UIDs to execute the command on.
           Mutually exclusive with `query'.
        default: null
        elements: str
        type: list

AUTHOR: Cisco SCCFM Team (@CiscoDevNet)

EXAMPLES:
# Example 1: Execute a show command on devices matching a query
- name: Show failover on all production FTDs
  cisco.sccfm.execute_ftd_cli:
    query: "name:prod-* AND connectivityState:ONLINE"
    command: "show failover"
    profile: default
  register: cli_results

# Example 2: Execute a command on specific devices by UID
- name: Show version on specific FTDs
  cisco.sccfm.execute_ftd_cli:
    uids:
      - "12345678-1234-1234-1234-123456789abc"
      - "87654321-4321-4321-4321-cba987654321"
    command: "show version"
  register: cli_results

# Example 3: Using module_defaults (recommended)
- name: Execute show commands on FTDs
  hosts: localhost
  gather_facts: false
  module_defaults:
    group/cisco.sccfm.all:
      profile: default
  tasks:
    - name: Show route on branch FTDs
      cisco.sccfm.execute_ftd_cli:
        query: "name:branch-* AND connectivityState:ONLINE"
        command: "show route"

RETURN VALUES:

- command  The show command that was executed.
        returned: success
        type: str

- commands  Single-item command list that was executed.
        elements: str
        returned: success
        type: list

- device_count  Number of target devices matched by the module.
        returned: success
        type: int

- results  List of CLI execution results per device.
        elements: dict
        returned: success
        type: list
        contains:

        - device_name  The device name.
          type: str

        - device_uuid  The FMC device record UUID.
          type: str

        - error_msg  Error message if execution failed (null if
                      successful).
          type: str

        - is_error  Whether execution failed on this device.
          type: bool

        - response  The CLI command output (null if error).
          type: str