From 6e5c970bcc99257f79c0f68a1a1b1393f381047c Mon Sep 17 00:00:00 2001 From: Craig Phillips Date: Wed, 20 Nov 2019 21:47:44 -0500 Subject: [PATCH 1/8] [tasks] Include Names for `include_tasks` Currently, the output when running this agent is not clear what exactly is being skipped. This just adds `name:` to each `include_tasks` in `tasks/main.yml` This makes the output a little more friendly. --- tasks/main.yml | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index c1b24cd7..1e567e18 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,30 +1,40 @@ --- -- include_tasks: pkg-debian.yml +- name: Debian Install Tasks + include_tasks: pkg-debian.yml when: ansible_os_family == "Debian" -- include_tasks: pkg-redhat.yml +- name: RedHat Install Tasks + include_tasks: pkg-redhat.yml when: ansible_os_family == "RedHat" -- include_tasks: pkg-suse.yml +- name: Suse Install Tasks + include_tasks: pkg-suse.yml when: ansible_os_family == "Suse" -- include_tasks: pkg-windows.yml +- name: Windows Install Tasks + include_tasks: pkg-windows.yml when: ansible_os_family == "Windows" -- include_tasks: agent5-linux.yml +- name: Agent5 Install Tasks (Linux) + include_tasks: agent5-linux.yml when: datadog_agent5 and ansible_os_family != "Windows" -- include_tasks: agent6-linux.yml +- name: Agent5 Install Tasks (Linux) + include_tasks: agent6-linux.yml when: not datadog_agent5 and ansible_os_family != "Windows" -- include_tasks: agent6-win.yml +- name: Agent6 Install Tasks (Windows) + include_tasks: agent6-win.yml when: not datadog_agent5 and ansible_os_family == "Windows" -- include_tasks: integration.yml +- name: Integrations Tasks + include_tasks: integration.yml when: datadog_integration is defined -- include_tasks: post_tasks/*.yml +- name: Post Tasks + include_tasks: post_tasks/*.yml when: post_tasks is defined -- include_tasks: pre_tasks/*.yml +- name: Pre Tasks + include_tasks: pre_tasks/*.yml when: pre_tasks is defined From 0496b1f98e1f37a6c7fadce2442ef222c315bf13 Mon Sep 17 00:00:00 2001 From: Craig Phillips Date: Fri, 20 Dec 2019 09:39:43 -0500 Subject: [PATCH 2/8] Update tasks/main.yml Co-Authored-By: Kylian Serrania --- tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/main.yml b/tasks/main.yml index 076b42f7..c7fb5b76 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -20,7 +20,7 @@ include_tasks: pkg-windows.yml when: ansible_os_family == "Windows" -- name: Agent5 Install Tasks (Linux) +- name: Linux Install Tasks (Agent 5) include_tasks: agent5-linux.yml when: datadog_agent5 and ansible_os_family != "Windows" From 7476e27422b9a9924039cea951d969ddbe3a26e5 Mon Sep 17 00:00:00 2001 From: Craig Phillips Date: Fri, 20 Dec 2019 09:39:56 -0500 Subject: [PATCH 3/8] Update tasks/main.yml Co-Authored-By: Kylian Serrania --- tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/main.yml b/tasks/main.yml index c7fb5b76..1813d941 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -22,7 +22,7 @@ - name: Linux Install Tasks (Agent 5) include_tasks: agent5-linux.yml - when: datadog_agent5 and ansible_os_family != "Windows" + when: datadog_agent_major_version|int == 5 and ansible_os_family != "Windows" - name: Agent5 Install Tasks (Linux) include_tasks: agent6-linux.yml From 86b884ea2acd9bd9aa754ae3ab75a60a1787aa79 Mon Sep 17 00:00:00 2001 From: Craig Phillips Date: Fri, 20 Dec 2019 09:40:30 -0500 Subject: [PATCH 4/8] Update tasks/main.yml Co-Authored-By: Kylian Serrania --- tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/main.yml b/tasks/main.yml index 1813d941..3fbb8617 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -24,7 +24,7 @@ include_tasks: agent5-linux.yml when: datadog_agent_major_version|int == 5 and ansible_os_family != "Windows" -- name: Agent5 Install Tasks (Linux) +- name: Linux Install Tasks include_tasks: agent6-linux.yml when: not datadog_agent5 and ansible_os_family != "Windows" From 3d4ad2cc4f0f8f410c81650ad0bb981a488941f6 Mon Sep 17 00:00:00 2001 From: Craig Phillips Date: Fri, 20 Dec 2019 09:40:56 -0500 Subject: [PATCH 5/8] Update tasks/main.yml Co-Authored-By: Kylian Serrania --- tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/main.yml b/tasks/main.yml index 3fbb8617..b26c079b 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -26,7 +26,7 @@ - name: Linux Install Tasks include_tasks: agent6-linux.yml - when: not datadog_agent5 and ansible_os_family != "Windows" + when: datadog_agent_major_version|int > 5 and ansible_os_family != "Windows" - name: Agent6 Install Tasks (Windows) include_tasks: agent6-win.yml From befb98cc665ea9619a6b4d00466c829c565ef2a6 Mon Sep 17 00:00:00 2001 From: Craig Phillips Date: Fri, 20 Dec 2019 09:41:24 -0500 Subject: [PATCH 6/8] Update tasks/main.yml Co-Authored-By: Kylian Serrania --- tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/main.yml b/tasks/main.yml index b26c079b..7132d587 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -29,7 +29,7 @@ when: datadog_agent_major_version|int > 5 and ansible_os_family != "Windows" - name: Agent6 Install Tasks (Windows) - include_tasks: agent6-win.yml + include_tasks: agent-win.yml when: not datadog_agent5 and ansible_os_family == "Windows" - name: Integrations Tasks From 4ab438e03889cb88f6746306fd3060496c955ace Mon Sep 17 00:00:00 2001 From: Craig Phillips Date: Fri, 20 Dec 2019 09:41:34 -0500 Subject: [PATCH 7/8] Update tasks/main.yml Co-Authored-By: Kylian Serrania --- tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/main.yml b/tasks/main.yml index 7132d587..4394c6f4 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -30,7 +30,7 @@ - name: Agent6 Install Tasks (Windows) include_tasks: agent-win.yml - when: not datadog_agent5 and ansible_os_family == "Windows" + when: datadog_agent_major_version|int > 5 and ansible_os_family == "Windows" - name: Integrations Tasks include_tasks: integration.yml From 66d88091fe527da2da09c95c43d22bf0c9df6677 Mon Sep 17 00:00:00 2001 From: Craig Phillips Date: Fri, 20 Dec 2019 09:44:40 -0500 Subject: [PATCH 8/8] [Changes] Resolving Requested Changes - missed the `agent6-linux.yml` to `agent-linux.yml`, updated here - ran through `yamllint` and `ansible-lint` - no issues except for `ansible-lint` errors for 501/602 --- tasks/main.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index 4394c6f4..76332787 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -5,7 +5,6 @@ - name: Debian Install Tasks include_tasks: pkg-debian.yml - when: ansible_os_family == "Debian" - name: RedHat Install Tasks @@ -25,7 +24,7 @@ when: datadog_agent_major_version|int == 5 and ansible_os_family != "Windows" - name: Linux Install Tasks - include_tasks: agent6-linux.yml + include_tasks: agent-linux.yml when: datadog_agent_major_version|int > 5 and ansible_os_family != "Windows" - name: Agent6 Install Tasks (Windows)