engine_action - Node level actions on an engine

New in version 2.5.

Synopsis

  • Perform a node level action on the engine such as go_online, go_offline, generate initial_contact, reboot, etc

Options

parameter required default choices comments
actions
no
  • initial_contact
  • reboot
  • power_off
  • reset_to_factory
  • sginfo
  • ssh
  • change_ssh_pwd
  • time_sync
  • fetch_license
  • bind_license
  • unbind_license
  • cancel_unbind_license
  • go_offline
  • go_online
  • go_standby
  • lock_online
  • lock_offline
  • reset_user_db

Action to perform against the engine node. Some actions will optionally have additional arguments that can be provided

extra_args
no

Extra arguments to provide to action constructor. Arguments documented only show action choices that have specific extra args that are useful when calling the action Constructor arguments are documented at http://smc-python.readthedocs.io/en/latest/pages/reference.html#module-smc.core.node

name
yes

Provide the name of the engine for which to perform a node operation

nodeid
no 1

Provide a nodeid for the engine node to perform the action. For single FWs this is not required and will default to nodeid 1. For clusters, each node has a nodeid to represent which node to operate on

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
  • yes
  • no
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_logging
no
Optionally enable SMC API logging to a file
Dictionary object smc_logging
parameter required default choices comments
path
yes
Full path to the log file
level
no
Log level as specified by the standard python logging library, in int format. Default setting is logging.DEBUG.
smc_timeout
no

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


Examples

- name: Generate an initial contact configuration in base64 format
  hosts: localhost
  gather_facts: no
  tasks:
  - name: Layer 3 FW template
    register: command_output
    engine_action:
      smc_logging:
        level: 10
        path: ansible-smc.log
      name: myfw3
      nodeid: 1
      action: initial_contact
      extra_args:
        enable_ssh: true
        as_base64: true

  - debug: msg="{{ command_output.msg }}"

- name: Reboot node 1
  hosts: localhost
  gather_facts: no
  tasks:
  - name: Layer 3 FW template
    engine_action:
      name: myfw3
      nodeid: 1
      action: reboot
      extra_args:
        comment: reboot fw log entry

Return Values

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

name description returned type sample
msg
message attribute will be empty except for initial contact
always str
state
appliance status after performing the action
always dict {'status': 'Not Monitored', 'dyn_up': None, 'configuration_status': 'Declared', 'platform': 'N/A', 'state': 'NO_STATUS', 'installed_policy': None, 'version': 'unknown', 'name': 'myfw3 node 1'}


Notes

Note

Author

  • David LePage (@gabstopper)

Status

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