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

Allow to override enabled parameter in auth block #141

Merged
merged 5 commits into from
Mar 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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