Skip to content

Commit c280567

Browse files
authored
Support to override datadog-apm-inject version (#654)
* support for datadog-apm-inject version pin * 0.38 instead of 0.38.0 - crane ls install.datadoghq.com/apm-inject-package * remove sudo - we are already root, running in container * clarify changelog for air-gapped envs
1 parent 6042d10 commit c280567

File tree

6 files changed

+20
-2
lines changed

6 files changed

+20
-2
lines changed

.circleci/config.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,17 @@ jobs:
372372
else
373373
echo datadog-installer is not installed as expected;
374374
fi
375+
376+
if [ -n "<<parameters.apm_enabled>>" ]; then
377+
echo "Checking if datadog-apm-inject is installed...";
378+
if ! datadog-installer is-installed datadog-apm-inject; then
379+
echo "datadog-apm-inject is NOT installed as expected";
380+
exit 3;
381+
else
382+
echo "datadog-apm-inject is installed";
383+
fi
384+
fi
385+
375386
if [ "<<parameters.remote_updates>>" = "true" ]; then
376387
if [ -d /opt/datadog-agent ]; then
377388
echo "The agent should NOT have been installed by the distribution";

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ The API key is required and its absence causes the role to fail. If you want to
5454

5555
### Air-gapped environments
5656

57-
To install Datadog in an air-gapped environment using a specific registry and images, use the Datadog Ansible collection along with the `datadog_installer_registry`, `datadog_installer_auth`, `datadog_installer_version`, and `agent_datadog_config` variables.
57+
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.
5858

5959
**Note**: `agent_datadog_config` overrides the `installer_registry_config` setting.
6060

@@ -67,6 +67,7 @@ name: Datadog Agent Install
6767
vars:
6868
datadog_installer_registry: "my.local.registry"
6969
datadog_installer_version: 7.63
70+
datadog_apm_inject_version: 0.38
7071
datadog_yum_repo: "my.local.repo"
7172
datadog_api_key: "MY_DATADOG_API_KEY"
7273
datadog_site: "MY_DATADOG_SITE"

ci_test/install_installer_air_gapped.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@
1111
datadog_skip_running_check: true
1212
datadog_installer_registry: "install.datadoghq.com"
1313
datadog_installer_version: 7.62
14+
datadog_apm_inject_version: 0.38
1415
datadog_apm_instrumentation_enabled: host
1516
datadog_apm_instrumentation_libraries: ["java"]

defaults/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,9 @@ datadog_installer_auth: ""
202202
datadog_installer_version: ""
203203
installer_registry_config: {}
204204

205+
# Version for the datadog apm inject package
206+
datadog_apm_inject_version: ""
207+
205208
#
206209
# Internal variables
207210
# The following variables are for internal use only, do not modify them.

tasks/installer-config.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
registry: "{{ datadog_installer_registry }}"
1212
auth: "{{ datadog_installer_auth }}"
1313
version: "{{ datadog_installer_version }}"
14-
when: datadog_installer_registry or datadog_installer_auth or datadog_installer_version
14+
apm_inject_version: "{{ datadog_apm_inject_version }}"
15+
when: datadog_installer_registry or datadog_installer_auth or datadog_installer_version or datadog_apm_inject_version
1516

1617
- name: Update datadog_config including installer registry
1718
ansible.builtin.set_fact:

tasks/installer-setup.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
DD_INSTALLER_REGISTRY_AUTH_INSTALLER_PACKAGE: "{{ datadog_installer_auth }}"
4545
DD_INSTALLER_REGISTRY_URL_INSTALLER_PACKAGE: "{{ datadog_installer_registry }}"
4646
DD_INSTALLER_DEFAULT_PKG_VERSION_DATADOG_INSTALLER: "{{ datadog_installer_version | default('latest') }}"
47+
DD_INSTALLER_DEFAULT_PKG_VERSION_DATADOG_APM_INJECT: "{{ datadog_apm_inject_version | default('latest') }}"
4748
DD_AGENT_MAJOR_VERSION: "{{ datadog_agent_major_version | default('') }}"
4849
DD_AGENT_MINOR_VERSION: "{{ datadog_agent_minor_version | default('') }}"
4950
ignore_errors: true

0 commit comments

Comments
 (0)