Add grafana playbook and machine #69

Merged
erdnaxe merged 5 commits from grafana into master 2021-11-27 18:34:46 +01:00
Member
No description provided.
jeltz reviewed 2021-11-27 10:22:19 +01:00
@ -0,0 +11,4 @@
apt_key:
url: https://packages.grafana.com/gpg.key
state: present
validate_certs: false
Owner

Perhaps it would be better to download once and for all the GPG key and store it in the repo?

At least, it seems important to set validate_certs: true.

Perhaps it would be better to download once and for all the GPG key and store it in the repo? At least, it seems important to set `validate_certs: true`.
erdnaxe marked this conversation as resolved
@ -0,0 +30,4 @@
retries: 3
until: apt_result is succeeded
- name: Configure Grafana
Owner

I personally don't like this way of partially configuring applications via Ansible.

I strongly prefer a template to deploy the entire grafana.ini file.

I find it much more readable (and more consistent for configuration files in a format that doesn't have a module like ini_file).
Furthermore, it guarantees the totality of the application's behaviour, and avoids having inconsistent configurations.

Nevertheless, I welcome pro-ini_file arguments.

I personally don't like this way of partially configuring applications via Ansible. I strongly prefer a `template` to deploy the entire `grafana.ini` file. I find it much more readable (and more consistent for configuration files in a format that doesn't have a module like `ini_file`). Furthermore, it guarantees the totality of the application's behaviour, and avoids having inconsistent configurations. Nevertheless, I welcome pro-`ini_file` arguments.
Author
Member

Pro-ini_file arguments:

  • Grafana configuration files evolve fast, it garantees that we are not replacing it with an older version.
  • Even if the targetted format is not supported by an Ansible module, you can always revert to lineinfile module which is able to replace a line with constraints.
  • Keeping small changes to the original file garantee better readability during APT upgrades.

Personnaly I hate ini_file and template. I would much rather prefer to not touch the sane defaults and just place an extra file with the configuration that is specific to Aurore. Because Grafana was not packaged by a Debian maintainer, it does not have the usual patch to add a conf.d directory to drop extra configuration.

Taking that into account, I would go for these choice (we need to discuss that):

  • For well-packaged software, let's just place files in conf.d or site-enabled folders without touching any other files if possible.
  • For packages that have their configuration moving fast (e.g. Gitlab, Grafana), let's use lineinfile or a specialized equivalent.
  • For stable packages that does not have .d folders, let's commit the original configuration as a template.
Pro-ini_file arguments: * Grafana configuration files evolve fast, it garantees that we are not replacing it with an older version. * Even if the targetted format is not supported by an Ansible module, you can always revert to `lineinfile` module which is able to replace a line with constraints. * Keeping small changes to the original file garantee better readability during APT upgrades. Personnaly I hate `ini_file` and `template`. I would much rather prefer to not touch the sane defaults and just place an extra file with the configuration that is specific to Aurore. Because Grafana was not packaged by a Debian maintainer, it does not have the usual patch to add a `conf.d` directory to drop extra configuration. Taking that into account, I would go for these choice (we need to discuss that): * For well-packaged software, let's just place files in `conf.d` or `site-enabled` folders without touching any other files if possible. * For packages that have their configuration moving fast (e.g. Gitlab, Grafana), let's use `lineinfile` or a specialized equivalent. * For stable packages that does not have `.d` folders, let's commit the original configuration as a template.
@ -0,0 +94,4 @@
value: "{{ grafana.database.user }}"
- section: database
option: password
value: "{{ grafana.database.password }}"
Owner

Where are Grafana logs sent?

It seems to be /var/log/grafana.log, when it should be either syslog or journald.

Where are Grafana logs sent? It seems to be `/var/log/grafana.log`, when it should be either syslog or journald.
Author
Member

It's also in journal, see sudo journalctl -xe -u grafana-server. Should I ask grafana to NOT log into /var/log/grafana/grafana.log?

It's also in journal, see `sudo journalctl -xe -u grafana-server`. Should I ask grafana to NOT log into `/var/log/grafana/grafana.log`?
erdnaxe marked this conversation as resolved
erdnaxe force-pushed grafana from 90a6e6acf0 to fdfed1a05a 2021-11-27 18:18:20 +01:00 Compare
erdnaxe added 1 commit 2021-11-27 18:29:23 +01:00
erdnaxe merged commit 00d63cf082 into master 2021-11-27 18:34:46 +01:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: aurore/ansible#69
No description provided.