role service-grafana: set admin password during installation

This commit is contained in:
Julian Labus 2018-09-14 12:57:41 +02:00
parent 222b4e5197
commit d785c62eab
No known key found for this signature in database
GPG key ID: 8AF209F2C6B3572A
4 changed files with 9 additions and 4 deletions

View file

@ -18,8 +18,8 @@
state: present state: present
- name: copy grafana.ini - name: copy grafana.ini
copy: template:
src: grafana.ini src: grafana.ini.j2
dest: /etc/grafana/grafana.ini dest: /etc/grafana/grafana.ini
owner: root owner: root
group: grafana group: grafana

View file

@ -23,6 +23,8 @@ reporting_enabled = false
[security] [security]
admin_user = admin
admin_password = {{ lookup('passwordstore', 'grafana/admin') }};
login_remember_days = 7 login_remember_days = 7
[snapshots] [snapshots]

View file

@ -1,7 +1,7 @@
server { server {
listen 80; listen 80;
listen [::]:80; listen [::]:80;
server_name stats.{{ http_domain_internal }} stats.{{ http_domain_external }}; server_name {{ grafana_url_internal }} {{ grafana_url_external }};
include /etc/nginx/snippets/redirect-to-ssl.conf; include /etc/nginx/snippets/redirect-to-ssl.conf;
include /etc/nginx/snippets/letsencrypt-acme-challenge.conf; include /etc/nginx/snippets/letsencrypt-acme-challenge.conf;
@ -10,7 +10,7 @@ server {
server { server {
listen 443 ssl; listen 443 ssl;
listen [::]:443 ssl; listen [::]:443 ssl;
server_name stats.{{ http_domain_internal }} stats.{{ http_domain_external }}; server_name {{ grafana_url_internal }} {{ grafana_url_external }};
ssl_certificate /etc/nginx/ssl/{{ inventory_hostname_short }}.{{ http_domain_external }}/fullchain.pem; ssl_certificate /etc/nginx/ssl/{{ inventory_hostname_short }}.{{ http_domain_external }}/fullchain.pem;
ssl_certificate_key /etc/nginx/ssl/{{ inventory_hostname_short }}.{{ http_domain_external }}/privkey.pem; ssl_certificate_key /etc/nginx/ssl/{{ inventory_hostname_short }}.{{ http_domain_external }}/privkey.pem;

View file

@ -0,0 +1,3 @@
---
grafana_url_external: "{{ http_grafana_prefix }}.{{ http_domain_external }}"
grafana_url_internal: "{{ http_grafana_prefix }}.{{ http_domain_internal }}"