-
Notifications
You must be signed in to change notification settings - Fork 222
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
Agent 7 support #220
Agent 7 support #220
Conversation
876dae6
to
d494f7f
Compare
d494f7f
to
22daa4d
Compare
README needs to be updated |
If datadog_agent_version is set, extracts the major version from it and sets datadog_agent_major_version with this value. If datadog_agent_major_version is already set, checks that the two variables are compatible, otherwise raises an error. Co-Authored-By: Albert Vaca <[email protected]>
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 added a small comment. Feel free to merge after addressing it !
README.md
Outdated
@@ -225,7 +263,7 @@ Sending data to Datadog US (default) and configuring a few checks. | |||
- { role: Datadog.datadog, become: yes } | |||
vars: | |||
datadog_api_key: "123456" | |||
datadog_agent_version: "1:6.13.0-1" # for apt-based platforms, use a `6.13.0-1` format on yum-based platforms and `6.13.0` for Windows | |||
datadog_agent_version: "1:7.16.0-1" # apt-based format; the role will deduce and use the `7.16.0-1` format on yum-based platforms and `7.16.0` on Windows |
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 just use the 7.16.0
format. The rest is only here to be backward compatible.
README.md
Outdated
@@ -4,13 +4,17 @@ | |||
[![Ansible Galaxy](http://img.shields.io/badge/galaxy-Datadog.datadog-660198.svg)](https://galaxy.ansible.com/Datadog/datadog/) | |||
[![Build Status](https://travis-ci.org/DataDog/ansible-datadog.svg?branch=master)](https://travis-ci.org/DataDog/ansible-datadog) | |||
|
|||
Install and configure Datadog Agent & checks. Starting with version `2` of this role Datadog Agent version 6 is installed by default (instead of version 5). | |||
Install and configure Datadog Agent & checks. | |||
The version `3` of this role installs the Datadog Agent version 7 by default. |
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.
Just realize that it's version 4 ! the role is already in version 3.3.0
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 just realized too! I'm going to change v3 -> v4 and v2 -> v3.
@KSerrania i'm going to give your fork a go, thanks for this |
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.
Left a question inline, and a few comments, LGTM overall.
One more suggestion: In defaults/main.yml
, I think we should more clearly separate the internal variables that are not part of the stable API of the role, from the variables that are part of the stable API. Typically, put all the internal variables at the end of the file in a section clearly separated with a very visible comment.
- name: Remove previous datadog apt list file | ||
file: | ||
path: /etc/apt/sources.list.d/ansible_datadog_agent.list | ||
state: absent |
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.
not sure I understand what this task is for: if I understand correctly the tasks below will update the /etc/apt/sources.list.d/ansible_datadog_agent.list
anyway, so why do we need to delete it here?
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.
The custom repository won't get deleted if this is not present. Moreover, if the internal variables (datadog_agentX_yyyyy_repo
) are modified, the previous values won't get removed from the source files, which may cause issues. IMO it's safer to explicitly remove the list file.
It does have the downside of making the role not idempotent though, so this is up for discussion.
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.
Ok, thanks for the explanation, makes sense. Indeed, the idempotency would be nice to have, but not blocking for this PR.
In a future version, we may want to revisit using the apt_repository
task. For our use case, I think all of this logic would be easier to implement with one single file
task that would trigger apt-get update
on the datadog repo whenever needed. Not necessary for now though.
Co-Authored-By: Olivier Vielpeau <[email protected]>
What does this PR do?
Adds Agent 7 install support.
The
datadog_agent5
option is deprecated and replaced bydatadog_agent_major_version
, which can be set to 5, 6 or 7.If set, the
datadog_agent_version
option must have the major version specified indatadog_agent_major_version
.For Agent 6 and 7, the
datadog_apt_repo
,datadog_yum_repo
,datadog_zypper_repo
options have been changed: if they're not set, the module will use the official Datadog repositoryfor the major version specified in
datadog_agent_major_version
. If they're set, the specified repository will be used, regardless of thedatadog_agent_major_version
set.WIP
Test Agent 7 install(tested with7.15.0~beta.1
), and various upgrade / downgrade scenarios.Manual test on SUSEAdd version changes to README + upgrade notes