Be able to change duration of the gainsight execution

Change-Id: Ib46fd444ef87a6a76775ac37f6b4876aab6fd49c
Related-Bug: PROD-21034
This commit is contained in:
Mateusz Matuszkowiak 2018-06-26 21:33:25 +02:00
parent a335a1678d
commit 858fc1fb57
5 changed files with 20 additions and 3 deletions

View file

@ -5,4 +5,5 @@ parameters:
gainsight: gainsight:
enabled: true enabled: true
dir: dir:
config: /srv/volumes/local/gainsight config: /srv/volumes/local/gainsight/config
crontab: /srv/volumes/local/gainsight/cron.d

View file

@ -0,0 +1,2 @@
{% from "prometheus/map.jinja" import gainsight with context %}
{{ gainsight.crontab.duration }} root /opt/gainsight/entrypoint.py >> /var/log/cron.log 2>&1

View file

@ -7,12 +7,23 @@
file.directory: file.directory:
- makedirs: True - makedirs: True
{{gainsight.dir.crontab}}:
file.directory:
- makedirs: True
{{gainsight.dir.config}}/config.ini: {{gainsight.dir.config}}/config.ini:
file.managed: file.managed:
- source: salt://prometheus/files/gainsight.yml - source: salt://prometheus/files/gainsight/gainsight_config.yml
- template: jinja - template: jinja
- require: - require:
- file: {{gainsight.dir.config}} - file: {{gainsight.dir.config}}
{{gainsight.dir.crontab}}/crontab:
file.managed:
- source: salt://prometheus/files/gainsight/gainsight_crontab.yml
- template: jinja
- require:
- file: {{gainsight.dir.crontab}}
{%- endif %} {%- endif %}
{%- endif %} {%- endif %}

View file

@ -52,7 +52,10 @@
{% set gainsight = salt['grains.filter_by']({ {% set gainsight = salt['grains.filter_by']({
'default': { 'default': {
'queries': { 'queries': {
} },
'crontab': {
'duration': '0 0 * * *'
},
} }
}, merge=salt['pillar.get']('prometheus:gainsight')) %}} }, merge=salt['pillar.get']('prometheus:gainsight')) %}}