From 6e651cf77c82c7193a9e7ecfbd474509d673c9cd Mon Sep 17 00:00:00 2001 From: Piyush Verma Date: Tue, 11 Nov 2014 18:42:27 +0530 Subject: [PATCH 1/4] allow admin section to be conditional --- manifests/config.pp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/manifests/config.pp b/manifests/config.pp index ccc9147..3aef9ea 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -1,6 +1,12 @@ # == Class: influxdb::config # More information on these settings available at: http://influxdb.org/docs/configuration.html class influxdb::config { + $admin_presence = $admin_port ? { + "" => absent, + undef => absent, + default => present, + } + ini_setting { 'hostname': section => '', setting => 'hostname', @@ -28,12 +34,14 @@ # [admin] ini_setting { 'admin_port': + ensure => $admin_presence, section => 'admin', setting => 'port', value => $influxdb::admin_port, } ini_setting { 'admin_assets': + ensure => $admin_presence, section => 'admin', setting => 'assets', value => "\"${influxdb::admin_assets}\"", From 681dd9e42ce67a8e9ffe3153e7db3c4f7ae335ff Mon Sep 17 00:00:00 2001 From: Piyush Verma Date: Tue, 11 Nov 2014 23:09:43 +0530 Subject: [PATCH 2/4] Make reporting-disabled configurable --- manifests/config.pp | 6 ++++++ manifests/init.pp | 1 + manifests/params.pp | 3 +++ 3 files changed, 10 insertions(+) diff --git a/manifests/config.pp b/manifests/config.pp index 3aef9ea..e7761ef 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -7,6 +7,12 @@ default => present, } + ini_setting { 'reporting_disabled': + section => '', + setting => 'reporting-disabled', + value => $influxdb::reporting_disabled, + } + ini_setting { 'hostname': section => '', setting => 'hostname', diff --git a/manifests/init.pp b/manifests/init.pp index 929c9b4..c043d93 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -36,6 +36,7 @@ $wal_bookmark_after = $influxdb::params::wal_bookmark_after, $wal_index_after = $influxdb::params::wal_index_after, $wal_requests_per_logfile = $influxdb::params::wal_requests_per_logfile, + $reporting_disabled = $influxdb::params::reporting_disabled, ) inherits influxdb::params { class { 'influxdb::config': } diff --git a/manifests/params.pp b/manifests/params.pp index 003d5df..09b35f8 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -58,4 +58,7 @@ $wal_bookmark_after = '0' $wal_index_after = '1000' $wal_requests_per_logfile = '10000' + + # [reporting] + $reporting_disabled = false } From c331e3eb2788a1c5ebf267c42a2505713b7a6c40 Mon Sep 17 00:00:00 2001 From: Piyush Verma Date: Wed, 12 Nov 2014 16:58:25 +0530 Subject: [PATCH 3/4] Avoid failure due to download timeout. Info: Applying configuration version '1415787370' Notice: Downloading http://s3.amazonaws.com/influxdb/influxdb_0.8.4_amd64.deb Notice: /Stage[main]/Influxdb::Install/Notify[Downloading http://s3.amazonaws.com/influxdb/influxdb_0.8.4_amd64.deb]/message: defined 'message' as 'Downloading http://s3.amazonaws.com/influxdb/influxdb_0.8.4_amd64.deb' Notice: /Stage[main]/Influxdb::Install/Staging::File[influxdb-package]/File[/opt/staging/influxdb]/ensure: created Error: Command exceeded timeout Error: /Stage[main]/Influxdb::Install/Staging::File[influxdb-package]/Exec[/opt/staging/influxdb/influxdb-package]/returns: change from notrun to 0 failed: Command exceeded timeout Notice: /Stage[main]/Influxdb::Install/Package[influxdb]: Dependency Exec[/opt/staging/influxdb/influxdb-package] has failures: true Warning: /Stage[main]/Influxdb::Install/Package[influxdb]: Skipping because of failed dependencies --- manifests/install.pp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/manifests/install.pp b/manifests/install.pp index 8136598..6b77233 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -29,6 +29,8 @@ # get the package staging::file { 'influxdb-package': source => $package_source, + tries => 3, + timeout => 0, } # install the package From 1c631e03449e11853ee0ed77354c3a6e4b6cf609 Mon Sep 17 00:00:00 2001 From: Piyush Verma Date: Wed, 12 Nov 2014 22:50:36 +0530 Subject: [PATCH 4/4] Dont use tries. Let it fail if it has to for reasons other than timeout --- manifests/install.pp | 1 - 1 file changed, 1 deletion(-) diff --git a/manifests/install.pp b/manifests/install.pp index 6b77233..9ece66e 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -29,7 +29,6 @@ # get the package staging::file { 'influxdb-package': source => $package_source, - tries => 3, timeout => 0, }