Skip to content
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

Add 'site' option support #464

Merged
merged 4 commits into from Nov 28, 2018
Merged

Add 'site' option support #464

merged 4 commits into from Nov 28, 2018

Conversation

remicalixte
Copy link
Contributor

No description provided.

Copy link
Member

@truthbk truthbk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly looks good. Could you please add spec tests for the default + overriden cases?

manifests/init.pp Outdated Show resolved Hide resolved
@remicalixte
Copy link
Contributor Author

I will add some tests

@olivielpeau
Copy link
Member

just a note: in datadog.yaml, dd_url needs to be unset for site to take effect. So, ideally, the module wouldn't write dd_url to datadog.yaml unless it's explicitly set by the user.

@remicalixte
Copy link
Contributor Author

remicalixte commented Oct 23, 2018

dd_url is now empty by default but I had to add the default value for agent5 because it doesn't start with an empty dd_url

@remicalixte remicalixte force-pushed the remicalixte/site-option branch 12 times, most recently from 78eac75 to dec93c6 Compare October 23, 2018 21:51
Copy link
Member

@truthbk truthbk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I'm not mistaken we need to address the empty dd_url issue on older agent6 installs.

@@ -623,6 +634,7 @@
$_agent_config = {
'api_key' => $api_key,
'dd_url' => $dd_url,
'site' => $datadog_site,
Copy link
Member

@truthbk truthbk Nov 28, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the current manifest by default will yield a valid configuration for older A6 agents, unfortunately we need to support them: the problem we have here is that if this puppet manifest is used to install an older Agent6 (pre-site option) say 6.2.x it will yield a configuration with an empty dd_url and site set. It causes no harm to have site set, but the empty dd_url would be a no-no.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unlike A5, A6 has a default value for dd_url: https://github.com/DataDog/datadog-agent/blob/60fc833599c5015c15c741649840dc6bda930275/pkg/config/config.go#L75. That's why a left this parameter empty

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just tested, with an empty dd_url, agent 6.2.0 still reports to app.datadoghq.com

Copy link
Member

@truthbk truthbk Nov 28, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is accurate. Older agents DID specify a default for dd_url, apparently an empty string will not override this default vcalue. This was changed with the introduction of site, but this already accounts for that. 👍

Copy link
Member

@truthbk truthbk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! Thank you! 🙇

@truthbk truthbk merged commit d45e121 into master Nov 28, 2018
@truthbk truthbk deleted the remicalixte/site-option branch November 28, 2018 20:35
@truthbk truthbk added this to the 2.4.0 milestone Dec 20, 2018
cegeka-jenkins pushed a commit to cegeka/puppet-datadog_agent that referenced this pull request Apr 6, 2020
* Add 'site' option support

* Move default site to params

* Ensure dd_url is empty by default for agent 6

* Add spec test for new site option
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants