stormshield.sns.sns_command module – SNS command

Note

This module is part of the stormshield.sns collection (version 1.0.2).

It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install stormshield.sns.

To use it in a playbook, specify: stormshield.sns.sns_command.

Synopsis

Parameters

Parameter

Comments

appliance

dictionary / required

SNS appliance connection parameters

cabundle

string

Path to the CA bundle file

Default: "none"

host

string / required

Hostname or ip

ip

string

IP address

password

string

Connection password

port

integer

Port to connect

Default: 443

proxy

string

Proxy URL (scheme://user:password@host:port)

Default: "none"

sslverifyhost

boolean

Strict SSL host name check

Choices:

  • false

  • true ← (default)

sslverifypeer

boolean

Strict SSL CA check

Choices:

  • false

  • true ← (default)

user

string

User name

Default: "admin"

usercert

string

Path to the user certificate file

Default: "none"

command

string

Command to execute (one of command or script parameters is required).

expect_disconnect

boolean

Set to True if the script makes the remote appliance to disconnect (ie: install firmware update).

Choices:

  • false ← (default)

  • true

force_modify

boolean

Set to true to disconnect other administrator already connected with modify privilege.

Choices:

  • false ← (default)

  • true

script

string

Configuration script to execute (one of command or script parameters is required).

timeout

integer

Set the connection and read timeout.

Default: 30

Notes

Note

  • This module requires the stormshield.sns.sslclient python library

Examples

- name: Get appliance properties
  stormshield.sns.sns_command:
    script: "SYSTEM PROPERTY"
    appliance:
      host: myappliance.local
      password: mypassword

- name: Update firmware with a local update file
  stormshield.sns.sns_command:
    script: |
      SYSTEM UPDATE UPLOAD < /tmp/fwupd-SNS-3.7.1-amd64-M.maj
      SYSTEM UPDATE ACTIVATE
    expect_disconnect: True
    appliance:
      host: myappliance.local
      password: mypassword

Return Values

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

Key

Description

data

complex

last parsed command result

Returned: success

Sample: {"Result": [{"keynum": "none", "name": "ntp1.stormshieldcs.eu", "type": "host"}, {"keynum": "none", "name": "ntp2.stormshieldcs.eu", "type": "host"}]}

output

string

script execution output

Returned: changed

Sample: "> CONFIG NTP SERVER LIST\n101 code=00a01000 msg=\"Begin\" format=\"section_line\"\n[Result]\nname=fr.pool.ntp.org keynum=none type=host\n100 code=00a00100 msg=\"Ok\"\n> HELP\n101 code=00a01000 msg=\"Begin\" format=\"raw\"\nAUTH       : User authentication\nCHPWD      : Return if it's necessary to update password or not\nCONFIG     : Firewall configuration functions\nGLOBALADMIN : Global administration\nHA         : HA functions\nHELP       : Display available commands\nLIST       : Display the list of connected users, show user rights (Level) and rights for current session (SessionLevel).\nLOG        : Log related functions.Everywhere a timezone is needed, if not specified the command is treated with firewall timezone setting.\nMODIFY     : Get / lose the modify or the mon_write right\nMONITOR    : Monitor related functions\nNOP        : Do nothing but avoid disconnection from server.\nPKI        : show or update the pki\nQUIT       : Log off\nREPORT     : Handling of reports\nSYSTEM     : System commands\nUSER       : User related functions\nVERSION    : Display server version\n100 code=00a00100 msg=\"Ok\"\n"

result

string

last command output

Returned: changed

Sample: "101 code=00a01000 msg=\"Begin\" format=\"section_line\"\n[Result]\nname=ntp1.stormshieldcs.eu keynum=none type=host\nname=ntp2.stormshieldcs.eu keynum=none type=host\n100 code=00a00100 msg=\"Ok\"\n"

ret

integer

last command return code

Returned: changed

Sample: 100

Authors

  • Remi Pauchet (@remip2)