Merge pull request #5 from thouveng/fix-grafana-state
Fix grafana state
This commit is contained in:
commit
b73ac79c42
2 changed files with 9 additions and 4 deletions
|
@ -135,7 +135,7 @@ def present(name,
|
|||
timeout=profile.get('grafana_timeout', 3),
|
||||
)
|
||||
else:
|
||||
requests.put(
|
||||
requests.post(
|
||||
'{0}/api/datasources'.format(profile['grafana_url']),
|
||||
data,
|
||||
auth=_get_auth(profile),
|
||||
|
|
|
@ -19,9 +19,14 @@ grafana_client_datasource_{{ datasource_name }}:
|
|||
- access: proxy
|
||||
{%- endif %}
|
||||
{%- if datasource.user is defined %}
|
||||
- basic_auth: true
|
||||
- basic_auth_user: {{ datasource.user }}
|
||||
- basic_auth_password: {{ datasource.password }}
|
||||
- user: {{ datasource.user }}
|
||||
- password: {{ datasource.password }}
|
||||
{%- endif %}
|
||||
{%- if datasource.get('is_default', false) %}
|
||||
- is_default: {{ datasource.is_default }}
|
||||
{%- endif %}
|
||||
{%- if datasource.database is defined %}
|
||||
- database: {{ datasource.database }}
|
||||
{%- endif %}
|
||||
|
||||
{%- endfor %}
|
||||
|
|
Loading…
Reference in a new issue