-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ansible Role for deploying grafana-agent #734
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good start and there are some things we could improve.
I recommend merging #733 first, then rebasing this PR onto main
, so that the linter will run on this PR.
@@ -0,0 +1,6 @@ | |||
--- | |||
- name: "Restart grafana agent instance - linux" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simpler is better
- name: "Restart grafana agent instance - linux" | |
- name: "Restart grafana agent" |
roles/grafana_agent/tasks/main.yml
Outdated
dest: "/etc/grafana-agent.yaml" | ||
mode: "0550" | ||
group: "grafana-agent" | ||
notify: "Restart grafana agent instance - linux" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
notify: "Restart grafana agent instance - linux" | |
notify: "Restart grafana agent" |
1b56324
to
69c68f5
Compare
roles/grafana_agent/tasks/main.yml
Outdated
ansible.builtin.yum_repository: | ||
baseurl: "https://rpm.grafana.com" | ||
name: "grafana" | ||
description: "Grafana's repository" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please enable GPG checking:
description: "Grafana's repository" | |
description: "grafana" | |
gpgcheck: true | |
gpgkey: https://rpm.grafana.com/gpg.key |
roles/grafana_agent/tasks/main.yml
Outdated
|
||
- name: "Import Grafana GPG key" | ||
become: true | ||
ansible.builtin.apt_key: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand we've used apt_key
for a while, but as the apt_key
docs explain, the latest Debian/Ubuntu will no longer support this.
It's ok for today, but in the future, prepare to use the alternative example in the apt_repository
docs (the get_url
module plus the signed-by
setting).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should do this the new way, and we should also work on fixing all the rest of the apt-key invocations. One of the Debs already requires it and I'm not sure but I think newer Ubuntu may as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should do this the new way, and we should also work on fixing all the rest of the apt-key invocations. One of the Debs already requires it and I'm not sure but I think newer Ubuntu may as well.
I updated the key import task to ansible.builtin.get_url and tested it on apt/rpm machines.
69c68f5
to
93ea4b0
Compare
Could you merge #733 first, then rebase this PR onto |
I don't think we should put variables into |
Adam and I chatted about this PR.
|
93ea4b0
to
36577f9
Compare
@akraitman have you resolved all of Ken's earlier issues? |
36577f9
to
978d5cb
Compare
Yes, I removed the if statement from grafana-agent.yaml.j2 and removed the "agent_metrics" variable from defaults/main.yml |
978d5cb
to
87841e2
Compare
87841e2
to
98d67b5
Compare
98d67b5
to
c6e0f66
Compare
c6e0f66
to
ab69a0b
Compare
Signed-off-by: Adam Kraitman <[email protected]>
ab69a0b
to
7ea20e3
Compare
No description provided.