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

[agent6] adding support for the agent beta #356

Merged
merged 10 commits into from
Oct 26, 2017
Merged

[agent6] adding support for the agent beta #356

merged 10 commits into from
Oct 26, 2017

Conversation

truthbk
Copy link
Member

@truthbk truthbk commented Oct 12, 2017

This PR aims to provide a means to install the agent 6 (currently in beta) via the puppet module. It should allow for a seamless upgrade/downgrade experience as the integration configurations should be dropped in the right location in either case.

Please note the subset of configuration features for agent6 is still limited, with more to come in the coming days/weeks.

@truthbk truthbk changed the title [agent6] adding support for the agent beta [WIP] [agent6] adding support for the agent beta Oct 18, 2017
Copy link
Member

@hush-hush hush-hush left a comment

Choose a reason for hiding this comment

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

I left a few questions/comments (event if I'm not a puppet expert). Only real point is for the docker.yaml file in agent6.

$conf_dir = $datadog_agent::params::conf_dir,
$conf6_dir = $datadog_agent::params::conf6_dir,
Copy link
Member

Choose a reason for hiding this comment

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

Would it be possible to overwrite $conf_dir if agent6 is enable ? It would avoid adding a if/else statement in every integration .pp.

Copy link
Member Author

@truthbk truthbk Oct 24, 2017

Choose a reason for hiding this comment

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

variables are actually constants in puppet, so unfortunately no dice.

I first tried just adding agent6_enable but then that forced the customer to override conf_dir manually, that would result in a ton of issues and most customers would just expect the agent6_enable tag to work.

@@ -33,11 +33,23 @@
notify => Service[$datadog_agent::params::service_name]
}

file { "${datadog_agent::params::conf_dir}/docker.yaml":
if $::datadog_agent::agent6_enable {
$legacy_conf = "${datadog_agent::conf6_dir}/docker.yaml"
Copy link
Member

Choose a reason for hiding this comment

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

The old docker.yaml configuration file was remove from agent6 but the new docker check (the one in Go) is named docker. The docker_daemon.yaml configuration is not supported anymore.

I guess we should ensure:

  • for agent5: ensure docker.yaml is absent and docker_daemon.yaml present
  • for agent6: ensure docker.yaml is present and docker_daemon.yaml absent

What do you think ?

@@ -46,6 +49,7 @@
refreshonly => true,
tries => 2, # https://bugs.launchpad.net/launchpad/+bug/1430011 won't get fixed until 16.04 xenial
try_sleep => 30,
require => File['/etc/apt/sources.list.d/datadog-beta.list'],
Copy link
Member

Choose a reason for hiding this comment

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

Why do we require the beta list to update the agent ?

Copy link
Member Author

@truthbk truthbk Oct 24, 2017

Choose a reason for hiding this comment

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

Because the resource ensures the file will be absent - the file resource is required, and then the file is ensure => absent.

refreshonly => true,
tries => 2, # https://bugs.launchpad.net/launchpad/+bug/1430011 won't get fixed until 16.04 xenial
try_sleep => 30,
require => File['/etc/apt/sources.list.d/datadog.list'],
Copy link
Member

Choose a reason for hiding this comment

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

Same here: why do we need agent5 list ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Same :)

@@ -46,7 +46,7 @@
end

it do
should contain_file('/etc/dd-agent/datadog.yaml')\
should contain_file('/etc/datadog-agent/datadog-reports.yaml')\
Copy link
Member

Choose a reason for hiding this comment

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

So no matter the agent version we use /etc/datadog-agent for report ? Won't it be confusing for people update the puppet classes but not the agent ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, this sucks a bit... I guess maybe /etc/datadog/ is better. What I don't want to do is keep dd-agent around, because that will eventually be even more confusing for customers moving away from agent5.

Copy link
Member

Choose a reason for hiding this comment

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

Indeed. I guess /etc/datadog-agent is the best choice then.

@@ -46,7 +46,7 @@
end

it do
should contain_file('/etc/dd-agent/datadog.yaml')\
should contain_file('/etc/datadog-agent/datadog-reports.yaml')\
Copy link
Member

Choose a reason for hiding this comment

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

Indeed. I guess /etc/datadog-agent is the best choice then.

@truthbk truthbk merged commit 73fe2f4 into master Oct 26, 2017
@truthbk truthbk deleted the jaime/agent6 branch October 26, 2017 08:34
Dan70402 added a commit to Dan70402/puppet-datadog-agent that referenced this pull request Nov 18, 2017
[agent6] adding support for the agent beta (DataDog#356)
@ardrigh ardrigh mentioned this pull request Dec 12, 2017
@truthbk truthbk added this to the 1.12.0 milestone Dec 13, 2017
cegeka-jenkins pushed a commit to cegeka/puppet-datadog_agent that referenced this pull request Jan 31, 2018
* [agent6] add support for agent6 config locations.

* [agent6] adding agent6 repos.

* [agent6] adding datadog.yaml config template.

* [agent6] preparing main manifest for agent6 support.

fix lint issues

* [agent6][spec] fixes + spec test work

[spec] fix for older rubies.

[agent6] consistent YAML experience across puppets

[spec][agent6] cover old puppet ZAML regex

* [agent6][repo] remove beta if on stable and viceversa

* [agent6][spec] adding RHEL and Ubuntu repo tests

* [agent6][yum] no ensure on yumrepo -> use datadog repo definition for both beta and stable.

* [docker_daemon] agent6 goes back to docker.yaml for config

* [gemfile] pin jwt to 1.5.6
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.

2 participants