Skip to content

Commit

Permalink
Change Grafana admin password in the upgrade mode (hitachienergy#2420)
Browse files Browse the repository at this point in the history
  • Loading branch information
sbbroot committed Jan 12, 2022
1 parent ebbaeed commit 15d58ec
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ansible/playbooks/roles/grafana/tasks/upgrade/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,6 @@
file:
path: "{{ upgrade_defaults.state_file_path }}"
state: absent

- name: Run password change
include_tasks: upgrade/password_change.yml
10 changes: 10 additions & 0 deletions ansible/playbooks/roles/grafana/tasks/upgrade/password_change.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
- name: Fail when grafana admin password isn't set
fail:
msg: "Please specify grafana admin password (grafana_security.admin_password)"
when:
- grafana_security.admin_password is undefined or grafana_security.admin_password | length == 0

# Grafana admin password change is only available through the grafana-cli
- name: Change admin assword using grafana-cli
shell: grafana-cli admin reset-admin-password "{{ grafana_security.admin_password }}"
1 change: 1 addition & 0 deletions ansible/playbooks/upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@
- hosts: grafana
become: true
become_method: sudo
gather_facts: true
serial: 1
tasks:
- include_role:
Expand Down
1 change: 1 addition & 0 deletions docs/changelogs/CHANGELOG-1.3.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
- [#2774](https://github.com/epiphany-platform/epiphany/issues/2774) - Issue creating service principle on Azure
- [#2737](https://github.com/epiphany-platform/epiphany/issues/2737) - Fix asserting number of postgres nodes
- [#1175](https://github.com/epiphany-platform/epiphany/issues/1175) - Task 'Join to Kubernetes cluster' may fail when Ansible vault already exists
- [#2420](https://github.com/epiphany-platform/epiphany/issues/2420) - Changing Grafana admin password in the upgrade mode

### Updated

Expand Down

0 comments on commit 15d58ec

Please sign in to comment.