Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@
.plan_cache.json
.rerun.json
bolt-debug.log
/.vscode/
6 changes: 0 additions & 6 deletions .vscode/extensions.json

This file was deleted.

28 changes: 15 additions & 13 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -86,6 +87,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)
Expand Down Expand Up @@ -172,6 +174,16 @@ application.<br />

Default value: `'running'`

##### <a name="-prosa--service_limit_nofile"></a>`service_limit_nofile`

Data type: `Optional[Integer]`

Sets the limit on the number of open file descriptors for the ProSA service.<br />
This parameter corresponds to the `LimitNOFILE` directive in the systemd service unit file.<br />
Apply the default system limit when set to `undef`.

Default value: `undef`

##### <a name="-prosa--manage_user"></a>`manage_user`

Data type: `Boolean`
Expand Down Expand Up @@ -226,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.<br />
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`
Expand All @@ -236,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.<br />
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`
Expand Down Expand Up @@ -284,17 +296,7 @@ Default value: `{}`
### <a name="prosa--proc"></a>`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

Expand Down
29 changes: 18 additions & 11 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@
# to `false`, which is useful when you want to let the service be managed by another
# application.<br />
#
# @param service_limit_nofile
# Sets the limit on the number of open file descriptors for the ProSA service.<br />
# This parameter corresponds to the `LimitNOFILE` directive in the systemd service unit file.<br />
# Apply the default system limit when set to `undef`.
#
# @param manage_user
# When `false`, stops Puppet from creating the user resource.<br />
# This is for instances when you have a user, created from another Puppet module, you want
Expand All @@ -65,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.<br />
# 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
Expand All @@ -78,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.<br />
# 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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -172,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,
}
}
7 changes: 1 addition & 6 deletions manifests/proc.pp
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
14 changes: 8 additions & 6 deletions manifests/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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']) {
Expand All @@ -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,
}
Expand Down
8 changes: 4 additions & 4 deletions spec/acceptance/processors_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
4 changes: 4 additions & 0 deletions templates/service.epp
Original file line number Diff line number Diff line change
Expand Up @@ -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 %>
Expand All @@ -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
Loading