From 8732481b20f6f9d6f14584ca7c3734b873a88bbb Mon Sep 17 00:00:00 2001 From: Campbell Pool Date: Mon, 17 May 2021 12:37:19 -0600 Subject: [PATCH 1/3] Make windows package download behavior consistent with linux Skip download in check mode --- tasks/pkg-windows.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/pkg-windows.yml b/tasks/pkg-windows.yml index 167a65ba..c6690b04 100644 --- a/tasks/pkg-windows.yml +++ b/tasks/pkg-windows.yml @@ -4,7 +4,7 @@ msg: "The Datadog ansible role does not currently support Agent 5" when: datadog_agent_major_version|int == 5 -# This is a best-effort solution to avoid redownloading the msi when +# This is a best-effort solution to avoid redownloading the msi when # It won't work with rc / beta builds, and won't work if the version to install # is not pinned (as we don't know what version latest will be before downloading # the package). @@ -72,7 +72,7 @@ url: "{{ dd_download_url }}" dest: '%TEMP%\ddagent.msi' register: download_msi_result - when: not datadog_skip_windows_install + when: (not datadog_skip_windows_install) and (not ansible_check_mode) - name: Create Binary directory root (if not default) win_file: From 216713416b73501b59fcf14923b8ca9b0531bd62 Mon Sep 17 00:00:00 2001 From: Campbell Pool Date: Tue, 18 May 2021 16:09:12 -0600 Subject: [PATCH 2/3] not attempt to delete msi in check mode --- tasks/pkg-windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/pkg-windows.yml b/tasks/pkg-windows.yml index c6690b04..b5cc284d 100644 --- a/tasks/pkg-windows.yml +++ b/tasks/pkg-windows.yml @@ -106,4 +106,4 @@ win_file: path: "{{ download_msi_result.dest }}" state: absent - when: (not datadog_skip_windows_install) and (download_msi_result.status_code == 200) + when: (not datadog_skip_windows_install) and (download_msi_result.status_code == 200) and (not ansible_check_mode) From a38b951b50761e121931703af5ddd4bd0e4f2f0a Mon Sep 17 00:00:00 2001 From: Campbell Pool Date: Wed, 19 May 2021 14:35:47 -0600 Subject: [PATCH 3/3] Update tasks/pkg-windows.yml Co-authored-by: Slavek Kabrda --- tasks/pkg-windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/pkg-windows.yml b/tasks/pkg-windows.yml index b5cc284d..5ee6e00b 100644 --- a/tasks/pkg-windows.yml +++ b/tasks/pkg-windows.yml @@ -106,4 +106,4 @@ win_file: path: "{{ download_msi_result.dest }}" state: absent - when: (not datadog_skip_windows_install) and (download_msi_result.status_code == 200) and (not ansible_check_mode) + when: (not datadog_skip_windows_install) and (not ansible_check_mode) and (download_msi_result.status_code == 200)