From 1e6b34e6a6f971019e401eca87c5c5b7d6cb8082 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Fri, 16 Mar 2018 23:45:34 +0100 Subject: [PATCH 1/8] fix typos in spec tests --- spec/classes/prometheus_spec.rb | 2 +- spec/defines/daemon_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/classes/prometheus_spec.rb b/spec/classes/prometheus_spec.rb index 87f18d790..adcb70804 100644 --- a/spec/classes/prometheus_spec.rb +++ b/spec/classes/prometheus_spec.rb @@ -149,7 +149,7 @@ } else it { - is_expected.to raise_error(Puppet::Error, %r{I don.t know how to create an init script for style}) + is_expected.to raise_error(Puppet::Error, %r{I don't know how to create an init script for style}) } end diff --git a/spec/defines/daemon_spec.rb b/spec/defines/daemon_spec.rb index 6b85d2b1b..333ebc97d 100644 --- a/spec/defines/daemon_spec.rb +++ b/spec/defines/daemon_spec.rb @@ -142,7 +142,7 @@ } else it { - is_expected.to raise_error(Puppet::Error, %r{I don.t know how to create an init script for style}) + is_expected.to raise_error(Puppet::Error, %r{I don't know how to create an init script for style}) } end From 8c31774b696275ad782ae0deb50ec767449d4567 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Fri, 16 Mar 2018 23:45:45 +0100 Subject: [PATCH 2/8] add archlinux support --- metadata.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/metadata.json b/metadata.json index dec0f4eb9..ab2b7c019 100644 --- a/metadata.json +++ b/metadata.json @@ -49,6 +49,9 @@ "6", "7" ] + }, + { + "operatingsystem": "Archlinux" } ], "requirements": [ From 381a7540ec621e1e4be67e23c9edd2df50419214 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Sat, 17 Mar 2018 19:16:34 +0100 Subject: [PATCH 3/8] set install_method per Operatingsystem --- manifests/params.pp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/manifests/params.pp b/manifests/params.pp index bc6308480..f3f56a8d5 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -52,7 +52,6 @@ $extra_groups = [] $global_config = { 'scrape_interval'=> '15s', 'evaluation_interval'=> '15s', 'external_labels'=> { 'monitor'=>'master'}} $group = 'prometheus' - $install_method = 'url' $localstorage = '/var/lib/prometheus' $mesos_exporter_server_type= 'master' $mesos_exporter_cnf_scrape_uri = 'http://localhost:5050' @@ -217,6 +216,7 @@ $os = downcase($::kernel) if $::operatingsystem == 'Ubuntu' { + $install_method = 'url' $env_file_path = '/etc/default' if versioncmp($::operatingsystemrelease, '8.04') < 1 { $init_style = 'debian' @@ -226,6 +226,7 @@ $init_style = 'systemd' } } elsif $::operatingsystem =~ /Scientific|CentOS|RedHat|OracleLinux/ { + $install_method = 'url' $env_file_path = '/etc/sysconfig' if versioncmp($::operatingsystemrelease, '7.0') < 0 { $init_style = 'sysv' @@ -233,6 +234,7 @@ $init_style = 'systemd' } } elsif $::operatingsystem == 'Fedora' { + $install_method = 'url' $env_file_path = '/etc/sysconfig' if versioncmp($::operatingsystemrelease, '12') < 0 { $init_style = 'sysv' @@ -240,6 +242,7 @@ $init_style = 'systemd' } } elsif $::operatingsystem == 'Debian' { + $install_method = 'url' $env_file_path = '/etc/default' if versioncmp($::operatingsystemrelease, '8.0') < 0 { $init_style = 'debian' @@ -247,12 +250,15 @@ $init_style = 'systemd' } } elsif $::operatingsystem == 'Archlinux' { + $install_method = 'package' $env_file_path = '/etc/default' $init_style = 'systemd' } elsif $::operatingsystem == 'OpenSuSE' { + $install_method = 'url' $env_file_path = '/etc/sysconfig' $init_style = 'systemd' } elsif $::operatingsystem =~ /SLE[SD]/ { + $install_method = 'url' $env_file_path = '/etc/sysconfig' if versioncmp($::operatingsystemrelease, '12.0') < 0 { $init_style = 'sles' @@ -260,12 +266,15 @@ $init_style = 'systemd' } } elsif $::operatingsystem == 'Darwin' { + $install_method = 'url' $env_file_path = undef $init_style = 'launchd' } elsif $::operatingsystem == 'Amazon' { + $install_method = 'url' $env_file_path = '/etc/sysconfig' $init_style = 'sysv' } else { + $install_method = 'url' $init_style = undef } if $init_style == undef { From 91731ea01cee243b7ff8a3592f89585cabb5cc5c Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Sat, 17 Mar 2018 19:34:50 +0100 Subject: [PATCH 4/8] allow different defaults exporter/daemon install This is a nonbreaking change that allows us to set different defaults per OS for exporter/main daemon installation method. Idea behind this is that Archlinux recently moved prometheus into the repository. --- manifests/init.pp | 2 +- manifests/params.pp | 21 +++++++++++---------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 524c0650d..e712c722e 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -139,7 +139,7 @@ $shared_dir = $::prometheus::params::shared_dir, $arch = $::prometheus::params::arch, $version = $::prometheus::params::version, - $install_method = $::prometheus::params::install_method, + $install_method = $::prometheus::params::prometheus_install_method, $os = $::prometheus::params::os, $download_url = undef, $download_url_base = $::prometheus::params::download_url_base, diff --git a/manifests/params.pp b/manifests/params.pp index f3f56a8d5..f9c962652 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -52,6 +52,7 @@ $extra_groups = [] $global_config = { 'scrape_interval'=> '15s', 'evaluation_interval'=> '15s', 'external_labels'=> { 'monitor'=>'master'}} $group = 'prometheus' + $install_method = 'url' $localstorage = '/var/lib/prometheus' $mesos_exporter_server_type= 'master' $mesos_exporter_cnf_scrape_uri = 'http://localhost:5050' @@ -216,7 +217,7 @@ $os = downcase($::kernel) if $::operatingsystem == 'Ubuntu' { - $install_method = 'url' + $prometheus_install_method = 'url' $env_file_path = '/etc/default' if versioncmp($::operatingsystemrelease, '8.04') < 1 { $init_style = 'debian' @@ -226,7 +227,7 @@ $init_style = 'systemd' } } elsif $::operatingsystem =~ /Scientific|CentOS|RedHat|OracleLinux/ { - $install_method = 'url' + $prometheus_install_method = 'url' $env_file_path = '/etc/sysconfig' if versioncmp($::operatingsystemrelease, '7.0') < 0 { $init_style = 'sysv' @@ -234,7 +235,7 @@ $init_style = 'systemd' } } elsif $::operatingsystem == 'Fedora' { - $install_method = 'url' + $prometheus_install_method = 'url' $env_file_path = '/etc/sysconfig' if versioncmp($::operatingsystemrelease, '12') < 0 { $init_style = 'sysv' @@ -242,7 +243,7 @@ $init_style = 'systemd' } } elsif $::operatingsystem == 'Debian' { - $install_method = 'url' + $prometheus_install_method = 'url' $env_file_path = '/etc/default' if versioncmp($::operatingsystemrelease, '8.0') < 0 { $init_style = 'debian' @@ -250,15 +251,15 @@ $init_style = 'systemd' } } elsif $::operatingsystem == 'Archlinux' { - $install_method = 'package' + $prometheus_install_method = 'package' $env_file_path = '/etc/default' $init_style = 'systemd' } elsif $::operatingsystem == 'OpenSuSE' { - $install_method = 'url' + $prometheus_install_method = 'url' $env_file_path = '/etc/sysconfig' $init_style = 'systemd' } elsif $::operatingsystem =~ /SLE[SD]/ { - $install_method = 'url' + $prometheus_install_method = 'url' $env_file_path = '/etc/sysconfig' if versioncmp($::operatingsystemrelease, '12.0') < 0 { $init_style = 'sles' @@ -266,15 +267,15 @@ $init_style = 'systemd' } } elsif $::operatingsystem == 'Darwin' { - $install_method = 'url' + $prometheus_install_method = 'url' $env_file_path = undef $init_style = 'launchd' } elsif $::operatingsystem == 'Amazon' { - $install_method = 'url' + $prometheus_install_method = 'url' $env_file_path = '/etc/sysconfig' $init_style = 'sysv' } else { - $install_method = 'url' + $prometheus_install_method = 'url' $init_style = undef } if $init_style == undef { From 22b5a16193a8b5046c426f2f4b883bd51084ab4c Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Sat, 17 Mar 2018 19:39:48 +0100 Subject: [PATCH 5/8] set bin_dir on a per Operationsystem basis --- manifests/params.pp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/manifests/params.pp b/manifests/params.pp index f9c962652..df5435d99 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -20,7 +20,6 @@ $alertmanager_user = 'alertmanager' $alertmanager_version = '0.5.1' $alerts = {} - $bin_dir = '/usr/local/bin' $config_dir = '/etc/prometheus' $config_mode = '0660' $config_template = 'prometheus/prometheus.yaml.erb' @@ -217,6 +216,7 @@ $os = downcase($::kernel) if $::operatingsystem == 'Ubuntu' { + $bin_dir = '/usr/local/bin' $prometheus_install_method = 'url' $env_file_path = '/etc/default' if versioncmp($::operatingsystemrelease, '8.04') < 1 { @@ -227,6 +227,7 @@ $init_style = 'systemd' } } elsif $::operatingsystem =~ /Scientific|CentOS|RedHat|OracleLinux/ { + $bin_dir = '/usr/local/bin' $prometheus_install_method = 'url' $env_file_path = '/etc/sysconfig' if versioncmp($::operatingsystemrelease, '7.0') < 0 { @@ -235,6 +236,7 @@ $init_style = 'systemd' } } elsif $::operatingsystem == 'Fedora' { + $bin_dir = '/usr/local/bin' $prometheus_install_method = 'url' $env_file_path = '/etc/sysconfig' if versioncmp($::operatingsystemrelease, '12') < 0 { @@ -243,6 +245,7 @@ $init_style = 'systemd' } } elsif $::operatingsystem == 'Debian' { + $bin_dir = '/usr/local/bin' $prometheus_install_method = 'url' $env_file_path = '/etc/default' if versioncmp($::operatingsystemrelease, '8.0') < 0 { @@ -251,14 +254,17 @@ $init_style = 'systemd' } } elsif $::operatingsystem == 'Archlinux' { + $bin_dir = '/usr/bin' $prometheus_install_method = 'package' $env_file_path = '/etc/default' $init_style = 'systemd' } elsif $::operatingsystem == 'OpenSuSE' { + $bin_dir = '/usr/local/bin' $prometheus_install_method = 'url' $env_file_path = '/etc/sysconfig' $init_style = 'systemd' } elsif $::operatingsystem =~ /SLE[SD]/ { + $bin_dir = '/usr/local/bin' $prometheus_install_method = 'url' $env_file_path = '/etc/sysconfig' if versioncmp($::operatingsystemrelease, '12.0') < 0 { @@ -267,14 +273,17 @@ $init_style = 'systemd' } } elsif $::operatingsystem == 'Darwin' { + $bin_dir = '/usr/local/bin' $prometheus_install_method = 'url' $env_file_path = undef $init_style = 'launchd' } elsif $::operatingsystem == 'Amazon' { + $bin_dir = '/usr/local/bin' $prometheus_install_method = 'url' $env_file_path = '/etc/sysconfig' $init_style = 'sysv' } else { + $bin_dir = '/usr/local/bin' $prometheus_install_method = 'url' $init_style = undef } From f361ca89f5093176548ea4fb251aaa601378cbc8 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Sat, 17 Mar 2018 19:46:10 +0100 Subject: [PATCH 6/8] set version on a per Operationsystem basis --- manifests/params.pp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/manifests/params.pp b/manifests/params.pp index df5435d99..7af18acce 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -204,7 +204,6 @@ $redis_exporter_user = 'redis-exporter' $redis_exporter_version = '0.11.2' $user = 'prometheus' - $version = '1.5.2' case $::architecture { 'x86_64', 'amd64': { $arch = 'amd64' } 'i386': { $arch = '386' } @@ -216,6 +215,7 @@ $os = downcase($::kernel) if $::operatingsystem == 'Ubuntu' { + $version = '1.5.2' $bin_dir = '/usr/local/bin' $prometheus_install_method = 'url' $env_file_path = '/etc/default' @@ -227,6 +227,7 @@ $init_style = 'systemd' } } elsif $::operatingsystem =~ /Scientific|CentOS|RedHat|OracleLinux/ { + $version = '1.5.2' $bin_dir = '/usr/local/bin' $prometheus_install_method = 'url' $env_file_path = '/etc/sysconfig' @@ -236,6 +237,7 @@ $init_style = 'systemd' } } elsif $::operatingsystem == 'Fedora' { + $version = '1.5.2' $bin_dir = '/usr/local/bin' $prometheus_install_method = 'url' $env_file_path = '/etc/sysconfig' @@ -245,6 +247,7 @@ $init_style = 'systemd' } } elsif $::operatingsystem == 'Debian' { + $version = '1.5.2' $bin_dir = '/usr/local/bin' $prometheus_install_method = 'url' $env_file_path = '/etc/default' @@ -254,16 +257,19 @@ $init_style = 'systemd' } } elsif $::operatingsystem == 'Archlinux' { + $version = '2.2.0' $bin_dir = '/usr/bin' $prometheus_install_method = 'package' $env_file_path = '/etc/default' $init_style = 'systemd' } elsif $::operatingsystem == 'OpenSuSE' { + $version = '1.5.2' $bin_dir = '/usr/local/bin' $prometheus_install_method = 'url' $env_file_path = '/etc/sysconfig' $init_style = 'systemd' } elsif $::operatingsystem =~ /SLE[SD]/ { + $version = '1.5.2' $bin_dir = '/usr/local/bin' $prometheus_install_method = 'url' $env_file_path = '/etc/sysconfig' @@ -273,16 +279,19 @@ $init_style = 'systemd' } } elsif $::operatingsystem == 'Darwin' { + $version = '1.5.2' $bin_dir = '/usr/local/bin' $prometheus_install_method = 'url' $env_file_path = undef $init_style = 'launchd' } elsif $::operatingsystem == 'Amazon' { + $version = '1.5.2' $bin_dir = '/usr/local/bin' $prometheus_install_method = 'url' $env_file_path = '/etc/sysconfig' $init_style = 'sysv' } else { + $version = '1.5.2' $bin_dir = '/usr/local/bin' $prometheus_install_method = 'url' $init_style = undef From 172ec51093ec9d2f94aaf116c30aa82a5ca09c0f Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Sat, 17 Mar 2018 21:55:25 +0100 Subject: [PATCH 7/8] rework tests --- spec/classes/alertmanager_spec.rb | 3 ++- spec/classes/beanstalkd_exporter_spec.rb | 3 ++- spec/classes/blackbox_exporter_spec.rb | 1 + spec/classes/consul_exporter_spec.rb | 3 ++- spec/classes/elasticsearch_exporter_spec.rb | 3 ++- spec/classes/haproxy_exporter_spec.rb | 3 ++- spec/classes/mongodb_exporter_spec.rb | 3 ++- spec/classes/nginx_vts_exporter_spec.rb | 3 ++- spec/classes/node_exporter_spec.rb | 3 ++- spec/classes/prometheus_spec.rb | 7 ++++--- spec/classes/pushgateway_spec.rb | 3 ++- spec/classes/rabbitmq_exporter_spec.rb | 3 ++- spec/classes/redis_exporter_spec.rb | 3 ++- spec/classes/snmp_exporter_spec.rb | 3 ++- spec/defines/alerts_spec.rb | 3 ++- spec/defines/daemon_spec.rb | 5 +++-- 16 files changed, 34 insertions(+), 18 deletions(-) diff --git a/spec/classes/alertmanager_spec.rb b/spec/classes/alertmanager_spec.rb index 56ca6691b..2076e547a 100644 --- a/spec/classes/alertmanager_spec.rb +++ b/spec/classes/alertmanager_spec.rb @@ -12,7 +12,8 @@ { version: '0.9.1', arch: 'amd64', - os: 'linux' + os: 'linux', + bin_dir: '/usr/local/bin' } end diff --git a/spec/classes/beanstalkd_exporter_spec.rb b/spec/classes/beanstalkd_exporter_spec.rb index 17b92458d..591c77972 100644 --- a/spec/classes/beanstalkd_exporter_spec.rb +++ b/spec/classes/beanstalkd_exporter_spec.rb @@ -12,7 +12,8 @@ { version: '1.0.0', arch: 'amd64', - os: 'linux' + os: 'linux', + bin_dir: '/usr/local/bin' } end diff --git a/spec/classes/blackbox_exporter_spec.rb b/spec/classes/blackbox_exporter_spec.rb index dd9c6b701..aabe786d9 100644 --- a/spec/classes/blackbox_exporter_spec.rb +++ b/spec/classes/blackbox_exporter_spec.rb @@ -13,6 +13,7 @@ version: '0.6.0', arch: 'amd64', os: 'linux', + bin_dir: '/usr/local/bin', modules: { 'http_2xx' => { 'prober' => 'http' diff --git a/spec/classes/consul_exporter_spec.rb b/spec/classes/consul_exporter_spec.rb index 3c4a88e0c..92161374a 100644 --- a/spec/classes/consul_exporter_spec.rb +++ b/spec/classes/consul_exporter_spec.rb @@ -12,7 +12,8 @@ { version: '0.3.0', arch: 'amd64', - os: 'linux' + os: 'linux', + bin_dir: '/usr/local/bin' } end diff --git a/spec/classes/elasticsearch_exporter_spec.rb b/spec/classes/elasticsearch_exporter_spec.rb index 31e0dad1f..520a64ace 100644 --- a/spec/classes/elasticsearch_exporter_spec.rb +++ b/spec/classes/elasticsearch_exporter_spec.rb @@ -12,7 +12,8 @@ { version: '1.0.0', arch: 'amd64', - os: 'linux' + os: 'linux', + bin_dir: '/usr/local/bin' } end diff --git a/spec/classes/haproxy_exporter_spec.rb b/spec/classes/haproxy_exporter_spec.rb index e9bbddbad..051ce9d2e 100644 --- a/spec/classes/haproxy_exporter_spec.rb +++ b/spec/classes/haproxy_exporter_spec.rb @@ -12,7 +12,8 @@ { version: '0.7.1', arch: 'amd64', - os: 'linux' + os: 'linux', + bin_dir: '/usr/local/bin' } end diff --git a/spec/classes/mongodb_exporter_spec.rb b/spec/classes/mongodb_exporter_spec.rb index 83dcdca4c..4abc1098a 100644 --- a/spec/classes/mongodb_exporter_spec.rb +++ b/spec/classes/mongodb_exporter_spec.rb @@ -12,7 +12,8 @@ { version: '0.3.0', arch: 'amd64', - os: 'linux' + os: 'linux', + bin_dir: '/usr/local/bin' } end diff --git a/spec/classes/nginx_vts_exporter_spec.rb b/spec/classes/nginx_vts_exporter_spec.rb index 09478f517..7cec68198 100644 --- a/spec/classes/nginx_vts_exporter_spec.rb +++ b/spec/classes/nginx_vts_exporter_spec.rb @@ -12,7 +12,8 @@ { version: '0.6', arch: 'amd64', - os: 'linux' + os: 'linux', + bin_dir: '/usr/local/bin' } end diff --git a/spec/classes/node_exporter_spec.rb b/spec/classes/node_exporter_spec.rb index aac716921..618164a2f 100644 --- a/spec/classes/node_exporter_spec.rb +++ b/spec/classes/node_exporter_spec.rb @@ -39,7 +39,8 @@ { version: '0.13.0', arch: 'amd64', - os: 'linux' + os: 'linux', + bin_dir: '/usr/local/bin' } end diff --git a/spec/classes/prometheus_spec.rb b/spec/classes/prometheus_spec.rb index adcb70804..55ef905db 100644 --- a/spec/classes/prometheus_spec.rb +++ b/spec/classes/prometheus_spec.rb @@ -7,7 +7,7 @@ facts end - [{}, { version: '2.0.0-rc.1' }].each do |parameters| + [{ version: '2.0.0-rc.1', bin_dir: '/usr/local/bin', install_method: 'url' }].each do |parameters| context "with parameters #{parameters}" do let(:params) do parameters @@ -116,7 +116,7 @@ 'content' => File.read(fixtures('files', "prometheus#{prom_major}.sysv")) ) } - elsif ['centos-7-x86_64', 'debian-8-x86_64', 'redhat-7-x86_64', 'ubuntu-16.04-x86_64'].include?(os) + elsif ['centos-7-x86_64', 'debian-8-x86_64', 'redhat-7-x86_64', 'ubuntu-16.04-x86_64', 'archlinux-4-x86_64'].include?(os) # init_style = 'systemd' it { is_expected.to contain_class('systemd') } @@ -203,6 +203,7 @@ context 'with alerts configured', alerts: true do [ { + version: '1.5.3', alerts: [{ 'name' => 'alert_name', 'condition' => 'up == 0', @@ -236,7 +237,7 @@ parameters end - prom_version = parameters[:version] || '1.5.2' + prom_version = parameters[:version] prom_major = prom_version[0] it { diff --git a/spec/classes/pushgateway_spec.rb b/spec/classes/pushgateway_spec.rb index 05eb24319..ef7dd69f9 100644 --- a/spec/classes/pushgateway_spec.rb +++ b/spec/classes/pushgateway_spec.rb @@ -12,7 +12,8 @@ { version: '0.4.0', arch: 'amd64', - os: 'linux' + os: 'linux', + bin_dir: '/usr/local/bin' } end diff --git a/spec/classes/rabbitmq_exporter_spec.rb b/spec/classes/rabbitmq_exporter_spec.rb index baec28d22..4aeef756d 100644 --- a/spec/classes/rabbitmq_exporter_spec.rb +++ b/spec/classes/rabbitmq_exporter_spec.rb @@ -12,7 +12,8 @@ { version: '1.0.0', arch: 'amd64', - os: 'linux' + os: 'linux', + bin_dir: '/usr/local/bin' } end diff --git a/spec/classes/redis_exporter_spec.rb b/spec/classes/redis_exporter_spec.rb index 593673800..93be13b5b 100644 --- a/spec/classes/redis_exporter_spec.rb +++ b/spec/classes/redis_exporter_spec.rb @@ -12,7 +12,8 @@ { version: '0.11.2', arch: 'amd64', - os: 'linux' + os: 'linux', + bin_dir: '/usr/local/bin' } end diff --git a/spec/classes/snmp_exporter_spec.rb b/spec/classes/snmp_exporter_spec.rb index a64c08533..da10b25fd 100644 --- a/spec/classes/snmp_exporter_spec.rb +++ b/spec/classes/snmp_exporter_spec.rb @@ -12,7 +12,8 @@ { version: '0.6.0', arch: 'amd64', - os: 'linux' + os: 'linux', + bin_dir: '/usr/local/bin' } end diff --git a/spec/defines/alerts_spec.rb b/spec/defines/alerts_spec.rb index 781032ead..6abbb4185 100644 --- a/spec/defines/alerts_spec.rb +++ b/spec/defines/alerts_spec.rb @@ -17,6 +17,7 @@ [ { + version: '1.5.2', alerts: [ { 'name' => 'alert_name', @@ -62,7 +63,7 @@ parameters end - prom_version = parameters[:version] || '1.5.2' + prom_version = parameters[:version] prom_major = prom_version[0] it { diff --git a/spec/defines/daemon_spec.rb b/spec/defines/daemon_spec.rb index 333ebc97d..cd7efd9d7 100644 --- a/spec/defines/daemon_spec.rb +++ b/spec/defines/daemon_spec.rb @@ -22,7 +22,8 @@ notify_service: 'Service[smurf_exporter]', user: 'smurf_user', group: 'smurf_group', - env_vars: { SOMEVAR: 42 } + env_vars: { SOMEVAR: 42 }, + bin_dir: '/usr/local/bin' } ].each do |parameters| context "with parameters #{parameters}" do @@ -102,7 +103,7 @@ %r{daemon --user=smurf_user \\\n --pidfile="\$PID_FILE" \\\n "\$DAEMON" '' >> "\$LOG_FILE" &} ) } - elsif ['centos-7-x86_64', 'debian-8-x86_64', 'redhat-7-x86_64', 'ubuntu-16.04-x86_64'].include?(os) + elsif ['centos-7-x86_64', 'debian-8-x86_64', 'redhat-7-x86_64', 'ubuntu-16.04-x86_64', 'archlinux-4-x86_64'].include?(os) # init_style = 'systemd' it { is_expected.to contain_class('systemd') } From 455243566c846181c4c4c400858600f7c2bfa7f9 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Sat, 17 Mar 2018 22:39:52 +0100 Subject: [PATCH 8/8] increase testcoverage on daemon_spec --- spec/defines/daemon_spec.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/spec/defines/daemon_spec.rb b/spec/defines/daemon_spec.rb index cd7efd9d7..6d76d2995 100644 --- a/spec/defines/daemon_spec.rb +++ b/spec/defines/daemon_spec.rb @@ -31,6 +31,7 @@ parameters end + it { is_expected.to contain_class('prometheus::params') } prom_os = facts[:kernel].downcase prom_arch = facts[:architecture] == 'i386' ? '386' : 'amd64'