Commit ea681728 authored by HgO's avatar HgO
Browse files

don't resetmol password

parent cb5f4b0d
Pipeline #413 passed with stage
in 1 minute and 32 seconds
grafana_domain: grafana.neutrinet.be
grafana_org_name: Neutrinet
grafana_admin_password: neutrinet
grafana_domain: grafana.example.com
grafana_org_name: Example
grafana_admin_password: neutrinet
......@@ -29,11 +29,22 @@
state: started
enabled: yes
- name: Ajout du job grafana dans Prometheus
copy:
src: prometheus/grafana.yml
dest: /etc/prometheus/conf.d/grafana.yml
owner: prometheus
group: prometheus
mode: "u=rw,go=r"
notify: reload prometheus
- name: Vérification du mot de passe admin
uri:
url: http://localhost:3000/api/login/ping
user: admin
password: "{{ grafana_admin_password }}"
# on utilise le mot de passe par défaut
# permet de vérifier si c'est une nouvelle install
password: admin
force_basic_auth: true
status_code: [200, 401]
no_log: true
......@@ -42,39 +53,6 @@
delay: 3
until: _grafana_admin_login_checked is success
- name: Modification du mot de passe admin
command: grafana-cli admin reset-admin-password {{ grafana_admin_password | quote }}
when: _grafana_admin_login_checked.status == 401
no_log: true
- name: Récupération des infos de l'organisation par défaut
uri:
url: http://localhost:3000/api/org
user: admin
password: "{{ grafana_admin_password }}"
force_basic_auth: true
register: _grafana_org
no_log: true
- name: Modification du nom de l'organisation
# Nécessaire pour permettre un accès anonyme aux dashboards de l'organisation
uri:
url: http://localhost:3000/api/org
method: PUT
body_format: form-multipart
body:
name: "{{ grafana_org_name }}"
user: admin
password: "{{ grafana_admin_password }}"
force_basic_auth: true
changed_when: _grafana_org.json.name != grafana_org_name
no_log: true
- name: Ajout du job grafana dans Prometheus
copy:
src: prometheus/grafana.yml
dest: /etc/prometheus/conf.d/grafana.yml
owner: prometheus
group: prometheus
mode: "u=rw,go=r"
notify: reload prometheus
- import_tasks: grafana/postinstall.yml
when: _grafana_admin_login_checked.status == 200
tags: ['grafana_postinstall']
- name: Récupération des infos de l'organisation par défaut
uri:
url: http://localhost:3000/api/org
user: admin
password: admin
force_basic_auth: true
register: _grafana_org
no_log: true
- name: Modification du nom de l'organisation
# Nécessaire pour permettre un accès anonyme aux dashboards de l'organisation
uri:
url: http://localhost:3000/api/org
method: PUT
body_format: form-multipart
body:
name: "{{ grafana_org_name }}"
user: admin
password: admin
force_basic_auth: true
changed_when: _grafana_org.json.name != grafana_org_name
no_log: true
- import_tasks: grafana.yml
- import_tasks: grafana/main.yml
tags: ['grafana']
- import_tasks: caddy.yml
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment