Skip to content
Snippets Groups Projects
monitor_postgrest.sls 672 B
Newer Older
  • Learn to ignore specific revisions
  • {% set has_ports_configured = salt['pillar.get']("postgrest:instances").values()|selectattr("config", "defined")|selectattr("config.admin-server-port", "defined") %}
    
    {% set file_path= '/usr/lib/check_mk_agent/local/monitor-postgrest' %}
    
    hsh_checkmk_monitor_postgrest_plugin:
    
    {% if has_ports_configured|list %}
    {% set instances = salt['pillar.get']("postgrest:instances") %}
    
      file.managed:
    
        - name: {{ file_path }}
    
        - source: salt://checkmk/custom-files/local/monitor-postgrest
        - template: jinja
        - context:
          instances: {{ instances }}
        - mode: 755
        - user: root
        - group: root
    
    {% else %}
      file.absent:
        - name: {{ file_path }}
    {% endif %}