ansible-grafana icon indicating copy to clipboard operation
ansible-grafana copied to clipboard

Configuring `grafana_security.admin_user` and `grafana_security.admin_password` do not work

Open Xat59 opened this issue 3 years ago • 1 comments

What happened?

I have set both grafana_security.admin_user and grafana_security.admin_password, but can see the configured username/password do not work when login.

Here is the playbook.yml :

---
- name: Install Grafana
  include_role:
    name: cloudalchemy.grafana
  vars:
    grafana_security:
      admin_user: test
      admin_password: test
    grafana_datasources:
      - name: Prometheus
        type: prometheus
        access: proxy
        url: 'http://localhost:9090'
        basicAuth: false
        default: true
    grafana_dashboards_dir: "/tmp/grafana"
    grafana_provisioning_synced: true

I can see that official Grafana documentation says the password is set at first run. So I also tried to remove Grafana apt-get -y remove grafana, and remove these files : /etc/grafana/* and /var/lib/grafana/*, then re-run the playbook to reinstall from zero.

But, I have exactly the same behavior... maybe I have to purge/remove something more ?

Did you expect to see some different?

Regarding the playbook, the username/password of Grafana should be set to test / test. Instead, I need to use the defaults admin / admin as username / passwod to login.

How to reproduce it (as minimally and precisely as possible):

Use the playbook pasted before.

Environment

  • Role version:

Here is my requirements.yml :

- src: cloudalchemy.grafana
  version: 0.18.0
  • Ansible version information:
⇒  ansible --version
ansible 2.10.5
  config file = None
  configured module search path = ['/home/xat/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/xat/.local/lib/python3.8/site-packages/ansible
  executable location = /home/xat/.local/bin/ansible
  python version = 3.8.5 (default, Aug 12 2020, 00:00:00) [GCC 10.2.1 20200723 (Red Hat 10.2.1-1)]
  • Variables:
grafana_security.admin_password
grafana_security.admin_user
  • Ansible playbook execution Logs:

Everything is ok

Anything else we need to know?:

The generated /etc/grafana/grafana.ini contains the according values :

[security]          
admin_user = test
admin_password = test

Thanks a lot. Regards

Xat59 avatar Apr 19 '21 15:04 Xat59

Any fix: I am getting same issue.

AashishChughHome avatar Sep 18 '21 15:09 AashishChughHome

same here

gareji avatar Dec 30 '22 18:12 gareji

This role has been deprecated in favor of a the grafana-ansible-collection collection.

SuperQ avatar May 31 '23 04:05 SuperQ