Skip to content

Commit

Permalink
Fixes #23: Allow configuration of default Grafana admin password.
Browse files Browse the repository at this point in the history
  • Loading branch information
geerlingguy committed Jun 24, 2021
1 parent 1c09be9 commit 7388839
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 4 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,17 @@ Other features:
- `example.config.yml` to `config.yml`
4. Run the playbook: `ansible-playbook main.yml`

## Logging in
## Usage

Grafana has an admin username and password by default; currently this is not easily configurable, but follow [this issue](https://github.com/geerlingguy/internet-pi/issues/23) for progress making it more configurable.
### Pi-hole

The default is `admin`/`wonka`.
Visit the Pi's IP address (e.g. https://192.168.1.10/) and use the `pihole_password` you configured in your `config.yml` file.

### Grafana

Visit the Pi's IP address with port 3030 (e.g. https://192.168.1.10:3030/), and log in with username `admin` and the password `monitoring_grafana_admin_password` you configured in your `config.yml`.

> Note: The `monitoring_grafana_admin_password` is only used the first time Grafana starts up; if you need to change it later, do it via Grafana's admin UI.
## Updating and Backup

Expand Down
1 change: 1 addition & 0 deletions example.config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ pihole_password: change-this-password

# Internet monitoring configuration.
monitoring_enable: true
monitoring_grafana_admin_password: admin

# Shelly Plug configuration. (Also requires `monitoring_enable`)
shelly_plug_enable: false
Expand Down
4 changes: 4 additions & 0 deletions main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
update_cache: true
cache_valid_time: 3600

handlers:
- name: Include handlers.
ansible.builtin.import_tasks: tasks/handlers.yml

tasks:
- name: Setup Docker.
ansible.builtin.import_tasks: tasks/docker.yml
Expand Down
7 changes: 7 additions & 0 deletions tasks/handlers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
- name: Restart internet-monitoring
community.docker.docker_compose:
project_src: ~/internet-monitoring/
build: false
restarted: true
become: false
1 change: 1 addition & 0 deletions tasks/internet-monitoring.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
loop:
- src: grafana-config.monitoring.j2
dest: grafana/config.monitoring
notify: Restart internet-monitoring
become: false

- name: Ensure internet-monitoring environment is running.
Expand Down
2 changes: 1 addition & 1 deletion templates/grafana-config.monitoring.j2
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
GF_SECURITY_ADMIN_PASSWORD=wonka
GF_SECURITY_ADMIN_PASSWORD={{ monitoring_grafana_admin_password }}
GF_USERS_ALLOW_SIGN_UP=false
GF_INSTALL_PLUGINS=flant-statusmap-panel,ae3e-plotly-panel

0 comments on commit 7388839

Please sign in to comment.