Skip to content

Commit c901f74

Browse files
rmfitzpatrickjinja2jeffreyc-splunk
authored
localhost on agent (#3732)
* set default SPLUNK_LISTEN_INTERFACE to 127.0.0.1 for agent configs * update installers to not use default SPLUNK_LISTEN_INTERFACE * Update CHANGELOG.md Co-authored-by: Jina Jain <[email protected]> * Listen interface deployment tests (#3736) * Add chef tests for listen interface * Add puppet tests for listen interface * Add salt tests for listen interface --------- Co-authored-by: Jina Jain <[email protected]> Co-authored-by: Jeff Cheng <[email protected]>
1 parent bfa8a8e commit c901f74

File tree

36 files changed

+293
-97
lines changed

36 files changed

+293
-97
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## Unreleased
44

5+
### 🛑 Breaking changes 🛑
6+
7+
- (Splunk) Set `SPLUNK_LISTEN_INTERFACE` environment variable value to 127.0.0.1 for [agent mode](https://docs.splunk.com/observability/en/gdi/opentelemetry/deployment-modes.html#host-monitoring-agent-mode) by default, as determined by config path. 0.0.0.0 will be set otherwise, with existing environment values respected. The installers have been updated to only set the environment variable for collector service if configured directly.
8+
59
## v0.85.0
610

711
***ADVANCED NOTICE - SPLUNK_LISTEN_INTERFACE DEFAULTS***

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ listen to configure the `SPLUNK_DEBUG_CONFIG_SERVER_PORT` environment variable.
171171

172172
You can use the environment variable `SPLUNK_LISTEN_INTERFACE` and associated installer option to configure the network
173173
interface on which the collector's receivers and telemetry endpoints will listen.
174-
The default value of `SPLUNK_LISTEN_INTERFACE` is set to `0.0.0.0`.
174+
The default value of `SPLUNK_LISTEN_INTERFACE` is set to `127.0.0.1` for the default agent configuration and `0.0.0.0` otherwise.
175175

176176
## Upgrade guidelines
177177

deployments/ansible/CHANGELOG.md

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

3+
## unreleased
4+
5+
### 💡 Enhancements 💡
6+
7+
- Only propagate `splunk_listen_interface` to target SPLUNK_LISTEN_INTERFACE service environment variable if set.
8+
39
## ansible-v0.22.0
410

511
### 💡 Enhancements 💡

deployments/ansible/molecule/custom_vars/converge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
splunk_service_group: custom-group
1414
splunk_memory_total_mib: 256
1515
splunk_ballast_size_mib: 100
16-
splunk_listen_interface: 127.0.0.1
16+
splunk_listen_interface: 1.2.3.4
1717
splunk_fluentd_config: /etc/otel/collector/fluentd/custom_fluentd.conf
1818
splunk_fluentd_config_source: ./custom_fluentd_config.conf
1919
install_fluentd: yes

deployments/ansible/molecule/custom_vars/verify.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595

9696
- name: Assert SPLUNK_LISTEN_INTERFACE env var is set
9797
ansible.builtin.lineinfile:
98-
line: SPLUNK_LISTEN_INTERFACE=127.0.0.1
98+
line: SPLUNK_LISTEN_INTERFACE=1.2.3.4
9999
dest: /etc/otel/collector/splunk-otel-collector.conf
100100
state: present
101101
check_mode: yes

deployments/ansible/molecule/custom_vars/windows-converge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
splunk_memory_total_mib: 256
1515
splunk_ballast_size_mib: 100
1616
install_fluentd: yes
17-
splunk_listen_interface: 127.0.0.1
17+
splunk_listen_interface: 1.2.3.4
1818
splunk_fluentd_config: '{{ansible_env.ProgramFiles}}\Splunk\OpenTelemetry Collector\fluentd\custom_config.conf'
1919
splunk_fluentd_config_source: ./custom_fluentd_config.conf
2020
splunk_otel_collector_additional_env_vars:

deployments/ansible/roles/collector/defaults/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ splunk_memory_total_mib: 512
3131
# 1/3 of memory_mib by default
3232
splunk_ballast_size_mib: ""
3333

34-
splunk_listen_interface: "0.0.0.0"
34+
splunk_listen_interface: ""
3535
install_fluentd: false
3636
# Whether to start the services installed by the role (splunk-otel-collector and td-agent).
3737
start_service: true

deployments/ansible/roles/collector/tasks/otel_win_reg.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
name: SPLUNK_LISTEN_INTERFACE
7777
data: "{{splunk_listen_interface}}"
7878
type: string
79+
when: splunk_listen_interface is defined and not (splunk_listen_interface | trim) == ""
7980

8081
- name: Set registry values
8182
ansible.windows.win_regedit:

deployments/ansible/roles/collector/templates/splunk-otel-collector.conf.j2

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ SPLUNK_HEC_URL={{ "https://ingest." + splunk_realm + ".signalfx.com/v1/log" }}
2020
SPLUNK_HEC_TOKEN={{ splunk_hec_token }}
2121
SPLUNK_MEMORY_TOTAL_MIB={{ splunk_memory_total_mib }}
2222
SPLUNK_BALLAST_SIZE_MIB={{ splunk_ballast_size_mib }}
23+
{% if splunk_listen_interface is defined and splunk_listen_interface %}
2324
SPLUNK_LISTEN_INTERFACE={{ splunk_listen_interface }}
25+
{% endif %}
2426
SPLUNK_BUNDLE_DIR={{ splunk_bundle_dir }}
2527
SPLUNK_COLLECTD_DIR={{ splunk_collectd_dir }}
2628
{% if splunk_otel_collector_additional_env_vars is not none %}

deployments/chef/CHANGELOG.md

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

3+
## unreleased
4+
5+
- Update `splunk_listen_interface` default to only set target SPLUNK_LISTEN_INTERFACE environment variable if
6+
configure.
7+
38
## chef-v0.7.0
49

510
- Add support for the `splunk_listen_interface` option to configure the network interface the collector receivers

0 commit comments

Comments
 (0)