Skip to content

Commit

Permalink
feature: add support for systemd option
Browse files Browse the repository at this point in the history
Signed-off-by: Julien Godin <julien.godin@camptocamp.com>
  • Loading branch information
JGodin-C2C committed Feb 27, 2024
1 parent cb60712 commit c75515b
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 0 deletions.
22 changes: 22 additions & 0 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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: <tt>60</tt>

##### <a name="-conntrackd--systemd"></a>`systemd`

Data type: `Optional[Enum['On','Off']]`

String to Enable/Disable systemd support. Possible values:
* <tt>On</tt>: Enable systemd support
* <tt>Off</tt>: Disable systemd support
Defaults to <tt>undef</tt>.

##### <a name="-conntrackd--protocol"></a>`protocol`

Data type: `Enum['Multicast', 'UDP']`
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -878,6 +889,17 @@ Default: <tt>60</tt>

Default value: `$conntrackd::purge_timeout`

##### <a name="-conntrackd--config--systemd"></a>`systemd`

Data type: `Optional[Enum['On','Off']]`

Boolean to Enable/Disable systemd support. Possible values:
* <tt>On</tt>: Enable systemd support
* <tt>Off</tt>: Disable systemd support
Defaults to <tt>undef</tt>.

Default value: `$conntrackd::systemd`

##### <a name="-conntrackd--config--protocol"></a>`protocol`

Data type: `Enum['Multicast', 'UDP']`
Expand Down
1 change: 1 addition & 0 deletions data/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
7 changes: 7 additions & 0 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,12 @@
# This command schedules a flush of the table in N seconds.
# Default: <tt>60</tt>
#
# @param systemd
# Boolean to Enable/Disable systemd support. Possible values:
# * <tt>On</tt>: Enable systemd support
# * <tt>Off</tt>: Disable systemd support
# Defaults to <tt>undef</tt>.
#
# @param protocol
# string: The protocol to use for syncing.
# values: <tt>Multicast</tt> or <tt>UDP</tt>
Expand Down Expand Up @@ -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,
Expand Down
7 changes: 7 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,12 @@
# This command schedules a flush of the table in N seconds.
# Default: <tt>60</tt>
#
# @param systemd
# String to Enable/Disable systemd support. Possible values:
# * <tt>On</tt>: Enable systemd support
# * <tt>Off</tt>: Disable systemd support
# Defaults to <tt>undef</tt>.
#
# @param protocol
# string: The protocol to use for syncing.
# values: <tt>Multicast</tt> or <tt>UDP</tt>
Expand Down Expand Up @@ -333,6 +339,7 @@
Integer $cache_timeout,
Integer $commit_timeout,
Integer $purge_timeout,
Optional[Enum['On','Off']] $systemd,

Enum['Multicast', 'UDP'] $protocol,
String $interface,
Expand Down
3 changes: 3 additions & 0 deletions templates/conntrackd.conf.epp
Original file line number Diff line number Diff line change
Expand Up @@ -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 %>
Expand Down

0 comments on commit c75515b

Please sign in to comment.