From 97a9cc01554d39eff5179d7aa2a62931607174ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20Beauz=C3=A9e-Luyssen?= Date: Tue, 30 Jul 2024 13:42:08 +0200 Subject: [PATCH 1/3] add a variable to enable remote updates And use it to enable the installer installation --- defaults/main.yml | 3 +++ tasks/installer-config.yml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index f12740c9..f026de1c 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -211,6 +211,9 @@ datadog_apm_instrumentation_docker_config: - stderr config_sources: BASIC +# Enable remote updates through datadog-installer +datadog_remote_updates: false + # # Internal variables # The following variables are for internal use only, do not modify them. diff --git a/tasks/installer-config.yml b/tasks/installer-config.yml index bfef937a..e85aed04 100644 --- a/tasks/installer-config.yml +++ b/tasks/installer-config.yml @@ -2,4 +2,4 @@ - name: Enable installer set_fact: datadog_installer_enabled: true - when: datadog_apm_instrumentation_enabled | length > 0 + when: datadog_apm_instrumentation_enabled | length > 0 or datadog_remote_updates | bool From f200ce829cd96720585d22967b8bc6756cae428d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20Beauz=C3=A9e-Luyssen?= Date: Tue, 30 Jul 2024 13:57:57 +0200 Subject: [PATCH 2/3] extend installer tests matrix with APM/remote updates --- .circleci/config.yml | 10 ++++++++-- ci_test/install_installer.yaml | 2 -- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3000a77f..ab108c0f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -244,12 +244,16 @@ jobs: inventory: type: string default: "ci.ini" + apm_enabled: + type: string + remote_updates: + type: string docker: - image: datadog/docker-library:ansible_<>_<> steps: - checkout - - run: ANSIBLE_JINJA2_NATIVE="<>" ansible-playbook -i ./ci_test/inventory/<> "./ci_test/install_installer.yaml" - - run: datadog-installer version + - run: ANSIBLE_JINJA2_NATIVE="<>" ansible-playbook -i ./ci_test/inventory/<> "./ci_test/install_installer.yaml" -e datadog_apm_instrumentation_enabled="<>" -e datadog_remote_updates="<>" + - run: bash -c 'if [ -n "<>" ] || [ "<>" = "true" ]; then datadog-installer version; elif command -v datadog-installer; then echo datadog-installer should not be installed; exit 2; else echo datadog-installer is not installed as expected; fi' workflows: version: 2 @@ -351,3 +355,5 @@ workflows: parameters: ansible_version: ["2_10", "3_4", "4_10"] os: ["debian", "centos", "amazonlinux2"] + apm_enabled: ["host", ""] + remote_updates: ["true", "false"] diff --git a/ci_test/install_installer.yaml b/ci_test/install_installer.yaml index 86daf150..43c2516c 100644 --- a/ci_test/install_installer.yaml +++ b/ci_test/install_installer.yaml @@ -7,5 +7,3 @@ datadog_api_key: "11111111111111111111111111111111" datadog_enabled: false datadog_skip_running_check: true - datadog_apm_instrumentation_enabled: host - datadog_remote_updates: true From f58e47edc44c48c4ba4b5e3d6cb00fbd0b023296 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20Beauz=C3=A9e-Luyssen?= Date: Wed, 31 Jul 2024 08:52:27 +0200 Subject: [PATCH 3/3] improve installer tests readability --- .circleci/config.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ab108c0f..cb0ab3ed 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -252,8 +252,20 @@ jobs: - image: datadog/docker-library:ansible_<>_<> steps: - checkout - - run: ANSIBLE_JINJA2_NATIVE="<>" ansible-playbook -i ./ci_test/inventory/<> "./ci_test/install_installer.yaml" -e datadog_apm_instrumentation_enabled="<>" -e datadog_remote_updates="<>" - - run: bash -c 'if [ -n "<>" ] || [ "<>" = "true" ]; then datadog-installer version; elif command -v datadog-installer; then echo datadog-installer should not be installed; exit 2; else echo datadog-installer is not installed as expected; fi' + - run: > + ANSIBLE_JINJA2_NATIVE="<>" ansible-playbook + -i ./ci_test/inventory/<> "./ci_test/install_installer.yaml" + -e datadog_apm_instrumentation_enabled="<>" + -e datadog_remote_updates="<>" + - run: > + bash -c 'if [ -n "<>" ] || [ "<>" = "true" ]; then + datadog-installer version; + elif command -v datadog-installer; then + echo datadog-installer should not be installed; + exit 2; + else + echo datadog-installer is not installed as expected; + fi' workflows: version: 2