stormshield.sns.sns_command module – SNS command

Note

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

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

string

appliance connection’s parameters (host, port, user, password, sslverifypeer, sslverifyhost, cabundle, usercert, proxy)

expect_disconnect

string

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

force_modify

string

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

script

string

Configuration script to execute

timeout

string

Set the connection and read timeout.

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 (@stormshield)