Skip to content

Commit

Permalink
fix: reconfigure grafana admin passwd
Browse files Browse the repository at this point in the history
  • Loading branch information
ozennou committed Dec 25, 2024
1 parent 638d519 commit 80bc611
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions playbooks/Gitlab-instance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,15 @@
- name: Configure Grafana admin credentials
lineinfile:
path: /etc/grafana/grafana.ini
regexp: "{{ item.regexp }}"
line: "{{ item.line }}"
regexp: "^;?admin_{{ item.key }} *="
line: "admin_{{ item.key }} = {{ item.value }}"
insertafter: "^[security]"
loop:
- { regexp: '^admin_user *=', line: 'admin_user = {{ env_vars["GF_SECURITY_ADMIN_USER"] }}' }
- { regexp: '^admin_password *=', line: 'admin_password = {{ env_vars["GF_SECURITY_ADMIN_PASSWORD"] }}' }
- { key: "user", value: "{{ env_vars['GF_SECURITY_ADMIN_USER'] }}" }
- { key: "password", value: "{{ env_vars['GF_SECURITY_ADMIN_PASSWORD'] }}" }

- name: Start grafana service
systemd:
name: grafana-server
state: started
state: restarted
daemon_reload: yes

0 comments on commit 80bc611

Please sign in to comment.