Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

toml installation: Support install_options #77

Merged
merged 1 commit into from Apr 5, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 20 additions & 2 deletions REFERENCE.md
Expand Up @@ -7,7 +7,7 @@
### Classes

* [`influxdb`](#influxdb): Installs, configures, and performs initial setup of InfluxDB 2.x
* [`influxdb::profile::toml`](#influxdbprofiletoml): Installs the toml-rb gem inside Puppet server
* [`influxdb::profile::toml`](#influxdbprofiletoml): Installs the toml-rb gem inside Puppet server and agent

### Resource types

Expand Down Expand Up @@ -221,7 +221,7 @@ URL of the GPG signing key

### <a name="influxdbprofiletoml"></a>`influxdb::profile::toml`

Installs the toml-rb gem inside Puppet server
Installs the toml-rb gem inside Puppet server and agent

#### Examples

Expand All @@ -236,6 +236,8 @@ include influxdb::profile::toml
The following parameters are available in the `influxdb::profile::toml` class:

* [`version`](#version)
* [`install_options_server`](#install_options_server)
* [`install_options_agent`](#install_options_agent)

##### <a name="version"></a>`version`

Expand All @@ -245,6 +247,22 @@ Version of the toml-rb gem to install

Default value: `'2.1.1'`

##### <a name="install_options_server"></a>`install_options_server`

Data type: `Array[String[1]]`

Pass additional parameters to the puppetserver gem installation

Default value: `[]`

##### <a name="install_options_agent"></a>`install_options_agent`

Data type: `Array[String[1]]`

Pass additional parameters to the puppetserver gem installation

Default value: `[]`

## Resource types

### <a name="influxdb_auth"></a>`influxdb_auth`
Expand Down
20 changes: 14 additions & 6 deletions manifests/profile/toml.pp
Expand Up @@ -3,23 +3,31 @@
# include influxdb::profile::toml
# @param version
# Version of the toml-rb gem to install
# @param install_options_server
# Pass additional parameters to the puppetserver gem installation
# @param install_options_agent
# Pass additional parameters to the puppetserver gem installation
class influxdb::profile::toml (
String $version = '2.1.1',
Array[String[1]] $install_options_server = [],
Array[String[1]] $install_options_agent = [],
) {
$service_name = $facts['pe_server_version'] ? {
undef => 'puppetserver',
default => 'pe-puppetserver',
}

package { 'toml-rb':
ensure => $version,
provider => 'puppetserver_gem',
notify => Service[$service_name],
ensure => $version,
provider => 'puppetserver_gem',
install_options => $install_options_server,
notify => Service[$service_name],
}

package { 'toml-rb agent':
ensure => $version,
name => 'toml-rb',
provider => 'puppet_gem',
ensure => $version,
name => 'toml-rb',
provider => 'puppet_gem',
install_options => $install_options_agent,
}
}