Skip to content

Merge source repo #3

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

Open
wants to merge 58 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
13486f2
Make datadog.checks optional
norrland May 8, 2018
955c052
Merge pull request #22 from norrland/optional_checks
masci Jun 5, 2018
6536ae6
added changelog file
masci Jun 5, 2018
c97c1b4
cleanup and make config more flexible, preparing to support A6
masci Jun 7, 2018
8cc5c2c
addressed PR comments
masci Jun 8, 2018
3da82ac
Make copying the example config file more Salt friendly
Jun 10, 2018
8a30ca1
Merge pull request #25 from DataDog/massi/v6
masci Jun 10, 2018
506b72f
Install Agent 6 by default, and add ability to specify Agent version …
Jul 5, 2018
609c38a
Fix code blocks in README (#27)
Jul 5, 2018
1db01b7
Release 2.0 changelog
Jul 5, 2018
6e11bfd
Set default Agent version to install to 'latest'
Jul 5, 2018
9bf9a8f
Retry on failure when pulling the gpg key from keyserver.ubuntu.com
remicalixte Sep 18, 2018
51899ef
Merge pull request #28 from DataDog/remicalixte/gpg-retry
masci Sep 20, 2018
b7508fb
[install] Use long apt key fingerprint
KSerrania Jul 3, 2019
735e4bf
Merge pull request #30 from DataDog/kserrania/use-long-gpg-key
KSerrania Jul 29, 2019
174376a
Add site option
KSerrania Aug 2, 2019
8d0224d
Give distinct names to steps
KSerrania Aug 2, 2019
2eef12c
Comment site line if not provided in pillar
KSerrania Aug 6, 2019
395ea8d
Merge pull request #32 from DataDog/kserrania/add-site-option
KSerrania Aug 19, 2019
ae35fb5
Add python_version option (#33)
KSerrania Aug 22, 2019
567d3db
[install] Trust the new RPM GPG key on RHEL (#31)
KSerrania Aug 22, 2019
1817e08
Prepare release 2.1 (#34)
KSerrania Aug 28, 2019
6140a54
[pillar] Revamp pillar file structure & allow arbitrary keys in datad…
KSerrania Oct 1, 2019
fc359f9
Remove pillar variables not meant to be used (#36)
KSerrania Oct 7, 2019
2ab538a
Add ability to choose integration version (#37)
KSerrania Oct 7, 2019
2559615
[Agent 6] Put check config in <check>.d directory (#39)
KSerrania Nov 12, 2019
a00ffd3
Add Agent 7 support (#40)
KSerrania Nov 15, 2019
1a1fe31
Fix Agent 6 & 7 install from beta repositories (#42)
KSerrania Nov 19, 2019
8349c38
[redhat] Only import latest GPG key when installing Agent 7 (#43)
KSerrania Nov 20, 2019
1eb6921
Add changelog entry for 3.0
KSerrania Nov 20, 2019
cf979a8
Pass --build to ensure Dockerfile changes are picked up
albertvaka Dec 16, 2019
ed6103d
Keep the docker image running after starting it
albertvaka Dec 16, 2019
60d289d
Merge pull request #44 from DataDog/albertvaka/testing-nits
albertvaka Dec 16, 2019
5ff6dbd
Changelog update
KSerrania Dec 18, 2019
72327b6
Fix checks config directory permissions (#45)
KSerrania Dec 18, 2019
85baebc
Changelog update
KSerrania Dec 18, 2019
07d273b
Add changelog date
KSerrania Dec 18, 2019
a8316ae
Merge pull request #41 from DataDog/3.x
KSerrania Dec 18, 2019
928830b
Changelog link fix
KSerrania Dec 18, 2019
5597db4
Remove old check config file if check is installed with Agent 6/7 (#47)
KSerrania Jan 13, 2020
92a1770
Add CircleCI (#46)
KSerrania Jan 24, 2020
777f10c
SaltStack docs (#51)
ruthnaebeck May 28, 2020
e6b269c
Add PR template (#53)
mx-psi Jun 2, 2020
cdee2eb
Create install info file (#52)
mx-psi Jun 4, 2020
1014ca1
Addition of logs check section for docs (#54)
sarina-dd Jul 8, 2020
8eddc3b
Release 3.1 (#56)
KSerrania Jul 21, 2020
14ac017
Allow installing third-party integrations (#57)
KSerrania Aug 14, 2020
2936471
Use bool filter instead of == true (#58)
KSerrania Aug 20, 2020
cc63647
Restart the datadog-agent service after an integration install (#59)
KSerrania Aug 28, 2020
d0ec17c
Release 3.2 (#60)
KSerrania Aug 31, 2020
ac148f2
Trust new GPG keys (#63)
KSerrania Nov 9, 2020
6f2cfca
Release 3.3 (#64)
KSerrania Nov 16, 2020
53c05ff
Add the 'CURRENT' public key entry, get keys from keys.datadoghq.com …
Mar 26, 2021
1e21577
Enable repo_gpgcheck for Agent > 5 repos (#67)
Apr 27, 2021
d82c0ff
Implement improvements to APT keys management (#68)
May 19, 2021
87254de
Install datadog-signing-keys on Debian based platforms (#69)
Aug 2, 2021
bf8431c
DOCS-2275 Lint README (#70)
ruthnaebeck Aug 4, 2021
c5877ac
Prepare master->main default branch switch (#71)
KSerrania Aug 12, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
171 changes: 171 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
version: 2.1

commands:
setup_common:
steps:
- run: curl -L https://bootstrap.saltstack.com | sh -s -- -d -X stable; exit 0
- run: mkdir -p /etc/salt/minion.d && cp test/minion.d/masterless.conf /etc/salt/minion.d/
- run: mkdir -p /srv/pillar && cp -r test/pillar /srv/
- run: mkdir -p /srv/salt && cp -r test/base /srv/salt/
- run: mkdir -p /srv/salt/base && cp -r datadog /srv/salt/base/

setup_installed_version:
parameters:
version:
type: string
default: "7"
steps:
- run: cp test/pillar/datadog{<<parameters.version>>,}.sls

setup_ubuntu:
steps:
- run: apt-get update && apt-get install -y curl sudo
- run: cp test/utils/systemctl.py /bin/systemctl
- run: cp test/utils/systemctl.py /bin/systemd
- setup_common

setup_centos:
steps:
- run: yum -y update
- run: yum install -y curl sudo
- run: cp test/utils/systemctl.py /usr/bin/systemctl
- run: cp test/utils/systemctl.py /usr/bin/systemd
- setup_common

install:
steps:
- run: cp /srv/salt/base/top{_install,}.sls
- run: salt-call --local state.highstate -l debug

check_installed_version:
parameters:
version:
type: string
default: "7"
repo_type:
type: string
default: "apt"
steps:
- run: python test/utils/check_<<parameters.repo_type>>_install.py --major-version <<parameters.version>>

uninstall:
steps:
- run: cp /srv/salt/base/top{_uninstall,}.sls
- run: salt-call --local state.highstate -l debug

check_uninstalled:
parameters:
repo_type:
type: string
default: "apt"
steps:
- run: python test/utils/check_<<parameters.repo_type>>_install.py --not-installed

jobs:
agent7_ubuntu:
docker:
- image: ubuntu:bionic-20191202
steps:
- checkout
- setup_installed_version:
version: "7"
- setup_ubuntu
- install
- check_installed_version:
version: "7"
repo_type: "apt"
- uninstall
- check_uninstalled:
repo_type: "apt"

agent7_centos:
docker:
- image: centos:7
steps:
- checkout
- setup_installed_version:
version: "7"
- setup_centos
- install
- check_installed_version:
version: "7"
repo_type: "yum"
- uninstall
- check_uninstalled:
repo_type: "yum"

agent6_ubuntu:
docker:
- image: ubuntu:bionic-20191202
steps:
- checkout
- setup_installed_version:
version: "6"
- setup_ubuntu
- install
- check_installed_version:
version: "6"
repo_type: "apt"
- uninstall
- check_uninstalled:
repo_type: "apt"

agent6_centos:
docker:
- image: centos:7
steps:
- checkout
- setup_installed_version:
version: "6"
- setup_centos
- install
- check_installed_version:
version: "6"
repo_type: "yum"
- uninstall
- check_uninstalled:
repo_type: "yum"

agent5_ubuntu:
docker:
- image: ubuntu:bionic-20191202
steps:
- checkout
- setup_installed_version:
version: "5"
- setup_ubuntu
- install
- check_installed_version:
version: "5"
repo_type: "apt"
- uninstall
- check_uninstalled:
repo_type: "apt"

agent5_centos:
docker:
- image: centos:7
steps:
- checkout
- setup_installed_version:
version: "5"
- setup_centos
- install
- check_installed_version:
version: "5"
repo_type: "yum"
- uninstall
- check_uninstalled:
repo_type: "yum"


workflows:
version: 2.1
test_datadog_formula:
jobs:
- agent7_ubuntu
- agent7_centos
- agent6_ubuntu
- agent6_centos
- agent5_ubuntu
- agent5_centos
4 changes: 4 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
* @DataDog/agent-platform

# Docs
*README.md @DataDog/agent-platform @DataDog/documentation
15 changes: 15 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
### What does this PR do?

<!--A brief description of the change being made with this pull request.-->

### Motivation

<!--What inspired you to submit this pull request?-->

### Additional Notes

<!--Anything else we should know when reviewing?-->

### Describe your test plan

<!--Write there any instructions and details you may have to test your PR.-->
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ etc/*
share/*
.vagrant/*
.Python
*.pyc
87 changes: 87 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# Changes

## 3.3 / 2020-11-16

* [FEATURE] Trust new Datadog GPG keys [#63][]

## 3.2 / 2020-08-31

* [FEATURE] Allow installing third-party integrations [#57][] & [#58][]
* [BUGFIX] Restart the datadog-agent service after an integration install [#59][]

## 3.1 / 2020-07-21

* [FEATURE] Create install info file [#52][]
* [BUGFIX] Remove old check config file if check is installed with Agent 6/7 [#47][]

## 3.0 / 2019-12-18

**This formula will install Agent v7 by default.** Datadog Agent v7 runs checks with Python 3, so if you were running any custom checks written in Python, they must be compatible with Python 3. If you were not running any custom checks or if your custom checks are already compatible with Python 3, then it is safe to upgrade to Agent v7.

This release contains breaking changes to the pillar file structure. Please read the `README` file, in particular the `Pillar configuration`, as well as the [pillar example file](pillar.example) for details on how to write your pillar file.

* [FEATURE] Add Agent v7 support [#40][]
* [FEATURE] Allow all `datadog.yaml` config options for Agent v6 and v7 [#35][]
* [FEATURE] Add ability to choose check versions [#37][]
* [BUGFIX] Put check config files in the `<check>.d/` directory on Agent v6 and v7 [#39][]
* [BUGFIX] Fix Agent v6 and v7 install from beta repositories [#42][]
* [BUGFIX] Fix checks config directory permissions [#45][]
* [OTHER] Testing docs & scripts improvements [#44][]
* [OTHER] Do not import the old rpm GPG key if installing Agent v7 [#43][]
* [OTHER] Unused variable cleanup [#36][]

## 2.1 / 2019-08-27

* [FEATURE] Add python_version option [#33][]
* [FEATURE] Add site option [#32][]
* [BUGFIX] Retry on failure when pulling the gpg key from keyserver.ubuntu.com [#28][]
* [OTHER] Trust the new rpm gpg key on RHEL [#31][]
* [OTHER] Use the long apt key fingerprint [#30][]

## 2.0 / 2018-07-05

* Add support for Agent 6.
* Add option to specify which version of the Agent to install (installs the latest version of Agent 6 by default).
* Add CentOS testing environment, with the ability to specify which testing environment you want to spin up.

## 1.2 / 2018-06-05

* Make datadog.checks optional, see [#22][].

## 1.1 / 2018-03-05

* Trust the new GPG key in the APT repository, see [#20][].

## 1.0 / 2018-02-20

* Refactor the formula using a map.
* Added a Docker compose file to ease development.
* Added uninstall state.
* Watch config file for changes, see [#17][].
* Configure checks, see [#18][].

<!--- The following link definition list is generated by PimpMyChangelog --->
[#17]: https://github.com/DataDog/datadog-formula/issues/17
[#18]: https://github.com/DataDog/datadog-formula/issues/18
[#20]: https://github.com/DataDog/datadog-formula/issues/20
[#22]: https://github.com/DataDog/datadog-formula/issues/22
[#28]: https://github.com/DataDog/datadog-formula/issues/28
[#30]: https://github.com/DataDog/datadog-formula/issues/30
[#31]: https://github.com/DataDog/datadog-formula/issues/31
[#32]: https://github.com/DataDog/datadog-formula/issues/32
[#33]: https://github.com/DataDog/datadog-formula/issues/33
[#35]: https://github.com/DataDog/datadog-formula/issues/35
[#36]: https://github.com/DataDog/datadog-formula/issues/36
[#37]: https://github.com/DataDog/datadog-formula/issues/37
[#39]: https://github.com/DataDog/datadog-formula/issues/39
[#40]: https://github.com/DataDog/datadog-formula/issues/40
[#42]: https://github.com/DataDog/datadog-formula/issues/42
[#43]: https://github.com/DataDog/datadog-formula/issues/43
[#44]: https://github.com/DataDog/datadog-formula/issues/44
[#45]: https://github.com/DataDog/datadog-formula/issues/45
[#47]: https://github.com/DataDog/datadog-formula/issues/47
[#52]: https://github.com/DataDog/datadog-formula/issues/52
[#57]: https://github.com/DataDog/datadog-formula/issues/57
[#58]: https://github.com/DataDog/datadog-formula/issues/58
[#59]: https://github.com/DataDog/datadog-formula/issues/59
[#63]: https://github.com/DataDog/datadog-formula/issues/63
78 changes: 78 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Contributing

First of all, thanks for contributing!

This document provides guidelines and instructions for contributing to this repository. To propose improvements, feel free to submit a PR.

## Submitting issues

* If you think you've found an issue, search the issue list to see if there's an existing issue.
* Then, if you find nothing, open a Github issue.

## Pull Requests

Have you fixed a bug or written a new feature and want to share it? Many thanks!

When submitting your PR, here are some items you can check or improve to facilitate the review process:

* Have a proper commit history (we advise you to rebase if needed).
* Write tests for the code you wrote.
* Preferably, make sure that all unit tests pass locally and some relevant kitchen tests.
* Summarize your PR with an explanatory title and a message describing your changes, cross-referencing any related bugs/PRs.
* Open your PR against the `main` branch.

Your pull request must pass all CI tests before we merge it. If you see an error and don't think it's your fault, it may not be! [Join us on Slack][slack] or send us an email, and together we'll get it sorted out.

### Keep it small, focused

Avoid changing too many things at once. For instance if you're fixing a recipe and at the same time adding some code refactor, it makes reviewing harder and the _time-to-release_ longer.

### Commit messages

Please don't be this person: `git commit -m "Fixed stuff"`. Take a moment to write meaningful commit messages.

The commit message should describe the reason for the change and give extra details that allows someone later on to understand in 5 seconds the thing you've been working on for a day.

### Squash your commits

Rebase your changes on `main` and squash your commits whenever possible. This keeps history cleaner and easier to revert things. It also makes developers happier!

## Development

To ease the development of this formula, use Docker and Docker Compose with the compose file in `test/docker-compose.yaml`.

First, build and run a Docker container to create a masterless SaltStack minion. You have the option of choosing either
a Debian or Red Hat-based minion. Then, get a shell running in the container.

```shell
$ cd test/
$ TEST_DIST=debian docker-compose run masterless /bin/bash
```

Once you've built the container and have a shell up and running, apply the SaltStack state on your minion:

```shell
$ # On your SaltStack minion
$ salt-call --local state.highstate -l debug
```

### Testing

A proper integration test suite is still a work in progress. In the meantime, use the Docker Compose file provided in the `test` directory to check out the formula in action.

#### Requirements

* Docker
* Docker Compose

#### Run the formula

```shell
$ cd test/
$ TEST_DIST=debian docker-compose up --build
```

Check the logs to see if all the states completed successfully.


[slack]: http://datadoghq.slack.com
Loading