diff --git a/roles/grafana/tasks/main.yml b/roles/grafana/tasks/main.yml index e69bab1..d5384f6 100644 --- a/roles/grafana/tasks/main.yml +++ b/roles/grafana/tasks/main.yml @@ -15,7 +15,7 @@ mysql_user: name: grafana host: localhost - password: "{{ grafana_mysql_password }}" + password: "{{ grafana.mysql_password }}" priv: "grafana.*:ALL,GRANT" login_user: root login_password: "{{ mysql.root_password }}" @@ -32,22 +32,22 @@ - name: Template out vhost template: src: "apache2-vhost-ssl.conf" - dest: "/etc/apache2/sites-available/{{ grafana_url }}.conf" + dest: "/etc/apache2/sites-available/{{ grafana.url }}.conf" notify: restart apache - name: Create webroot file: state: directory - path: "{{ grafana_webroot }}" + path: "{{ grafana.webroot }}" - name: Enable site command: - cmd: "a2ensite {{ grafana_url }}.conf" - creates: "/etc/apache2/sites-enabled/{{ grafana_url }}.conf" + cmd: "a2ensite {{ grafana.url }}.conf" + creates: "/etc/apache2/sites-enabled/{{ grafana.url }}.conf" notify: restart apache - name: Generate certificate include_role: name: https vars: - website_url: "{{ grafana_url }}" + website_url: "{{ grafana.url }}" - name: Add and configure packages block: - name: Add APT signing key diff --git a/roles/grafana/templates/apache2-vhost-ssl.conf b/roles/grafana/templates/apache2-vhost-ssl.conf index c7c5140..8762290 100644 --- a/roles/grafana/templates/apache2-vhost-ssl.conf +++ b/roles/grafana/templates/apache2-vhost-ssl.conf @@ -1,4 +1,4 @@ -# Configuration for {{ grafana_url }} +# Configuration for {{ grafana.url }} # vim:ft=apache: # Accept connections from non-SNI clients @@ -8,19 +8,19 @@ SSLProxyEngine on # Website configuration - ServerName {{ grafana_url }} - Redirect permanent / https://{{ grafana_url }} + ServerName {{ grafana.url }} + Redirect permanent / https://{{ grafana.url }} SSLEngine on - SSLCertificateFile /etc/pki/cert/crt/{{ grafana_url }}.crt - SSLCertificateKeyFile /etc/pki/cert/private/{{ grafana_url }}.key - SSLCertificateChainFile /etc/pki/cert/crt/{{ grafana_url }}-fullchain.crt + SSLCertificateFile /etc/pki/cert/crt/{{ grafana.url }}.crt + SSLCertificateKeyFile /etc/pki/cert/private/{{ grafana.url }}.key + SSLCertificateChainFile /etc/pki/cert/crt/{{ grafana.url }}-fullchain.crt SSLProtocol {{ ssl_protocol }} SSLCipherSuite {{ ssl_cipher_suite }} - ServerName {{ grafana_url }} - DocumentRoot {{ grafana_webroot }} - + ServerName {{ grafana.url }} + DocumentRoot {{ grafana.webroot }} + Require all granted AllowOverride All Options MultiViews FollowSymlinks diff --git a/roles/grafana/templates/grafana.ini b/roles/grafana/templates/grafana.ini index 1bd9dfb..3e74057 100644 --- a/roles/grafana/templates/grafana.ini +++ b/roles/grafana/templates/grafana.ini @@ -78,7 +78,7 @@ host = 127.0.0.1:3306 name = grafana user = grafana # If the password contains # or ; you have to wrap it with triple quotes. Ex """#password;""" -password = {{ grafana_mysql_password }} +password = {{ grafana.mysql_password }} # Use either URL or the previous fields to configure the database # Example: mysql://user:secret@host:port/database