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

[CECO-1804] Add remote policies #821

Merged
merged 2 commits into from
Dec 2, 2024
Merged

[CECO-1804] Add remote policies #821

merged 2 commits into from
Dec 2, 2024

Conversation

tbavelier
Copy link
Member

@tbavelier tbavelier commented Nov 28, 2024

What does this PR do?

  1. Support for DD_REMOTE_POLICIES when using the installer, same behaviour as DD_REMOTE_UPDATES: 54b1765
  2. Link the datadog-agent service to the installer when the Agent is managed by it: 2e14d9b

Motivation

  1. Request from fleet automation team
  2. Using the installer with DD_REMOTE_UPDATES=true, the Agent package is installed with it but the service was not started as is for a normal Agent install as in [CECO-1729] Installer support #820, I gated the service behind non-installer managed Agent installations. This commit fixes that by defining the Agent service with the datadog-installer flavor and reverting the previous gate (return to original code for the management of /etc/datadog-agent/datadog.yaml before [CECO-1729] Installer support #820 ):
    file { '/etc/datadog-agent/datadog.yaml':
    owner => $dd_user,
    group => $dd_group,
    mode => '0640',
    content => template('datadog_agent/datadog.yaml.erb'),
    show_diff => false,
    notify => Service[$datadog_agent::params::service_name],
    require => File['/etc/datadog-agent'],
    }

Describe your test plan

  1. Use the following site.pp:
    class { "datadog_agent":
      api_key => "REPLACE_ME",
      datadog_site => "datad0g.com",
      manage_install => false,
      datadog_installer_enabled => true,
      remote_updates => true,
      remote_policies => true,
    }
  2. Ensure the DD Agent service is running after applying your manifest: systemctl status datadog-agent
  3. Verify remote_policies: true is in datadog.yaml
  4. Add a configuration option modifying datadog.yaml in your site.pp, e.g.:
    class { "datadog_agent":
      api_key => "REPLACE_ME",
      datadog_site => "datad0g.com",
      manage_install => false,
      datadog_installer_enabled => true,
      remote_updates => true,
      remote_policies => true,
      agent_extra_options => {
        foo => "bar",
      },
    }
  5. Ensure the Agent service was restarted

@tbavelier tbavelier marked this pull request as ready for review November 28, 2024 13:17
@tbavelier tbavelier requested review from a team as code owners November 28, 2024 13:17
Copy link
Contributor

@Pythyu Pythyu left a comment

Choose a reason for hiding this comment

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

Other than my comment looks good to me 👍

manifests/init.pp Show resolved Hide resolved
@tbavelier tbavelier merged commit 61b1de0 into main Dec 2, 2024
35 checks passed
@tbavelier tbavelier deleted the tbavelier/ceco-1804 branch December 2, 2024 15:30
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