Skip to content
Open
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
9 changes: 9 additions & 0 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ The following parameters are available in the `sensu::agent` class:
* [`log_file`](#-sensu--agent--log_file)
* [`agent_entity_config_provider`](#-sensu--agent--agent_entity_config_provider)
* [`validate_entity`](#-sensu--agent--validate_entity)
* [`timeout`](#-sensu--agent--timeout)

##### <a name="-sensu--agent--version"></a>`version`

Expand Down Expand Up @@ -538,6 +539,14 @@ to configure the entity

Default value: `true`

##### <a name="-sensu--agent--timeout"></a>`timeout`

Data type: `Integer`

Sets the timeout for validate entity

Default value: `10`

### <a name="sensu--api"></a>`sensu::api`

Class to manage the Sensu API.
Expand Down
15 changes: 9 additions & 6 deletions manifests/agent.pp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@
# @param validate_entity
# Sets whether to validate the agent's entity before attempting
# to configure the entity
# @param timeout
# Sets the timeout for validate entity
#
class sensu::agent (
Optional[String] $version = undef,
Expand All @@ -102,8 +104,8 @@
Optional[Stdlib::Absolutepath] $log_file = undef,
Enum['sensuctl','sensu_api'] $agent_entity_config_provider = 'sensu_api',
Boolean $validate_entity = true,
Integer $timeout = 10,
) {

include sensu
include sensu::common
include sensu::api
Expand Down Expand Up @@ -208,8 +210,8 @@
before => Package['sensu-go-agent'],
}
} elsif $package_source {
$package_provider = undef
$_package_source = $package_source
$package_provider = undef
$_package_source = $package_source
} else {
include chocolatey
$package_provider = 'chocolatey'
Expand Down Expand Up @@ -284,9 +286,9 @@
systemd::dropin_file { 'sensu-agent-start.conf':
unit => 'sensu-agent.service',
content => join([
'[Service]',
'ExecStart=',
"ExecStart=${service_path} start -c ${sensu::agent_config_path}",
'[Service]',
'ExecStart=',
"ExecStart=${service_path} start -c ${sensu::agent_config_path}",
], "\n"),
notify => Service['sensu-agent'],
}
Expand All @@ -304,6 +306,7 @@
ensure => 'present',
namespace => $config['namespace'],
provider => 'sensu_api',
timeout => $timeout,
}
}
}