Skip to content
This repository has been archived by the owner on May 31, 2023. It is now read-only.

Commit

Permalink
[ template ] Allow to override enabled parameter in auth block (#141)
Browse files Browse the repository at this point in the history
Allow to override enabled parameter in auth block
  • Loading branch information
Igorshp authored and paulfantom committed Mar 23, 2019
1 parent e3bb18b commit 2c4ee62
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
3 changes: 2 additions & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ grafana_auth: {}
# ldap:
# config_file: "/etc/grafana/ldap.toml"
# allow_sign_up: false
# basic: true
# basic:
# enabled: true

grafana_ldap: {}
# verbose_logging: false
Expand Down
3 changes: 2 additions & 1 deletion molecule/alternative/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
ldap:
config_file: "/etc/grafana/ldap.toml"
allow_sign_up: false
basic: true
basic:
enabled: true
grafana_ldap:
verbose_logging: false
servers:
Expand Down
8 changes: 3 additions & 5 deletions templates/grafana.ini.j2
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,13 @@ disable_login_form = {{ grafana_auth.disable_login_form | default('False') }}
disable_signout_menu = {{ grafana_auth.disable_signout_menu | default('False') }}
{% for section, options in grafana_auth.items() %}
{% if section in ['disable_login_form', 'disable_signout_menu'] %}
{% elif section == 'basic' %}
[auth.basic]
enabled = True
{% else %}
[auth.{{ section }}]
{% if "enabled" not in options %}
enabled = True
{% endif %}
{% for k, v in options.items() %}
{% if k != 'enabled' %}{{ k }} = {{ v }}
{% endif %}
{{ k }} = {{ v }}
{% endfor %}
{% endif %}
{% endfor %}
Expand Down

0 comments on commit 2c4ee62

Please sign in to comment.