fix(suse): bypass salt alternatives.install errors

This commit is contained in:
N 2019-06-23 15:24:54 +01:00
parent c735a6deea
commit 1a890e5564
No known key found for this signature in database
GPG Key ID: 55A292EAB4E54067
3 changed files with 16 additions and 11 deletions

View File

@ -42,7 +42,6 @@ provisioner:
base:
'*':
- prometheus
- prometheus.exporters
pillars:
top.sls:
base:

View File

@ -4,12 +4,14 @@
prometheus:
wanted:
- prometheus
- pushgateway
{%- if grains.os_family not in ('Debian',) %}
- alertmanager
{%- endif %}
- node_explorer
# no memcached_exporter in upstream repo - only archive
# memcached_exporter
use_upstream_archive: True
use_upstream_archive: False
{%- if grains.os_family in ('CentOS',) %}
use_upstream_repo: False
{%- endif %}
@ -26,10 +28,10 @@ prometheus:
prometheus:
args:
web.listen-address: 0.0.0.0:9090
pushgateway:
args:
web.listen-address: ":9091"
web.telemetry-path: "/metrics"
#pushgateway:
#args:
# web.listen-address: ":9091"
# web.telemetry-path: "/metrics"
node_exporter:
args:
web.listen-address: ":9110"

View File

@ -18,7 +18,7 @@ include:
prometheus-archive-alternatives-install-{{ name }}-home-cmd-run:
cmd.run:
- name: update-alternatives --install {{ p.dir.basedir }}/{{ bundle }} prometheus-{{ name }}-home {{ p.dir.basedir }}/{{ bundle }} {{p.linux.altpriority}}
- name: update-alternatives --install {{ p.dir.basedir }}/{{ name }} prometheus-{{ name }}-home {{ p.dir.basedir }}/{{ bundle }} {{p.linux.altpriority}}
- watch:
- archive: prometheus-archive-install-{{ name }}-archive-extracted
@ -45,13 +45,18 @@ prometheus-archive-alternatives-install-{{ name }}-home-alternatives-set:
{%- endif %}
{% for b in p.pkg[name]['binaries'] %}
{%- if grains.os_family == 'Suse' %}
prometheus-archive-alternatives-install-{{ name }}-alternatives-install-{{ b }}:
prometheus-archive-alternatives-install-{{ name }}-cmd-run-{{ b }}-alternative:
cmd.run:
- onlyif: {{ grains.os_family in ('Suse',) }}
- name: update-alternatives --install /usr/local/bin/{{ b }} prometheus-{{ name }}-{{ b }} {{ p.dir.basedir }}/{{ bundle }}/{{ b }} {{ p.linux.altpriority }}
- require:
- cmd: prometheus-archive-alternatives-install-{{ name }}-home-cmd-run
{%- else %}
prometheus-archive-alternatives-install-{{ name }}-alternatives-install-{{ b }}:
alternatives.install:
- name: prometheus-{{ name }}-{{ b }}
- link: /usr/local/bin/{{ b }}
@ -60,7 +65,6 @@ prometheus-archive-alternatives-install-{{ name }}-alternatives-install-{{ b }}:
- order: 10
- require:
- alternatives: prometheus-archive-alternatives-install-{{ name }}-home-alternatives-install
- onlyif: {{ grains.os_family not in ('Suse',) }}
prometheus-archive-alternatives-install-{{ name }}-alternatives-set-{{ b }}:
alternatives.set:
@ -68,8 +72,8 @@ prometheus-archive-alternatives-install-{{ name }}-alternatives-set-{{ b }}:
- path: {{ p.dir.basedir }}/{{ bundle }}/{{ b }}
- require:
- alternatives: prometheus-archive-alternatives-install-{{ name }}-alternatives-install-{{ b }}
- onlyif: {{ grains.os_family not in ('Suse',) }}
{%- endif %}
{% endfor %}
{% endfor %}
{%- endif %}