Skip to content

Commit 8218ea5

Browse files
authored
[AGENTONB-2675] Remove deprecated deb/rpm installer and support SSI using install-ssi.sh script (#682)
* Remove legacy installer package and unit files * Stop legacy installer systemd services and reload systemd graph * Remove configuration and installation of datadog-installer * Remove leftover from pr #624 installer/apm packages from pkg-redhat * Remove air-gapped installer doc and some installer-specific tests * First APM SSI iteration downloading and running the script * fix env placement + correct yaml * fix legacy installer removal task * Remove installer tests * Fix legacy installer removal conditionals * Only create install.json file if apm_instrumentation enabled is set * Use specific package built-in to avoid erroring out on AL2023 * Do not fail when trying to remove the package * Change logic for APM SSI to determine installation instead of weird skipping logic * Check apm status from installer + add .ansible to gitignore
1 parent 107a632 commit 8218ea5

23 files changed

+147
-589
lines changed

.circleci/config.yml

Lines changed: 19 additions & 188 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ commands:
4848
- run: datadog-agent version
4949
- run: datadog-agent status || true
5050

51-
5251
test_agent_install_downgrade:
5352
parameters:
5453
version:
@@ -188,7 +187,7 @@ jobs:
188187
- checkout
189188
- when:
190189
condition:
191-
equal: [ "6_macos", << parameters.agent_version >> ]
190+
equal: ["6_macos", << parameters.agent_version >>]
192191
steps:
193192
- run:
194193
name: Install Rosetta 2
@@ -224,6 +223,18 @@ jobs:
224223
- run: cd /tmp/system-tests/lib-injection/build/docker/python/dd-lib-python-init-test-django && sudo docker build -t system-tests/local .
225224
- run: sudo docker run -d --name test-app-python -p 5985:18080 system-tests/local:latest
226225
- run: curl --retry 10 --retry-max-time 30 --retry-all-errors localhost:5985
226+
# Verify the instrumentation status from datadog-installer
227+
- run: |
228+
status_json=$(sudo datadog-installer status --json | jq .apm_injection_status)
229+
for key in $(echo "$status_json" | jq -r 'keys[]'); do
230+
value=$(echo "$status_json" | jq -r --arg k "$key" '.[$k]')
231+
if [ "$value" != "true" ]; then
232+
echo "❌ Check failed: $key is not true (value: $value)"
233+
exit 1
234+
fi
235+
echo "✅ $key is true"
236+
done
237+
echo "🎉 All APM injection checks passed!"
227238
# verify that the emitted traces are received by checking agent status
228239
- run: |
229240
for i in {1..14}; do
@@ -256,147 +267,9 @@ jobs:
256267
- run: ps aux | grep -v grep | grep datadog-agent
257268
- run: >
258269
bash -c 'for tracer in ["java", "js", "dotnet", "python", "ruby"]; do
259-
print "Checking $tracer";
260270
sudo datadog-installer is-installed datadog-apm-library-$tracer;
261271
done'
262272
263-
test_installer:
264-
parameters:
265-
ansible_version:
266-
type: string
267-
jinja2_native:
268-
type: string
269-
default: "false"
270-
os:
271-
type: string
272-
inventory:
273-
type: string
274-
default: "ci.ini"
275-
apm_enabled:
276-
type: string
277-
docker:
278-
- image: datadog/docker-library:ansible_<<parameters.os>>_<<parameters.ansible_version>>
279-
steps:
280-
- checkout
281-
# datadog-installer will bailout if there's no systemctl binary, and won't attempt to
282-
# create the systemd folder to store its units
283-
# Since we're running the tests in a docker container without systemd, we can "help" it
284-
# proceed by pretending systemd is there
285-
- run: printf "#!/bin/bash\n\nexit 0" > /usr/bin/systemctl && chmod +x /usr/bin/systemctl
286-
- run: mkdir -p /etc/systemd/system/
287-
- run: >
288-
ANSIBLE_JINJA2_NATIVE="<<parameters.jinja2_native>>" ansible-playbook
289-
-i ./ci_test/inventory/<<parameters.inventory>> "./ci_test/install_installer.yaml"
290-
-e datadog_apm_instrumentation_enabled="<<parameters.apm_enabled>>"
291-
- run: >
292-
bash -c 'if [ -n "<<parameters.apm_enabled>>" ]; then
293-
datadog-installer version;
294-
elif [ -x "/opt/datadog-packages/datadog-installer" ]; then
295-
echo datadog-installer should not be installed;
296-
exit 2;
297-
else
298-
echo datadog-installer is not installed as expected;
299-
fi'
300-
301-
test_installer_suse:
302-
parameters:
303-
ansible_version:
304-
type: string
305-
jinja2_native:
306-
type: string
307-
default: "false"
308-
inventory:
309-
type: string
310-
default: "ci.ini"
311-
apm_enabled:
312-
type: string
313-
docker:
314-
- image: datadog/docker-library:ansible_suse_<<parameters.ansible_version>>
315-
steps:
316-
- checkout
317-
# datadog-installer will bailout if there's no systemctl binary, and won't attempt to
318-
# create the systemd folder to store its units
319-
# Since we're running the tests in a docker container without systemd, we can "help" it
320-
# proceed by pretending systemd is there
321-
- run: printf "#!/bin/bash\n\nexit 0" > /usr/bin/systemctl && chmod +x /usr/bin/systemctl
322-
- run: mkdir -p /etc/systemd/system/
323-
- run: >
324-
ANSIBLE_JINJA2_NATIVE="<<parameters.jinja2_native>>" ansible-playbook
325-
-i ./ci_test/inventory/<<parameters.inventory>> "./ci_test/install_installer.yaml"
326-
-e datadog_apm_instrumentation_enabled="<<parameters.apm_enabled>>"
327-
- run: >
328-
bash -c 'if [ -n "<<parameters.apm_enabled>>" ]; then
329-
datadog-installer version;
330-
elif [ -x "/opt/datadog-packages/datadog-installer" ]; then
331-
echo datadog-installer should not be installed;
332-
exit 2;
333-
else
334-
echo datadog-installer is not installed as expected;
335-
fi'
336-
337-
test_installer_air_gapped_rhel:
338-
parameters:
339-
ansible_version:
340-
type: string
341-
jinja2_native:
342-
type: string
343-
default: "false"
344-
os:
345-
type: string
346-
inventory:
347-
type: string
348-
default: "ci.ini"
349-
apm_enabled:
350-
type: string
351-
docker:
352-
- image: datadog/docker-library:ansible_<<parameters.os>>_<<parameters.ansible_version>>
353-
steps:
354-
- checkout
355-
# datadog-installer will bailout if there's no systemctl binary, and won't attempt to
356-
# create the systemd folder to store its units
357-
# Since we're running the tests in a docker container without systemd, we can "help" it
358-
# proceed by pretending systemd is there
359-
- run: printf "#!/bin/bash\n\nexit 0" > /usr/bin/systemctl && chmod +x /usr/bin/systemctl
360-
- run: mkdir -p /etc/systemd/system/
361-
- run: >
362-
ANSIBLE_JINJA2_NATIVE="<<parameters.jinja2_native>>" ansible-playbook -v
363-
-i ./ci_test/inventory/<<parameters.inventory>> "./ci_test/install_installer_air_gapped.yaml"
364-
-e datadog_apm_instrumentation_enabled="<<parameters.apm_enabled>>"
365-
- run: >
366-
bash -c 'if [ -n "<<parameters.apm_enabled>>" ]; then
367-
datadog-installer version;
368-
elif [ -x "/opt/datadog-packages/datadog-installer" ]; then
369-
echo datadog-installer should not be installed;
370-
exit 2;
371-
else
372-
echo datadog-installer is not installed as expected;
373-
fi
374-
375-
if [ -n "<<parameters.apm_enabled>>" ]; then
376-
echo "Checking if datadog-apm-inject is installed...";
377-
if ! datadog-installer is-installed datadog-apm-inject; then
378-
echo "datadog-apm-inject is NOT installed as expected";
379-
exit 3;
380-
else
381-
echo "datadog-apm-inject is installed";
382-
fi
383-
fi'
384-
385-
test_installer_over_pinned:
386-
docker:
387-
- image: datadog/docker-library:ansible_debian_2_10
388-
steps:
389-
- checkout
390-
# datadog-installer will bailout if there's no systemctl binary, and won't attempt to
391-
# create the systemd folder to store its units
392-
# Since we're running the tests in a docker container without systemd, we can "help" it
393-
# proceed by pretending systemd is there
394-
- run: printf "#!/bin/bash\n\nexit 0" > /usr/bin/systemctl && chmod +x /usr/bin/systemctl
395-
- run: mkdir -p /etc/systemd/system/
396-
- run: DD_API_KEY=woof DD_SITE="datadoghq.com" DD_INSTALL_ONLY=true DD_AGENT_MINOR_VERSION=53 bash -c "$(curl -L https://install.datadoghq.com/scripts/install_script_agent7.sh)"
397-
- run: >
398-
ansible-playbook -v -i ./ci_test/inventory/ci.ini "./ci_test/install_installer_over_pinned.yaml"
399-
400273
test_incorrect_rhel6_detect:
401274
# Ensure some RHEL derivatives aren't incorrectly detected as RHEL 6
402275
docker:
@@ -518,58 +391,16 @@ workflows:
518391
parameters:
519392
ansible_version: ["6.7.0", "12.0.0"]
520393

521-
- test_installer:
522-
matrix:
523-
parameters:
524-
ansible_version: ["2_10", "3_4", "4_10"]
525-
os: ["debian", "rocky8", "amazonlinux2023"]
526-
apm_enabled: ["host", ""]
527-
528-
- test_installer:
529-
matrix:
530-
parameters:
531-
ansible_version: ["12_0"]
532-
os: ["debian", "rocky9", "amazonlinux2023"]
533-
apm_enabled: ["host", ""]
534-
535-
- test_installer_suse:
536-
matrix:
537-
parameters:
538-
ansible_version: ["2_10", "3_4", "4_10"]
539-
apm_enabled: ["host", ""]
540-
541-
- test_installer_suse:
542-
matrix:
543-
parameters:
544-
ansible_version: ["12_0"]
545-
apm_enabled: ["host", ""]
546-
547-
- test_installer_air_gapped_rhel:
548-
matrix:
549-
parameters:
550-
ansible_version: ["2_10", "3_4", "4_10"]
551-
os: ["rocky8", "amazonlinux2023"]
552-
apm_enabled: ["host", ""]
553-
554-
- test_installer_air_gapped_rhel:
555-
matrix:
556-
parameters:
557-
ansible_version: ["12_0"]
558-
os: ["rocky9", "amazonlinux2023"]
559-
apm_enabled: ["host", ""]
560-
561-
- test_installer_over_pinned
562-
563394
- test_incorrect_rhel6_detect:
564-
matrix:
565-
parameters:
395+
matrix:
396+
parameters:
566397
ansible_version: ["4_10"]
567-
os: [ "amazonlinux2023"]
398+
os: ["amazonlinux2023"]
568399
python: ["python3"]
569400

570401
- test_incorrect_rhel6_detect:
571-
matrix:
572-
parameters:
402+
matrix:
403+
parameters:
573404
ansible_version: ["12_0"]
574-
os: [ "amazonlinux2023"]
405+
os: ["amazonlinux2023"]
575406
python: ["python3.11"]

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.idea/
22
*.retry
33
.venv
4+
.ansible
45

56
# Vagrant
67
.vagrant

README.md

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -46,27 +46,6 @@ To deploy the Datadog Agent on hosts, add the Datadog role and your API key to y
4646

4747
The API key is required and its absence causes the role to fail. If you want to provide it through another way, outside of Ansible's control, specify a placeholder key and substitute the key at a later point.
4848

49-
### Air-gapped environments
50-
51-
To install Datadog in an air-gapped environment using a specific registry and mirrored images, use the Datadog Ansible collection along with the `datadog_installer_registry`, `datadog_installer_auth`, and `agent_datadog_config` variables. While Datadog recommends fetching `latest`, `datadog_installer_version` and `datadog_apm_inject_version` can be provided to pin versions.
52-
53-
**Note**: `agent_datadog_config` overrides the `installer_registry_config` setting.
54-
55-
For example:
56-
57-
```yaml
58-
name: Datadog Agent Install
59-
include_role:
60-
name: datadog.dd.agent
61-
vars:
62-
datadog_installer_registry: "my.local.registry"
63-
datadog_installer_version: 7.63
64-
datadog_apm_inject_version: 0.38
65-
datadog_yum_repo: "my.local.repo"
66-
datadog_api_key: "MY_DATADOG_API_KEY"
67-
datadog_site: "MY_DATADOG_SITE"
68-
```
69-
7049
## Role variables
7150

7251
These variables provide additional configuration during the installation of the Datadog Agent. They should be specified in the `vars` section of your playbook.

ci_test/install_installer.yaml

Lines changed: 0 additions & 9 deletions
This file was deleted.

ci_test/install_installer_air_gapped.yaml

Lines changed: 0 additions & 16 deletions
This file was deleted.

ci_test/install_installer_over_pinned.yaml

Lines changed: 0 additions & 12 deletions
This file was deleted.

defaults/main.yml

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ datadog_agent_version: ""
6464
# Default Package name for APT and RPM installs - can override in playbook for IOT Agent
6565
datadog_agent_flavor: "datadog-agent"
6666

67-
datadog_installer_flavor: "datadog-installer"
68-
6967
# Default apt repo and keyserver
7068

7169
# By default, the role uses the official apt Datadog repository for the chosen major version
@@ -181,33 +179,27 @@ datadog_windows_config_root: "{{ ansible_facts.env['ProgramData'] }}\\Datadog"
181179
# arguments to supply to the windows installer.
182180
win_install_args: " "
183181

182+
# Advanced users - Configure datadog-installer to support advanced scenarios
183+
datadog_installer_registry: ""
184+
datadog_installer_auth: ""
185+
datadog_installer_version: ""
186+
datadog_apm_inject_version: ""
187+
184188
# Configure APM host injection. Possible values are: "all", "host" or "docker".
185-
datadog_apm_instrumentation_enabled: ""
189+
# datadog_apm_instrumentation_enabled: ""
186190

187191
# List of APM libraries with pinned versions to install if host or Docker injection is enabled.
188192
# Example: `["java:1.23.0", "python:2.0.9"]`
189193
# You can see the available values in our official docs:
190194
# https://docs.datadoghq.com/tracing/trace_collection/library_injection_local
191195
datadog_apm_instrumentation_libraries: []
192196

193-
# Used to send telemetry data to datadog on installation
194-
datadog_apm_telemetry_endpoint: "https://instrumentation-telemetry-intake.{{ datadog_site | default('datadoghq.com') }}/api/v2/apmtelemetry"
195-
196197
# Enable remote updates through datadog-installer
197198
datadog_remote_updates: false
198199

199200
# Set infrastructure monitoring mode (optional)
200201
# datadog_infrastructure_mode: ""
201202

202-
# Registry, auth, and version for the datadog installer
203-
datadog_installer_registry: ""
204-
datadog_installer_auth: ""
205-
datadog_installer_version: ""
206-
installer_registry_config: {}
207-
208-
# Version for the datadog apm inject package
209-
datadog_apm_inject_version: ""
210-
211203
#
212204
# Internal variables
213205
# The following variables are for internal use only, do not modify them.
@@ -266,8 +258,6 @@ datadog_macos_etc_dir: "/opt/datadog-agent/etc"
266258
datadog_macos_logs_dir: "/opt/datadog-agent/logs"
267259
datadog_macos_run_dir: "/opt/datadog-agent/run"
268260

269-
datadog_installer_enabled: false
270-
271261
datadog_ansible_facts_subset:
272262
- '!all'
273263
- '!any'

handlers/main.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,6 @@
1919
when: datadog_enabled and not ansible_check_mode and not ansible_facts.os_family == "Windows" and not ansible_facts.os_family == "Darwin"
2020
and (ansible_facts.services['datadog-agent-exp.service'] is not defined or ansible_facts.services['datadog-agent-exp.service'].state != "running")
2121

22-
- name: restart datadog-installer # noqa name[casing]
23-
ansible.builtin.service:
24-
name: datadog-installer
25-
state: restarted
26-
use: service
27-
# The installer currently only setup its systemd unit when APM instrumentation is enabled
28-
when: datadog_enabled and datadog_installer_enabled and
29-
not ansible_check_mode and not ansible_facts.os_family == "Windows" and not ansible_facts.os_family == "Darwin"
30-
3122
# We can't add the Windows Agent service restart handler directly here because that makes the role require
3223
# the ansible.windows collection on all platforms. We only want it to be needed on Windows.
3324
# Therefore, what we do is the following: when needed, our Windows tasks call this handler to require a

0 commit comments

Comments
 (0)