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

Commit 2c4ee62

Browse files
Igorshppaulfantom
authored andcommitted
[ template ] Allow to override enabled parameter in auth block (#141)
Allow to override enabled parameter in auth block
1 parent e3bb18b commit 2c4ee62

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

defaults/main.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ grafana_auth: {}
8686
# ldap:
8787
# config_file: "/etc/grafana/ldap.toml"
8888
# allow_sign_up: false
89-
# basic: true
89+
# basic:
90+
# enabled: true
9091

9192
grafana_ldap: {}
9293
# verbose_logging: false

molecule/alternative/playbook.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
ldap:
2020
config_file: "/etc/grafana/ldap.toml"
2121
allow_sign_up: false
22-
basic: true
22+
basic:
23+
enabled: true
2324
grafana_ldap:
2425
verbose_logging: false
2526
servers:

templates/grafana.ini.j2

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,13 @@ disable_login_form = {{ grafana_auth.disable_login_form | default('False') }}
5858
disable_signout_menu = {{ grafana_auth.disable_signout_menu | default('False') }}
5959
{% for section, options in grafana_auth.items() %}
6060
{% if section in ['disable_login_form', 'disable_signout_menu'] %}
61-
{% elif section == 'basic' %}
62-
[auth.basic]
63-
enabled = True
6461
{% else %}
6562
[auth.{{ section }}]
63+
{% if "enabled" not in options %}
6664
enabled = True
65+
{% endif %}
6766
{% for k, v in options.items() %}
68-
{% if k != 'enabled' %}{{ k }} = {{ v }}
69-
{% endif %}
67+
{{ k }} = {{ v }}
7068
{% endfor %}
7169
{% endif %}
7270
{% endfor %}

0 commit comments

Comments
 (0)