From c75515b5dd41210ffe0d1851581ba57a1d829e13 Mon Sep 17 00:00:00 2001 From: Julien Godin Date: Thu, 15 Feb 2024 11:00:56 +0100 Subject: [PATCH] feature: add support for systemd option Signed-off-by: Julien Godin --- REFERENCE.md | 22 ++++++++++++++++++++++ data/common.yaml | 1 + manifests/config.pp | 7 +++++++ manifests/init.pp | 7 +++++++ templates/conntrackd.conf.epp | 3 +++ 5 files changed, 40 insertions(+) diff --git a/REFERENCE.md b/REFERENCE.md index 31011e7..00920b2 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -86,6 +86,7 @@ The following parameters are available in the `conntrackd` class: * [`cache_timeout`](#-conntrackd--cache_timeout) * [`commit_timeout`](#-conntrackd--commit_timeout) * [`purge_timeout`](#-conntrackd--purge_timeout) +* [`systemd`](#-conntrackd--systemd) * [`protocol`](#-conntrackd--protocol) * [`interface`](#-conntrackd--interface) * [`ipv4_address`](#-conntrackd--ipv4_address) @@ -404,6 +405,15 @@ integer: If the firewall replica goes from primary to backup, This command schedules a flush of the table in N seconds. Default: 60 +##### `systemd` + +Data type: `Optional[Enum['On','Off']]` + +String to Enable/Disable systemd support. Possible values: +* On: Enable systemd support +* Off: Disable systemd support +Defaults to undef. + ##### `protocol` Data type: `Enum['Multicast', 'UDP']` @@ -602,6 +612,7 @@ The following parameters are available in the `conntrackd::config` class: * [`cache_timeout`](#-conntrackd--config--cache_timeout) * [`commit_timeout`](#-conntrackd--config--commit_timeout) * [`purge_timeout`](#-conntrackd--config--purge_timeout) +* [`systemd`](#-conntrackd--config--systemd) * [`protocol`](#-conntrackd--config--protocol) * [`interface`](#-conntrackd--config--interface) * [`ipv4_address`](#-conntrackd--config--ipv4_address) @@ -878,6 +889,17 @@ Default: 60 Default value: `$conntrackd::purge_timeout` +##### `systemd` + +Data type: `Optional[Enum['On','Off']]` + +Boolean to Enable/Disable systemd support. Possible values: +* On: Enable systemd support +* Off: Disable systemd support +Defaults to undef. + +Default value: `$conntrackd::systemd` + ##### `protocol` Data type: `Enum['Multicast', 'UDP']` diff --git a/data/common.yaml b/data/common.yaml index b2374e5..8b35bb4 100644 --- a/data/common.yaml +++ b/data/common.yaml @@ -23,6 +23,7 @@ conntrackd::config_filename: 'conntrackd.conf' # Configuration file parameters conntrackd::hashsize: 32768 conntrackd::logfile: 'off' +conntrackd::systemd: ~ conntrackd::syslog: 'on' conntrackd::lockfile: '/var/lock/conntrack.lock' conntrackd::sock_path: '/var/run/conntrackd.ctl' diff --git a/manifests/config.pp b/manifests/config.pp index 653dc43..acdf24e 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -132,6 +132,12 @@ # This command schedules a flush of the table in N seconds. # Default: 60 # +# @param systemd +# Boolean to Enable/Disable systemd support. Possible values: +# * On: Enable systemd support +# * Off: Disable systemd support +# Defaults to undef. +# # @param protocol # string: The protocol to use for syncing. # values: Multicast or UDP @@ -257,6 +263,7 @@ Integer $cache_timeout = $conntrackd::cache_timeout, Integer $commit_timeout = $conntrackd::commit_timeout, Integer $purge_timeout = $conntrackd::purge_timeout, + Optional[Enum['On','Off']] $systemd = $conntrackd::systemd, String $interface = $conntrackd::interface, String $ipv4_address = $conntrackd::ipv4_address, String $ipv4_interface = $conntrackd::ipv4_interface, diff --git a/manifests/init.pp b/manifests/init.pp index 3b99569..0b3f191 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -173,6 +173,12 @@ # This command schedules a flush of the table in N seconds. # Default: 60 # +# @param systemd +# String to Enable/Disable systemd support. Possible values: +# * On: Enable systemd support +# * Off: Disable systemd support +# Defaults to undef. +# # @param protocol # string: The protocol to use for syncing. # values: Multicast or UDP @@ -333,6 +339,7 @@ Integer $cache_timeout, Integer $commit_timeout, Integer $purge_timeout, + Optional[Enum['On','Off']] $systemd, Enum['Multicast', 'UDP'] $protocol, String $interface, diff --git a/templates/conntrackd.conf.epp b/templates/conntrackd.conf.epp index e0c0ed1..ddbcc70 100644 --- a/templates/conntrackd.conf.epp +++ b/templates/conntrackd.conf.epp @@ -49,6 +49,9 @@ Sync { General { + <% if $conntrackd::config::systemd != undef { -%> + Systemd <%= $conntrackd::config::systemd %> + <% } -%> Scheduler { Type <%= $conntrackd::config::scheduler_type %> Priority <%= $conntrackd::config::scheduler_priority %>