diff --git a/prometheus/archive/install.sls b/prometheus/archive/install.sls index c68c02e..b5dbb63 100644 --- a/prometheus/archive/install.sls +++ b/prometheus/archive/install.sls @@ -47,7 +47,6 @@ prometheus-archive-install-{{ name }}: {{- format_kwargs(p.pkg.component[name]['archive']) }} - trim_output: true - enforce_toplevel: false - - options: --strip-components=1 - force: {{ p.force }} - retry: {{ p.retry_option|json }} - require: diff --git a/prometheus/map.jinja b/prometheus/map.jinja index e0fcd18..5996c55 100644 --- a/prometheus/map.jinja +++ b/prometheus/map.jinja @@ -29,6 +29,7 @@ {%- for name,v in p.pkg.component.items() %} {%- set url = None %} {%- set dir = name %} + {%- do p.pkg.component[name].get('archive', {}).setdefault('options', '--strip-components=1') %} {%- if 'version' in v and v.version and 'archive' in v and v.archive and 'uri' in p.pkg %} {%- set uri = '%s/%s/releases/download/%s/%s'|format(p.pkg.uri, name, v.version, name) %} {%- set url = '%s-%s.%s-%s.tar.gz'|format(uri, v.version|replace('v',''), p.kernel, p.arch) %} diff --git a/test/integration/default/controls/archive_spec.rb b/test/integration/default/controls/archive_spec.rb index 591b9db..5e0a17f 100644 --- a/test/integration/default/controls/archive_spec.rb +++ b/test/integration/default/controls/archive_spec.rb @@ -53,6 +53,12 @@ control 'prometheus components' do describe user('mysqld_exporter') do it { should exist } end + describe group('prometheus_bigquery_remote_st...') do + it { should exist } + end + describe user('prometheus_bigquery_remote_st...') do + it { should exist } + end describe directory('/var/lib/prometheus') do it { should exist } end @@ -157,6 +163,23 @@ control 'prometheus components' do its('group') { should eq 'root' } its('mode') { should cmp '0644' } end + describe directory('/opt/prometheus/prometheus_bigquery_remote_storage_adapter-v0.4.6') do # rubocop:disable Layout/LineLength + it { should exist } + its('group') { should eq 'root' } + end + describe file('/opt/prometheus/prometheus_bigquery_remote_storage_adapter-v0.4.6/prometheus_bigquery_remote_storage_adapter') do # rubocop:disable Layout/LineLength + it { should exist } + its('group') { should eq 'root' } + end + describe directory('/var/lib/prometheus/prometheus_bigquery_remote_storage_adapter') do # rubocop:disable Layout/LineLength + it { should exist } + its('group') { should eq 'prometheus_bigquery_remote_st...' } + end + describe file("#{service_dir}/prometheus-bigquery-backend.service") do + it { should exist } + its('group') { should eq 'root' } + its('mode') { should cmp '0644' } + end describe file('/usr/local/sbin/alertmanager') do it { should exist } diff --git a/test/integration/default/controls/service_spec.rb b/test/integration/default/controls/service_spec.rb index 24178ff..05efd4a 100644 --- a/test/integration/default/controls/service_spec.rb +++ b/test/integration/default/controls/service_spec.rb @@ -11,6 +11,7 @@ control 'services with a consistent service name on each distro' do prometheus-alertmanager prometheus-node-exporter prometheus-blackbox-exporter + prometheus-bigquery-backend ] else %w[ @@ -18,6 +19,7 @@ control 'services with a consistent service name on each distro' do alertmanager node_exporter blackbox_exporter + prometheus-bigquery-backend ] end diff --git a/test/salt/pillar/default.sls b/test/salt/pillar/default.sls index b8799e6..f3e6063 100644 --- a/test/salt/pillar/default.sls +++ b/test/salt/pillar/default.sls @@ -20,6 +20,7 @@ prometheus: - postgres_exporter - mysqld_exporter - memcached_exporter # not in upstream repo, only archive + - prometheus_bigquery_remote_storage_adapter exporters: node_exporter: @@ -218,6 +219,22 @@ prometheus: source: https://github.com/wrouesnel/postgres_exporter/releases/download/v0.8.0/postgres_exporter_v0.8.0_linux-amd64.tar.gz skip_verify: true + prometheus_bigquery_remote_storage_adapter: + version: v0.4.6 + service: + name: prometheus-bigquery-backend + env: + - "PROMBQ_DATASET=prometheus" + - "PROMBQ_TABLE=metrics_stream" + - "PROMBQ_GCP_PROJECT_ID=foobar" + archive: + official: false + name: /opt/prometheus/prometheus_bigquery_remote_storage_adapter + options: "--strip-components=0" + source: https://github.com/KohlsTechnology/prometheus_bigquery_remote_storage_adapter/releases/download/v0.4.6/prometheus_bigquery_remote_storage_adapter_0.4.6_Linux_x86_64.tar.gz # noqa: 204 + source_hash: https://github.com/KohlsTechnology/prometheus_bigquery_remote_storage_adapter/releases/download/v0.4.6/checksums.txt + source_hash_name: prometheus_bigquery_remote_storage_adapter_0.4.6_Linux_x86_64.tar.gz + linux: # 'Alternatives system' priority: zero disables (default) # yamllint disable-line rule:braces