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: base:
'*': '*':
- prometheus - prometheus
- prometheus.exporters
pillars: pillars:
top.sls: top.sls:
base: base:

View File

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

View File

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