From 755602d45eed722116a24f0a07a64639b4f614f7 Mon Sep 17 00:00:00 2001 From: Jeremy HERGAULT Date: Wed, 3 Dec 2025 14:54:01 +0100 Subject: [PATCH 1/3] feat: allow fd limit override for systemd service Signed-off-by: Jeremy HERGAULT --- .gitignore | 1 + .vscode/extensions.json | 6 ------ REFERENCE.md | 31 +++++++++++++++++++++++++++++++ manifests/init.pp | 6 ++++++ templates/service.epp | 4 ++++ 5 files changed, 42 insertions(+), 6 deletions(-) delete mode 100644 .vscode/extensions.json diff --git a/.gitignore b/.gitignore index 2803e56..e81ac17 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,4 @@ .plan_cache.json .rerun.json bolt-debug.log +/.vscode/ diff --git a/.vscode/extensions.json b/.vscode/extensions.json deleted file mode 100644 index 6da8d47..0000000 --- a/.vscode/extensions.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "recommendations": [ - "puppet.puppet-vscode", - "Shopify.ruby-lsp" - ] -} diff --git a/REFERENCE.md b/REFERENCE.md index c9c0c8c..a8df1f0 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -24,6 +24,10 @@ * [`ProSA::TelemetryLevel`](#ProSA--TelemetryLevel): A string that conforms to the ProSA `TelemetryLevel` syntax. +### Tasks + +* [`version`](#version): Gets the ProSA components versions + ## Classes ### `prosa` @@ -86,6 +90,7 @@ The following parameters are available in the `prosa` class: * [`service_enable`](#-prosa--service_enable) * [`service_manage`](#-prosa--service_manage) * [`service_ensure`](#-prosa--service_ensure) +* [`service_limit_nofile`](#-prosa--service_limit_nofile) * [`manage_user`](#-prosa--manage_user) * [`manage_group`](#-prosa--manage_group) * [`user`](#-prosa--user) @@ -172,6 +177,16 @@ application.
Default value: `'running'` +##### `service_limit_nofile` + +Data type: `Optional[Integer]` + +Sets the limit on the number of open file descriptors for the ProSA service.
+This parameter corresponds to the `LimitNOFILE` directive in the systemd service unit file.
+Apply the default system limit when set to `undef`. + +Default value: `undef` + ##### `manage_user` Data type: `Boolean` @@ -384,3 +399,19 @@ ProSA accept non case sensitive levels (like this type). Alias of `Pattern[/\A(?i:error|warn|info|debug|trace|off)\Z/]` +## Tasks + +### `version` + +Gets the ProSA components versions + +**Supports noop?** false + +#### Parameters + +##### `node_role` + +Data type: `String[1]` + +The role of the node joining the swarm + diff --git a/manifests/init.pp b/manifests/init.pp index dccf5f0..06f4bb8 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -39,6 +39,11 @@ # to `false`, which is useful when you want to let the service be managed by another # application.
# +# @param service_limit_nofile +# Sets the limit on the number of open file descriptors for the ProSA service.
+# This parameter corresponds to the `LimitNOFILE` directive in the systemd service unit file.
+# Apply the default system limit when set to `undef`. +# # @param manage_user # When `false`, stops Puppet from creating the user resource.
# This is for instances when you have a user, created from another Puppet module, you want @@ -112,6 +117,7 @@ Boolean $service_enable = true, Boolean $service_manage = true, Variant[Stdlib::Ensure::Service, Boolean] $service_ensure = 'running', + Optional[Integer] $service_limit_nofile = undef, Boolean $manage_user = true, Boolean $manage_group = true, String $user = $prosa::params::user, diff --git a/templates/service.epp b/templates/service.epp index 23ac199..b493661 100644 --- a/templates/service.epp +++ b/templates/service.epp @@ -3,6 +3,7 @@ String $group = 'prosa', Stdlib::Absolutepath $bin_path = '/usr/local/bin/prosa', Stdlib::Absolutepath $conf_path = '/etc/prosa', + Optional[Integer] $limit_nofile = undef, | -%> [Unit] Description=ProSA service for <%= $prosa_name %> @@ -14,6 +15,9 @@ Type=simple User=<%= $user %> Group=<%= $group %> ExecStart=<%= $bin_path %> -c <%= $conf_path %> +<% if $limit_nofile { -%> +LimitNOFILE=<%= $limit_nofile %> +<% } -%> [Install] WantedBy=multi-user.target From 086d9a24b9302dd0573bea42772e8b8cae98dc6c Mon Sep 17 00:00:00 2001 From: Jeremy HERGAULT Date: Tue, 24 Feb 2026 15:10:38 +0100 Subject: [PATCH 2/3] feat: rebase and update REFERENCE Signed-off-by: Jeremy HERGAULT --- REFERENCE.md | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/REFERENCE.md b/REFERENCE.md index a8df1f0..2d43548 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -24,10 +24,6 @@ * [`ProSA::TelemetryLevel`](#ProSA--TelemetryLevel): A string that conforms to the ProSA `TelemetryLevel` syntax. -### Tasks - -* [`version`](#version): Gets the ProSA components versions - ## Classes ### `prosa` @@ -399,19 +395,3 @@ ProSA accept non case sensitive levels (like this type). Alias of `Pattern[/\A(?i:error|warn|info|debug|trace|off)\Z/]` -## Tasks - -### `version` - -Gets the ProSA components versions - -**Supports noop?** false - -#### Parameters - -##### `node_role` - -Data type: `String[1]` - -The role of the node joining the swarm - From b0b1549dbf7b0afd4d3b4584b913074f9d29732b Mon Sep 17 00:00:00 2001 From: Jeremy HERGAULT Date: Tue, 24 Feb 2026 15:30:20 +0100 Subject: [PATCH 3/3] fix: fd limit parameter and documentation Signed-off-by: Jeremy HERGAULT --- REFERENCE.md | 17 ++++------------- manifests/init.pp | 23 ++++++++++++----------- manifests/proc.pp | 7 +------ manifests/service.pp | 14 ++++++++------ spec/acceptance/processors_spec.rb | 8 ++++---- 5 files changed, 29 insertions(+), 40 deletions(-) diff --git a/REFERENCE.md b/REFERENCE.md index 2d43548..c00a81a 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -19,6 +19,7 @@ ### Defined types * [`prosa::proc`](#prosa--proc): Allows specialised configurations for ProSA processors +Use the `prosa::processors` defined type if you want to create processors ### Data types @@ -237,7 +238,7 @@ Default value: `$prosa::params::telemetry_level` Data type: `Optional[Hash[String, String]]` Configures the ProSA [Telemetry Attributes](https://docs.rs/prosa-utils/latest/prosa_utils/config/observability/struct.Observability.html) directive -which allows to add custom attributes to telemetry messages. +which allows to add custom attributes to telemetry messages.
Refer to the [ProSA book](https://worldline.github.io/ProSA/ch01-02-01-observability.html) for more details on how to configure this directive. Default value: `undef` @@ -247,7 +248,7 @@ Default value: `undef` Data type: `Hash[String, Hash[String, Hash[String, String]]]` Configures the ProSA [Observability](https://docs.rs/prosa-utils/latest/prosa_utils/config/observability/struct.Observability.html) directive -which configure metrics, traces and logs export. +which configure metrics, traces and logs export.
Refer to the [ProSA book](https://worldline.github.io/ProSA/ch01-02-01-observability.html) for more details on how to configure this directive. Default value: `$prosa::params::observability` @@ -295,17 +296,7 @@ Default value: `{}` ### `prosa::proc` Allows specialised configurations for ProSA processors - -#### Examples - -##### - -```puppet -class { 'prosa': - default_vhost => false, - default_ssl_vhost => false, -} -``` +Use the `prosa::processors` defined type if you want to create processors #### Parameters diff --git a/manifests/init.pp b/manifests/init.pp index 06f4bb8..49db564 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -70,7 +70,7 @@ # # @param telemetry_attributes # Configures the ProSA [Telemetry Attributes](https://docs.rs/prosa-utils/latest/prosa_utils/config/observability/struct.Observability.html) directive -# which allows to add custom attributes to telemetry messages. +# which allows to add custom attributes to telemetry messages.
# Refer to the [ProSA book](https://worldline.github.io/ProSA/ch01-02-01-observability.html) for more details on how to configure this directive. # # @example Setting custom telemetry attributes @@ -83,7 +83,7 @@ # # @param observability # Configures the ProSA [Observability](https://docs.rs/prosa-utils/latest/prosa_utils/config/observability/struct.Observability.html) directive -# which configure metrics, traces and logs export. +# which configure metrics, traces and logs export.
# Refer to the [ProSA book](https://worldline.github.io/ProSA/ch01-02-01-observability.html) for more details on how to configure this directive. # # @example Setting custom observability configuration @@ -178,14 +178,15 @@ # Declare ProSA service class { 'prosa::service': - prosa_name => $prosa_name, - service_name => $service_name, - service_binary => $bin_path, - app_conf => $conf_dir, - user => $user, - group => $group, - service_enable => $service_enable, - service_ensure => $service_ensure, - service_manage => $service_manage, + prosa_name => $prosa_name, + service_name => $service_name, + service_binary => $bin_path, + app_conf => $conf_dir, + user => $user, + group => $group, + service_enable => $service_enable, + service_ensure => $service_ensure, + service_manage => $service_manage, + service_limit_nofile => $service_limit_nofile, } } diff --git a/manifests/proc.pp b/manifests/proc.pp index 7849aaf..ca47005 100644 --- a/manifests/proc.pp +++ b/manifests/proc.pp @@ -1,11 +1,6 @@ # @summary # Allows specialised configurations for ProSA processors -# -# @example -# class { 'prosa': -# default_vhost => false, -# default_ssl_vhost => false, -# } +# Use the `prosa::processors` defined type if you want to create processors # # @param adaptor_config_path # For some ProSA adaptor, they need to have a configuration in addition to processor. diff --git a/manifests/service.pp b/manifests/service.pp index b11a3d6..5eaca74 100644 --- a/manifests/service.pp +++ b/manifests/service.pp @@ -11,7 +11,8 @@ String $group = $prosa::params::group, Boolean $service_enable = true, Variant[Boolean, String] $service_ensure = 'running', - Boolean $service_manage = true + Boolean $service_manage = true, + Optional[Integer] $service_limit_nofile = undef ) { # The base class must be included first because parameter defaults depend on it if ! defined(Class['prosa::params']) { @@ -36,11 +37,12 @@ group => $prosa::params::root_group, mode => '0644', content => epp('prosa/service.epp', { - 'prosa_name' => $prosa_name, - 'user' => $user, - 'group' => $group, - 'bin_path' => $service_binary, - 'conf_path' => $app_conf, + 'prosa_name' => $prosa_name, + 'user' => $user, + 'group' => $group, + 'bin_path' => $service_binary, + 'conf_path' => $app_conf, + 'limit_nofile' => $service_limit_nofile, }), replace => true, } diff --git a/spec/acceptance/processors_spec.rb b/spec/acceptance/processors_spec.rb index 6207ebe..48cc088 100644 --- a/spec/acceptance/processors_spec.rb +++ b/spec/acceptance/processors_spec.rb @@ -16,14 +16,14 @@ pp = <<-MANIFEST class { 'prosa': - prosa_name => #{prosa_hash['prosa_name']}, - service_manage => false, - telemetry_level => 'warn', + prosa_name => #{prosa_hash['prosa_name']}, + service_manage => false, + telemetry_level => 'warn', telemetry_attributes => { 'service.name' => 'prosa-service', 'host.id' => 'fdbf79e8af94cb7f9e8df36789187052', }, - observability => { + observability => { 'metrics' => { 'prometheus' => { 'endpoint' => '0.0.0.0:9090',