Skip to content

Commit 882d9e5

Browse files
committed
update ini and set grafana provisioning
1 parent 67c8f0f commit 882d9e5

3 files changed

Lines changed: 28 additions & 2 deletions

File tree

infra/aggregation_mode/ansible/playbooks/grafana_agg_mode.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
- name: Set config vars from INI file
1616
set_fact:
17+
grafana_admin_password: "{{ lookup('ini', 'grafana_admin_password', file=config_file) }}"
1718
grafana_prometheus_url: "{{ lookup('ini', 'grafana_prometheus_url', file=config_file) }}"
1819
grafana_rpc_url: "{{ lookup('ini', 'grafana_rpc_url', file=config_file) }}"
1920
grafana_postgres_host: "{{ lookup('ini', 'grafana_postgres_host', file=config_file) }}"
@@ -103,6 +104,29 @@
103104
vars:
104105
ansible_ssh_user: "{{ admin_user }}"
105106

107+
- name: Set Grafana admin password
108+
become: true
109+
lineinfile:
110+
path: /etc/grafana/grafana.ini
111+
regexp: '^;?admin_password\s*='
112+
line: 'admin_password = {{ grafana_admin_password }}'
113+
insertafter: '^\[security\]'
114+
vars:
115+
ansible_ssh_user: "{{ admin_user }}"
116+
no_log: true
117+
118+
- name: Copy provisioning directory
119+
become: true
120+
copy:
121+
src: ../../../../grafana/provisioning/
122+
dest: /etc/grafana/provisioning/
123+
owner: grafana
124+
group: grafana
125+
mode: '0644'
126+
directory_mode: '0755'
127+
vars:
128+
ansible_ssh_user: "{{ admin_user }}"
129+
106130
- name: Enable and start Grafana service
107131
become: true
108132
systemd_service:

infra/aggregation_mode/ansible/playbooks/ini/config-hoodi.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,12 @@ gateway_primary_hostname=agg-mode-hoodi-gateway-1
7777
gateway_secondary_hostname=agg-mode-hoodi-gateway-2
7878

7979
# Grafana Configuration
80+
grafana_admin_password=
8081
grafana_prometheus_url=http://localhost:9090
8182
grafana_rpc_url=https://aligned-hoodi-rpc-geth.tail665ae.ts.net
8283
grafana_postgres_host=agg-mode-hoodi-postgres-1
8384
grafana_postgres_port=5432
8485
grafana_postgres_db=agg_mode
85-
grafana_postgres_user=autoctl_node
86+
grafana_postgres_user=grafana
8687
# REQUIRED: Set to same password as db_password
8788
grafana_postgres_password=

infra/aggregation_mode/ansible/playbooks/ini/config-mainnet.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,13 @@ gateway_primary_hostname=agg-mode-mainnet-gateway-1
7777
gateway_secondary_hostname=agg-mode-mainnet-gateway-2
7878

7979
# Grafana Configuration
80+
grafana_admin_password=
8081
grafana_prometheus_url=http://localhost:9090
8182
# TODO: Update with mainnet RPC URL
8283
grafana_rpc_url=https://aligned-mainnet-rpc-1.tail665ae.ts.net
8384
grafana_postgres_host=agg-mode-mainnet-postgres-1
8485
grafana_postgres_port=5432
8586
grafana_postgres_db=agg_mode
86-
grafana_postgres_user=autoctl_node
87+
grafana_postgres_user=grafana
8788
# REQUIRED: Set to same password as db_password
8889
grafana_postgres_password=

0 commit comments

Comments
 (0)