diff --git a/roles/grafana/README.md b/roles/grafana/README.md index a8d9204..861f785 100644 --- a/roles/grafana/README.md +++ b/roles/grafana/README.md @@ -54,6 +54,7 @@ All variables which can be overridden are stored in [defaults/main.yml](defaults | `grafana_tracing` | {} | [tracing](http://docs.grafana.org/installation/configuration/#tracing) configuration section | | `grafana_snapshots` | {} | [snapshots](http://docs.grafana.org/installation/configuration/#snapshots) configuration section | | `grafana_image_storage` | {} | [image storage](http://docs.grafana.org/installation/configuration/#external-image-storage) configuration section | +| `grafana_date_formats` | {} | [date formats](http://docs.grafana.org/installation/configuration/#date_formats) configuration section | | `grafana_dashboards` | [] | List of dashboards which should be imported | | `grafana_dashboards_dir` | "dashboards" | Path to a local directory containing dashboards files in `json` format | | `grafana_datasources` | [] | List of datasources which should be configured | diff --git a/roles/grafana/defaults/main.yml b/roles/grafana/defaults/main.yml index 7819308..b45af1a 100644 --- a/roles/grafana/defaults/main.yml +++ b/roles/grafana/defaults/main.yml @@ -198,6 +198,17 @@ grafana_image_storage: {} # bucket: # path: +# Date format +grafana_date_formats: {} +# full_date: "DD-MM-YYYY HH:mm:ss" +# interval_second: "HH:mm:ss" +# interval_minute: "HH:mm" +# interval_hour: "DD/MM HH:mm" +# interval_day: "DD/MM" +# interval_month: "MM-YYYY" +# interval_year: "YYYY" +# use_browser_locale: true +# default_timezone: "browser" ####### # Plugins from https://grafana.com/plugins diff --git a/roles/grafana/templates/grafana.ini.j2 b/roles/grafana/templates/grafana.ini.j2 index 4fac6cd..709a4f7 100644 --- a/roles/grafana/templates/grafana.ini.j2 +++ b/roles/grafana/templates/grafana.ini.j2 @@ -195,3 +195,11 @@ provider = {{ grafana_image_storage.provider }} {{ k }} = {{ v }} {% endfor %} {% endif %} + +# Date formats +{% if grafana_date_formats != {} %} +[date_formats] +{% for k,v in grafana_date_formats.items() %} +{{ k }} = {{ v }} +{% endfor %} +{% endif %}