puzzle.opnsense.system_settings_logging module – Configure logging settings.

Note

This module is part of the puzzle.opnsense collection (version 1.1.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 puzzle.opnsense.

To use it in a playbook, specify: puzzle.opnsense.system_settings_logging.

New in puzzle.opnsense 1.0.0

Synopsis

  • Module to configure system logging

Parameters

Parameter

Comments

max_log_file_size_mb

integer

Maximum file size per log file, e.g. 5

When set and a logfile exceeds the amount specified, it will be rotated

This option is available in OPNsense 24.1 and newer

preserve_logs

integer

Number of logs to preserve. By default 31 logs are preserved.

When no max filesize is offered or the logs are smaller than the the size requested, this equals the number of days, e.g. 10

Examples

- name: Set the number of logs to preserve to 10
  puzzle.opnsense.system_settings_logging:
    preserve_logs: 10

- name: Set max log file size to 5MB
  puzzle.opnsense.system_settings_logging:
    max_log_file_size_mb: 5

Return Values

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

Key

Description

opnsense_configure_output

list / elements=string

A List of the executed OPNsense configure function along with their respective stdout, stderr and rc

Returned: always

Sample: [{"function": "system_syslog_start", "params": ["true"], "rc": 0, "stderr": "", "stderr_lines": [], "stdout": "Configuring system logging...done.", "stdout_lines": ["Configuring system logging...done."]}]

Authors

  • Reto Kupferschmid (@rekup)