{% set grafana = salt['grains.filter_by']({
    'Debian': {
        'revision': 'v1.5.3',
        'elasticsearchUrl': 'http://"+window.location.hostname.replace(/^grafana/,"elasticsearch")+":8080',
        'graphiteUrl': 'http://"+window.location.hostname.replace(/^grafana/,"graphite")+":8080'
    },
    'default': 'Debian',
}, merge=salt['pillar.get']('grafana', {})) %}

{% set graphite = salt['grains.filter_by']({
    'Debian': {
        'secret_key': 'updateme'
    },
    'default': 'Debian',
}, merge=salt['pillar.get']('graphite',{})) %}


{% set collectd = salt['grains.filter_by']({
    'Debian': {
        'carbon': 'monitoring.local',
        'revision': '5.4.0-ppa1~precise1'
    },
    'default': 'Debian',
}, merge=salt['pillar.get']('collectd',{})) %}


{% set beaver = salt['grains.filter_by']({
    'Debian': {
        'redis': {
            'host': 'localhost',
            'port': 6379,
            'db': 0,
        }
    },
    'default': 'Debian',
}, merge=salt['pillar.get']('beaver',{})) %}




{% set grafana = salt['grains.filter_by']({
    'Debian': {
        'revision': 'v1.5.3',
        'elasticsearchUrl': '//"+window.location.hostname.replace(/^grafana/,"elasticsearch")+(window.location.port ? ":" + window.location.port : "")+"',
        'graphiteUrl': '//"+window.location.hostname.replace(/^grafana/,"graphite")+(window.location.port ? ":" + window.location.port : "")+"',
    },
    'default': 'Debian',
}, merge=salt['pillar.get']('grafana', {})) %}

{% set graphite = salt['grains.filter_by']({
    'Debian': {
        'secret_key': 'updateme'
    },
    'default': 'Debian',
}, merge=salt['pillar.get']('graphite',{})) %}


{% set collectd = salt['grains.filter_by']({
    'Debian': {
        'carbon': 'monitoring.local',
        'revision': '5.4.0-ppa1~precise1'
    },
    'default': 'Debian',
}, merge=salt['pillar.get']('collectd',{})) %}


{% set beaver = salt['grains.filter_by']({
    'Debian': {
        'redis': {
            'host': 'localhost',
            'port': 6379,
            'db': 0,
        }
    },
    'default': 'Debian',
}, merge=salt['pillar.get']('beaver',{})) %}




Use port from request and scheme-relative for ElasticSearch and Graphite URLs
Use port from request and scheme-relative for ElasticSearch and Graphite URLs
