From f0dfe1ce06e9dda9400e60ad7602e87a1af554e6 Mon Sep 17 00:00:00 2001 From: Nelson Wang Date: Mon, 19 Oct 2020 13:55:39 -0700 Subject: [PATCH 1/7] Handling errors when build_location is a none-type (#565) --- roles/splunk_common/tasks/get_facts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/splunk_common/tasks/get_facts.yml b/roles/splunk_common/tasks/get_facts.yml index de90dab8..58b3aec9 100644 --- a/roles/splunk_common/tasks/get_facts.yml +++ b/roles/splunk_common/tasks/get_facts.yml @@ -71,7 +71,7 @@ set_fact: splunk_current_version: "{{ manifests.files[0].path | regex_search(regexp, '\\1') if (manifests.matched == 1) else '0' }}" splunk_current_build_hash: "{{ manifests.files[0].path | regex_search(regexp, '\\3') if (manifests.matched == 1) else '0' }}" - splunk_target_build_hash: "{{ splunk.build_location | regex_search(regexp, '\\3') | default('0') }}" + splunk_target_build_hash: "{{ splunk.build_location | string | regex_search(regexp, '\\3') | default('0') }}" vars: regexp: 'splunk\D*?-(\d+\.\d+\.\d+(\.\d+)?)-(.*?)-.*?' From 8c6287ad5db2f4a14f445241be35f8a196b91ff1 Mon Sep 17 00:00:00 2001 From: kashok-splunk Date: Thu, 29 Oct 2020 11:18:30 -0700 Subject: [PATCH 2/7] Changes needed for splunk operator to update distsearch.conf when attaching pvc volumes to the Splunk Operator- Monitoring console pod --- roles/splunk_monitor/tasks/adding_peers.yml | 39 +++++++++++++++++++++ roles/splunk_monitor/tasks/post_calls.yml | 35 ++++++++++++++++++ 2 files changed, 74 insertions(+) diff --git a/roles/splunk_monitor/tasks/adding_peers.yml b/roles/splunk_monitor/tasks/adding_peers.yml index cc429c0c..7c2b33d6 100644 --- a/roles/splunk_monitor/tasks/adding_peers.yml +++ b/roles/splunk_monitor/tasks/adding_peers.yml @@ -1,4 +1,43 @@ --- +- name: Fetch distsearch server info + uri: + url: "{{ cert_prefix }}://127.0.0.1:{{ splunk.svc_port }}/servicesNS/nobody/search/configs/conf-distsearch/distributedSearch?output_mode=json" + method: GET + user: "{{ splunk.admin_user }}" + password: "{{ splunk.password }}" + validate_certs: false + status_code: 200 + return_content: yes + body_format: json + use_proxy: no + register: distsearch_server_info + +- name: Initialize current group list + set_fact: + current_group_list: [] + +- name: Create list of current peers + set_fact: + current_group_list: "{{ current_group_list }} + [ '{{ item }}' ]" + with_items: "{{ distsearch_server_info['json']['entry'][0]['content']['servers'].split(',') }}" + when: distsearch_server_info['json']['entry'][0]['content']['servers'] is defined and (distsearch_server_info['json']['entry'][0]['content']['servers']| length > 0) + +- name: Remove search peers + command: "{{ splunk.exec }} remove search-server {{ item }} -auth {{ splunk.admin_user }}:{{ splunk.password }} -remoteUsername {{ splunk.admin_user }} -remotePassword {{ splunk.password }}" + become: yes + become_user: "{{ splunk.user }}" + register: remove_as_peer + until: remove_as_peer.rc == 0 or 'already exists' in remove_as_peer.stderr + retries: "{{ retry_num }}" + delay: "{{ retry_delay }}" + changed_when: remove_as_peer.rc == 0 + failed_when: remove_as_peer.rc != 0 and 'already exists' not in remove_as_peer.stderr + notify: + - Restart the splunkd service + no_log: "{{ hide_password }}" + with_items: "{{ current_group_list }}" + when: current_group_list is defined and (current_group_list| length > 0) + - name: Create list of peers set_fact: group_list: "{{ groups['splunk_indexer'] | default([]) }} + {{ groups['splunk_search_head'] | default([]) }} + {{ groups['splunk_search_head_captain'] | default([]) }} + {{ groups['splunk_cluster_master'] | default([]) }} + {{ groups['splunk_deployment_server']| default([]) }} + {{ groups['splunk_license_master'] | default([]) }} + {{ groups['splunk_standalone'] | default([]) }}" diff --git a/roles/splunk_monitor/tasks/post_calls.yml b/roles/splunk_monitor/tasks/post_calls.yml index 1a0e4dc2..9227e17c 100644 --- a/roles/splunk_monitor/tasks/post_calls.yml +++ b/roles/splunk_monitor/tasks/post_calls.yml @@ -19,6 +19,7 @@ validate_certs: false status_code: 201,409 use_proxy: no + register: distributed_groups loop: - "{{ dmc_group_cluster_master }}" - "{{ dmc_group_indexer }}" @@ -28,6 +29,26 @@ - "{{ dmc_group_search_head }}" - "{{ dmc_group_shc_deployer }}" +- name: Edit DMC Group Requests + uri: + url: "{{ cert_prefix }}://127.0.0.1:{{ splunk.svc_port }}/services/search/distributed/groups/{{ item }}/edit" + method: POST + user: "{{ splunk.admin_user }}" + password: "{{ splunk.password }}" + body: "{{ item }}" + validate_certs: false + status_code: 201,409 + use_proxy: no + loop: + - "{{ dmc_group_cluster_master }}" + - "{{ dmc_group_indexer }}" + - "{{ dmc_group_deployment_server }}" + - "{{ dmc_group_kv_store }}" + - "{{ dmc_group_license_master }}" + - "{{ dmc_group_search_head }}" + - "{{ dmc_group_shc_deployer }}" + when: distributed_groups.results[0].status == 409 + - name: Cluster Label POST Requests uri: url: "{{ cert_prefix }}://127.0.0.1:{{ splunk.svc_port }}/services/search/distributed/groups" @@ -39,4 +60,18 @@ status_code: 201,409 use_proxy: no loop: "{{ cluster_label_list_of_dicts }}" + register: cluster_label when: cluster_label_list_of_dicts is defined and item.cluster_label | length > 0 + +- name: Edit Cluster Label POST Requests + uri: + url: "{{ cert_prefix }}://127.0.0.1:{{ splunk.svc_port }}/services/search/distributed/groups" + method: POST + user: "{{ splunk.admin_user }}" + password: "{{ splunk.password }}" + body: "member={{ item.name }}&default=false&name=dmc_indexerclustergroup_{{ item.cluster_label }}/edit" + validate_certs: false + status_code: 201,409 + use_proxy: no + loop: "{{ cluster_label_list_of_dicts }}" + when: cluster_label_list_of_dicts is defined and item.cluster_label | length > 0 and cluster_label.results[0].status == 409 \ No newline at end of file From c1c6477a7b9b94623bc7b8ef9ff1c106fb789fba Mon Sep 17 00:00:00 2001 From: kashok-splunk Date: Thu, 29 Oct 2020 17:08:32 -0700 Subject: [PATCH 3/7] Update peer removal logic --- roles/splunk_monitor/tasks/adding_peers.yml | 27 +++++++++++++++------ 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/roles/splunk_monitor/tasks/adding_peers.yml b/roles/splunk_monitor/tasks/adding_peers.yml index 7c2b33d6..18b26d73 100644 --- a/roles/splunk_monitor/tasks/adding_peers.yml +++ b/roles/splunk_monitor/tasks/adding_peers.yml @@ -12,9 +12,11 @@ use_proxy: no register: distsearch_server_info -- name: Initialize current group list +- name: Initialize lists set_fact: current_group_list: [] + remove_peer_list: [] + updated_group_list: [] - name: Create list of current peers set_fact: @@ -22,6 +24,21 @@ with_items: "{{ distsearch_server_info['json']['entry'][0]['content']['servers'].split(',') }}" when: distsearch_server_info['json']['entry'][0]['content']['servers'] is defined and (distsearch_server_info['json']['entry'][0]['content']['servers']| length > 0) +- name: Create list of peers + set_fact: + group_list: "{{ groups['splunk_indexer'] | default([]) }} + {{ groups['splunk_search_head'] | default([]) }} + {{ groups['splunk_search_head_captain'] | default([]) }} + {{ groups['splunk_cluster_master'] | default([]) }} + {{ groups['splunk_deployment_server']| default([]) }} + {{ groups['splunk_license_master'] | default([]) }} + {{ groups['splunk_standalone'] | default([]) }}" + +- name: Update group_list + set_fact: + updated_group_list: "{{ updated_group_list }} + [ '{{ cert_prefix }}://{{ item }}:{{ splunk.svc_port }}' ]" + with_items: "{{ group_list }}" + +- name: Non-existent peers list + set_fact: + remove_peer_list: "{{ remove_peer_list }} + [ '{{ item }}' ]" + with_items: "{{ current_group_list }}" + when: item not in updated_group_list and current_group_list is defined and (current_group_list| length > 0) + - name: Remove search peers command: "{{ splunk.exec }} remove search-server {{ item }} -auth {{ splunk.admin_user }}:{{ splunk.password }} -remoteUsername {{ splunk.admin_user }} -remotePassword {{ splunk.password }}" become: yes @@ -35,12 +52,8 @@ notify: - Restart the splunkd service no_log: "{{ hide_password }}" - with_items: "{{ current_group_list }}" - when: current_group_list is defined and (current_group_list| length > 0) - -- name: Create list of peers - set_fact: - group_list: "{{ groups['splunk_indexer'] | default([]) }} + {{ groups['splunk_search_head'] | default([]) }} + {{ groups['splunk_search_head_captain'] | default([]) }} + {{ groups['splunk_cluster_master'] | default([]) }} + {{ groups['splunk_deployment_server']| default([]) }} + {{ groups['splunk_license_master'] | default([]) }} + {{ groups['splunk_standalone'] | default([]) }}" + with_items: "{{ remove_peer_list }}" + when: remove_peer_list is defined and (remove_peer_list| length > 0) - include_tasks: ../../../roles/splunk_common/tasks/wait_for_splunk_instance.yml vars: From 2a8a3540b483859d2afc4ab2ad4d28ad5441fb84 Mon Sep 17 00:00:00 2001 From: kashok-splunk Date: Thu, 29 Oct 2020 17:24:14 -0700 Subject: [PATCH 4/7] Remove linting errors --- roles/splunk_monitor/tasks/adding_peers.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/splunk_monitor/tasks/adding_peers.yml b/roles/splunk_monitor/tasks/adding_peers.yml index 18b26d73..6bbd1229 100644 --- a/roles/splunk_monitor/tasks/adding_peers.yml +++ b/roles/splunk_monitor/tasks/adding_peers.yml @@ -27,9 +27,9 @@ - name: Create list of peers set_fact: group_list: "{{ groups['splunk_indexer'] | default([]) }} + {{ groups['splunk_search_head'] | default([]) }} + {{ groups['splunk_search_head_captain'] | default([]) }} + {{ groups['splunk_cluster_master'] | default([]) }} + {{ groups['splunk_deployment_server']| default([]) }} + {{ groups['splunk_license_master'] | default([]) }} + {{ groups['splunk_standalone'] | default([]) }}" - + - name: Update group_list - set_fact: + set_fact: updated_group_list: "{{ updated_group_list }} + [ '{{ cert_prefix }}://{{ item }}:{{ splunk.svc_port }}' ]" with_items: "{{ group_list }}" From b3e6d953f18c8c7f054e5be76c9a4de132c04e7f Mon Sep 17 00:00:00 2001 From: sgontla <69372540+sgontla@users.noreply.github.com> Date: Fri, 30 Oct 2020 10:14:03 -0700 Subject: [PATCH 5/7] cspl-470: Always issue graceful restarts for Splunk service (#567) Dirty restarts are causing the missing rawdata journal.gz files --- roles/splunk_common/handlers/restart_splunk.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/splunk_common/handlers/restart_splunk.yml b/roles/splunk_common/handlers/restart_splunk.yml index 7f9ce983..a5841695 100644 --- a/roles/splunk_common/handlers/restart_splunk.yml +++ b/roles/splunk_common/handlers/restart_splunk.yml @@ -1,6 +1,6 @@ --- - name: "Restart the splunkd service - Via CLI" - command: "{{ splunk.exec }} restart -f --answer-yes --accept-license" + command: "{{ splunk.exec }} restart --answer-yes --accept-license" become: yes become_user: "{{ splunk.user }}" register: task_result From 4e92d68d1d5290b641a06674db9c2990fe546255 Mon Sep 17 00:00:00 2001 From: Alisha Mayor Date: Fri, 30 Oct 2020 13:56:59 -0700 Subject: [PATCH 6/7] Updating changelog for Release/8.0.7 (#570) --- docs/CHANGELOG.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 9b23e155..9b53ce16 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -3,6 +3,7 @@ ## Navigation * [8.1.0](#810) +* [8.0.7](#807) * [8.0.6](#806) * [8.0.5.1](#8051) * [8.0.5](#805) @@ -52,6 +53,16 @@ --- +## 8.0.7 + +#### What's New? +Syncing with latest codebase - currently up to sync with 8.1.0. + +#### Changes +* See [8.1.0](#810) changes above. + +--- + ## 8.0.6 #### What's New? From a2f5727b5fa0fe6f1299f301ae2ee91feb104205 Mon Sep 17 00:00:00 2001 From: Alisha Mayor Date: Mon, 23 Nov 2020 10:48:49 -0800 Subject: [PATCH 7/7] Update changelog for release/8.1.0.1 (#578) Skipping tests for docs update --- docs/CHANGELOG.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 9b53ce16..554253af 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -2,6 +2,7 @@ ## Navigation +* [8.1.0.1](#8101) * [8.1.0](#810) * [8.0.7](#807) * [8.0.6](#806) @@ -14,6 +15,7 @@ * [8.0.2](#802) * [8.0.1](#801) * [8.0.0](#800) +* [7.3.8](#738) * [7.3.7](#737) * [7.3.6](#736) * [7.3.5](#735) @@ -39,6 +41,13 @@ --- +## 8.1.0.1 + +#### Changes +* Bugfixes and cleanup + +--- + ## 8.1.0 #### What's New? @@ -220,6 +229,16 @@ Syncing with latest codebase - currently up to sync with 8.0.6. --- +## 7.3.8 + +#### What's New? +Syncing with latest codebase - currently up to sync with 8.1.0.1. + +#### Changes +* See [8.1.0.1](#8101) changes. + +--- + ## 7.3.7 #### What's New?