From 2656d9bae4de36c9821684b743547066b8726445 Mon Sep 17 00:00:00 2001 From: arcsector <26469747+arcsector@users.noreply.github.com> Date: Mon, 28 Aug 2023 12:46:14 -0700 Subject: [PATCH 1/3] creates local MC dir if nonexistent --- roles/splunk/tasks/configure_dmc.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/roles/splunk/tasks/configure_dmc.yml b/roles/splunk/tasks/configure_dmc.yml index 2132f794..0b6450af 100644 --- a/roles/splunk/tasks/configure_dmc.yml +++ b/roles/splunk/tasks/configure_dmc.yml @@ -14,6 +14,16 @@ become_user: "{{ splunk_nix_user }}" no_log: true +- name: Create local dir if it doesn't exist + ansible.builtin.file: + path: "{{ splunk_home }}/etc/apps/splunk_monitoring_console/local" + state: directory + owner: "{{ splunk_nix_user }}" + group: "{{ splunk_nix_group }}" + mode: 0744 + become: true + become_user: "{{ splunk_nix_user }}" + - name: Configure monitoring console in auto mode community.general.ini_file: path: "{{ splunk_home }}/etc/apps/splunk_monitoring_console/local/splunk_monitoring_console_assets.conf" From fdf5e2a718d820efc6d2eef30a1558fd623d1681 Mon Sep 17 00:00:00 2001 From: arcsector <26469747+arcsector@users.noreply.github.com> Date: Mon, 28 Aug 2023 13:03:15 -0700 Subject: [PATCH 2/3] Adding pre-existing peer doesn't fail task --- roles/splunk/tasks/configure_dmc.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/roles/splunk/tasks/configure_dmc.yml b/roles/splunk/tasks/configure_dmc.yml index 0b6450af..60e2abb4 100644 --- a/roles/splunk/tasks/configure_dmc.yml +++ b/roles/splunk/tasks/configure_dmc.yml @@ -13,6 +13,8 @@ become: true become_user: "{{ splunk_nix_user }}" no_log: true + changed_when: peer_add.rc == 0 + failed_when: peer_add.rc != 0 and peer_add.rc != 24 - name: Create local dir if it doesn't exist ansible.builtin.file: From 9a945e5460856996115828efe6104dab020b0842 Mon Sep 17 00:00:00 2001 From: arcsector <26469747+arcsector@users.noreply.github.com> Date: Mon, 28 Aug 2023 13:26:09 -0700 Subject: [PATCH 3/3] Fixes linter errors regarding include_task --- roles/splunk/tasks/configure_dmc.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/splunk/tasks/configure_dmc.yml b/roles/splunk/tasks/configure_dmc.yml index 60e2abb4..1206d16d 100644 --- a/roles/splunk/tasks/configure_dmc.yml +++ b/roles/splunk/tasks/configure_dmc.yml @@ -1,6 +1,6 @@ --- - name: Check splunk - include_task: check_splunk.yml + include_tasks: check_splunk.yml - name: Configure DMC as a IDXC member include_tasks: configure_idxc_sh.yml @@ -13,7 +13,7 @@ become: true become_user: "{{ splunk_nix_user }}" no_log: true - changed_when: peer_add.rc == 0 + changed_when: peer_add.rc == 0 failed_when: peer_add.rc != 0 and peer_add.rc != 24 - name: Create local dir if it doesn't exist