Skip to content

Commit 0798330

Browse files
Merge pull request #817 from splunk/develop
Patch1 releases for 9.0.9, 9.1.4 and 9.2.1
2 parents ec7b9c0 + 199cbb2 commit 0798330

File tree

9 files changed

+105
-22
lines changed

9 files changed

+105
-22
lines changed

docs/CHANGELOG.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
## Changelog
22

33
## Navigation
4+
* [9.2.1-patch1](#921-patch1)
45
* [9.2.1](#921)
56
* [9.2.0.1](#9201)
67
* [9.2.0](#920)
8+
* [9.1.4-patch1](#914-patch1)
79
* [9.1.4](#914)
810
* [9.1.3](#913)
911
* [9.1.2](#912)
1012
* [9.1.1](#911)
1113
* [9.1.0.2](#9102)
1214
* [9.1.0.1](#9101)
15+
* [9.0.9-patch1](#909-patch1)
1316
* [9.0.9](#909)
1417
* [9.0.8](#908)
1518
* [9.0.7](#907)
@@ -87,6 +90,14 @@
8790

8891
---
8992

93+
## 9.2.1-patch1
94+
95+
#### Changes
96+
* Check for UDS file instead of UDS flag
97+
* Bugfixes
98+
99+
---
100+
90101
## 9.2.1
91102

92103
#### Changes
@@ -111,6 +122,14 @@
111122

112123
---
113124

125+
## 9.1.4-patch1
126+
127+
#### Changes
128+
* Check for UDS file instead of UDS flag
129+
* Bugfixes
130+
131+
---
132+
114133
## 9.1.4
115134

116135
#### Changes
@@ -159,6 +178,14 @@
159178

160179
---
161180

181+
## 9.0.9-patch1
182+
183+
#### Changes
184+
* Check for UDS file instead of UDS flag
185+
* Bugfixes
186+
187+
---
188+
162189
## 9.0.9
163190

164191
#### Changes

roles/splunk_common/handlers/restart_splunk.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,12 @@
2323
state: restarted
2424
when: splunk.enable_service and not ansible_system is match("Linux")
2525

26+
- name: Check if UDS file exists
27+
stat:
28+
path: "/opt/splunkforwarder/var/run/splunk/cli.socket"
29+
register: uds_socket_exists
30+
2631
- name: "Wait for splunkd management port"
2732
wait_for:
2833
port: "{{ splunk.svc_port }}"
29-
when: splunk.splunk_http_enabled|bool == true
34+
when: not uds_socket_exists.stat.exists
Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,4 @@
11
---
2-
- name: Set mgmt port
3-
ini_file:
4-
dest: "{{ splunk.home }}/etc/system/local/web.conf"
5-
section: settings
6-
option: "mgmtHostPort"
7-
value: "0.0.0.0:{{ splunk.svc_port }}"
8-
owner: "{{ splunk.user }}"
9-
group: "{{ splunk.group }}"
10-
when:
11-
- "'svc_port' in splunk"
12-
register: set_mgmt_port
13-
142
- name: Configure to set Mgmt Mode as auto (Allows UDS)
153
ini_file:
164
dest: "{{ splunk.home }}/etc/system/local/server.conf"
@@ -30,8 +18,3 @@
3018
owner: "{{ splunk.user }}"
3119
group: "{{ splunk.group }}"
3220
when: splunk.role == "splunk_universal_forwarder" and splunk.splunk_http_enabled|bool == true
33-
34-
# Restart only when Splunk is running and when any of the above have changed
35-
- include_tasks: ../handlers/restart_splunk.yml
36-
when: set_mgmt_port is changed
37-
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
- name: Check if requests_unixsocket exists
3+
command: "pip list | grep 'requests-unixsocket'"
4+
register: requests_unixsocket_check
5+
ignore_errors: true
6+
7+
- name: Install and upgrade pip
8+
pip:
9+
name: pip
10+
extra_args: --upgrade
11+
executable: pip3
12+
when: requests_unixsocket_check is failed
13+
14+
- name: Check if pip3 unixsocket exits
15+
command: "pip3 list | grep 'requests-unixsocket'"
16+
register: requests_unixsocket_check_py3
17+
when: requests_unixsocket_check is failed
18+
ignore_errors: true
19+
20+
- name: Install missing requests_unixsocket
21+
ansible.builtin.pip:
22+
name: "requests_unixsocket"
23+
when: requests_unixsocket_check is succeeded and (requests_unixsocket_check.stdout | length == 0 or requests_unixsocket_check.stdout.find("requests-unixsocket") == -1)
24+
25+
- name: Install missing requests_unixsocket PY3
26+
ansible.builtin.pip:
27+
name: "requests_unixsocket"
28+
when: requests_unixsocket_check_py3 is succeeded and (requests_unixsocket_check_py3.stdout | length == 0 or requests_unixsocket_check_py3.stdout.find("requests-unixsocket") == -1)

roles/splunk_common/tasks/main.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
---
22
- include_tasks: get_facts.yml
33

4+
- include_tasks: install_python_requirements.yml
5+
46
- include_tasks: change_splunk_directory_owner.yml
57
when:
68
- ansible_system is match("Linux")
@@ -74,6 +76,8 @@
7476
- "'http_port' in splunk"
7577
- splunk.http_port | int != 8000
7678

79+
- include_tasks: set_mgmt_port.yml
80+
7781
- include_tasks: set_root_endpoint.yml
7882
when: "'root_endpoint' in splunk and splunk.root_endpoint"
7983

@@ -122,8 +126,13 @@
122126

123127
- include_tasks: start_splunk.yml
124128

129+
- name: Check if UDS file exists
130+
stat:
131+
path: "/opt/splunkforwarder/var/run/splunk/cli.socket"
132+
register: uds_socket_exists
133+
125134
- include_tasks: set_certificate_prefix.yml
126-
when: splunk.splunk_http_enabled|bool == true
135+
when: not uds_socket_exists.stat.exists
127136

128137
- include_tasks: clean_user_seed.yml
129138

roles/splunk_common/tasks/set_certificate_prefix.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
---
2+
- name: Check if UDS file exists
3+
stat:
4+
path: "/opt/splunkforwarder/var/run/splunk/cli.socket"
5+
register: uds_socket_exists
6+
27
- name: "Test basic https endpoint"
38
uri:
49
url: "https://127.0.0.1:{{ splunk.svc_port }}"
@@ -8,7 +13,7 @@
813
timeout: 10
914
use_proxy: no
1015
register: ssl_enabled
11-
when: splunk.splunk_http_enabled|bool == true
16+
when: not uds_socket_exists.stat.exists
1217
ignore_errors: true
1318
delay: "{{ retry_delay }}"
1419
retries: "{{ retry_num }}"
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
- name: Set mgmt port
3+
ini_file:
4+
dest: "{{ splunk.home }}/etc/system/local/web.conf"
5+
section: settings
6+
option: "mgmtHostPort"
7+
value: "0.0.0.0:{{ splunk.svc_port }}"
8+
owner: "{{ splunk.user }}"
9+
group: "{{ splunk.group }}"
10+
when:
11+
- "'svc_port' in splunk"
12+
register: set_mgmt_port
13+
14+
# Restart only when Splunk is running and when any of the above have changed
15+
- include_tasks: ../handlers/restart_splunk.yml
16+
when: set_mgmt_port is changed

roles/splunk_common/tasks/start_splunk.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,15 @@
5050
- splunk.enable_service
5151
- ansible_os_family == "Windows"
5252

53+
- name: Check if UDS file exists
54+
stat:
55+
path: "/opt/splunkforwarder/var/run/splunk/cli.socket"
56+
register: uds_socket_exists
57+
5358
- name: "Wait for splunkd management port"
5459
wait_for:
5560
port: "{{ splunk.svc_port }}"
56-
when: splunk.splunk_http_enabled|bool == true
61+
when: not uds_socket_exists.stat.exists
5762

5863
- name: Flush restart handlers
5964
meta: flush_handlers

roles/splunk_common/tasks/wait_for_splunk_process.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,14 @@
55
state: present
66
when: ansible_system is match("Linux")
77

8+
- name: Check if UDS file exists
9+
stat:
10+
path: "/opt/splunkforwarder/var/run/splunk/cli.socket"
11+
register: uds_socket_exists
12+
813
- name: Wait for the Splunk service port to be available
914
wait_for:
1015
host: 127.0.0.1
1116
port: "{{ splunk.svc_port }}"
1217
timeout: 180
13-
when: splunk.splunk_http_enabled|bool == true
18+
when: not uds_socket_exists.stat.exists

0 commit comments

Comments
 (0)