Skip to content

Commit d01ed1a

Browse files
committed
update installers to not use default SPLUNK_LISTEN_INTERFACE
1 parent 5cebeed commit d01ed1a

File tree

20 files changed

+57
-24
lines changed

20 files changed

+57
-24
lines changed

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

deployments/chef/attributes/default.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
default['splunk_otel_collector']['splunk_hec_token'] = "#{node['splunk_otel_collector']['splunk_access_token']}"
2222
default['splunk_otel_collector']['splunk_memory_total_mib'] = '512'
2323
default['splunk_otel_collector']['splunk_ballast_size_mib'] = ''
24-
default['splunk_otel_collector']['splunk_listen_interface'] = '0.0.0.0'
24+
default['splunk_otel_collector']['splunk_listen_interface'] = ''
2525

2626
default['splunk_otel_collector']['collector_config'] = {}
2727

deployments/chef/recipes/collector_win_registry.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,14 @@
1212
{ name: 'SPLUNK_HEC_TOKEN', type: :string, data: node['splunk_otel_collector']['splunk_hec_token'].to_s },
1313
{ name: 'SPLUNK_MEMORY_TOTAL_MIB', type: :string, data: node['splunk_otel_collector']['splunk_memory_total_mib'].to_s },
1414
{ name: 'SPLUNK_BALLAST_SIZE_MIB', type: :string, data: node['splunk_otel_collector']['splunk_ballast_size_mib'].to_s },
15-
{ name: 'SPLUNK_LISTEN_INTERFACE', type: :string, data: node['splunk_otel_collector']['splunk_listen_interface'].to_s },
1615
{ name: 'SPLUNK_BUNDLE_DIR', type: :string, data: node['splunk_otel_collector']['splunk_bundle_dir'].to_s },
1716
{ name: 'SPLUNK_COLLECTD_DIR', type: :string, data: node['splunk_otel_collector']['splunk_collectd_dir'].to_s },
1817
]
1918

19+
unless node['splunk_otel_collector']['splunk_listen_interface'].to_s.strip.empty?
20+
registry_values.push({ name: 'SPLUNK_LISTEN_INTERFACE', type: :string, data: node['splunk_otel_collector']['splunk_listen_interface'].to_s })
21+
end
22+
2023
node['splunk_otel_collector']['collector_additional_env_vars'].each do |key, value|
2124
registry_values.push({ name: key, type: :string, data: value.to_s })
2225
end

deployments/chef/templates/splunk-otel-collector.conf.erb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@ SPLUNK_HEC_TOKEN=<%= node['splunk_otel_collector']['splunk_hec_token'] %>
2828
# the value calculated by `SPLUNK_MEMORY_TOTAL_MIB`.
2929
SPLUNK_MEMORY_TOTAL_MIB=<%= node['splunk_otel_collector']['splunk_memory_total_mib'] %>
3030

31+
<% unless node['splunk_otel_collector']['splunk_listen_interface'].to_s.strip.empty? -%>
3132
# The network interface the collector receivers will listen on.
3233
SPLUNK_LISTEN_INTERFACE=<%= node['splunk_otel_collector']['splunk_listen_interface'] %>
34+
<% end -%>
3335

3436
# How much memory to allocate to the ballast. This should be set to 1/3 to 1/2 of configured memory.
3537
SPLUNK_BALLAST_SIZE_MIB=<%= node['splunk_otel_collector']['splunk_ballast_size_mib'] %>

deployments/puppet/CHANGELOG.md

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

33
## Unreleased
44

5+
- Add support for `splunk_listen_interface` used by default configurations as `SPLUNK_LISTEN_INTERFACE` environment variable.
6+
- Update fluentd url for Windows.
7+
58
## puppet-v0.10.0
69

710
- **Breaking Changes**: Fluentd installation ***disabled*** by default.

deployments/puppet/manifests/collector_win_registry.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,14 @@
2727
require => Registry_key[$registry_key],
2828
}
2929

30+
unless $splunk_otel_collector::splunk_listen_interface.strip().empty {
3031
registry_value { "${registry_key}\\SPLUNK_LISTEN_INTERFACE":
3132
ensure => 'present',
3233
type => 'string',
3334
data => $splunk_otel_collector::splunk_listen_interface,
3435
require => Registry_key[$registry_key],
3536
}
37+
}
3638

3739
registry_value { "${registry_key}\\SPLUNK_BUNDLE_DIR":
3840
ensure => 'present',

deployments/puppet/manifests/init.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
$splunk_collectd_dir = $splunk_otel_collector::params::splunk_collectd_dir,
1212
$splunk_memory_total_mib = '512',
1313
$splunk_ballast_size_mib = '',
14-
$splunk_listen_interface = '0.0.0.0',
14+
$splunk_listen_interface = '',
1515
$collector_version = $splunk_otel_collector::params::collector_version,
1616
$collector_config_source = $splunk_otel_collector::params::collector_config_source,
1717
$collector_config_dest = $splunk_otel_collector::params::collector_config_dest,

deployments/puppet/templates/splunk-otel-collector.conf.erb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ SPLUNK_HEC_TOKEN=<%= @splunk_hec_token %>
88
SPLUNK_HEC_URL=<%= @splunk_hec_url %>
99
SPLUNK_INGEST_URL=<%= @splunk_ingest_url %>
1010
SPLUNK_MEMORY_TOTAL_MIB=<%= @splunk_memory_total_mib %>
11+
<% unless @splunk_listen_interface.to_s.strip.empty? -%>
1112
SPLUNK_LISTEN_INTERFACE=<%= @splunk_listen_interface %>
13+
<% end -%>
1214
SPLUNK_REALM=<%= @splunk_realm %>
1315
SPLUNK_TRACE_URL=<%= @splunk_trace_url %>
1416

internal/buildscripts/packaging/choco/splunk-otel-collector/splunk-otel-collector.nuspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The following package parameters are available:
1818
* `/SPLUNK_HEC_URL`: URL of the Splunk HEC endpoint (e.g. `https://ingest.us1.signalfx.com/v1/log`). Default value is `https://ingest.$SPLUNK_REALM.signalfx.com/v1/log`
1919
* `/SPLUNK_TRACE_URL`: URL of the Splunk trace endpoint (e.g. `https://ingest.us1.signalfx.com/v2/trace`). Default value is `https://ingest.$SPLUNK_REALM.signalfx.com/v2/trace`
2020
* `/SPLUNK_BUNDLE_DIR`: The path to the Smart Agent bundle directory for the `smartagent` receiver and extension. The default path is provided by the Collector package. If the specified path is changed from the default value, the path should be an existing directory on the system. Default value is `\Program Files\Splunk\OpenTelemetry Collector\agent-bundle`.
21-
* `/SPLUNK_LISTEN_INTERFACE`: The network interface the collector receivers will listen on. Default value is `0.0.0.0`.
21+
* `/SPLUNK_LISTEN_INTERFACE`: The network interface the collector receivers will listen on. Default value is `127.0.0.1` for agent mode and `0.0.0.0` for gateway.
2222
* `/MODE`: This parameter is used for setting the Collector configuration file to `\ProgramData\Splunk\OpenTelemetry Collector\agent_config.yaml` or `\ProgramData\Splunk\OpenTelemetry Collector\gateway_config.yaml`. Possible values are `agent` and `gateway`. Default value is `agent`.
2323
* `/WITH_FLUENTD`: Whether to download, install, and configure Fluentd to collect and forward log events to the Collector. Possible values are `true` and `false`. If set to `true`, the Fluentd MSI package will be downloaded from `https://packages.treasuredata.com`. Default value is `false`.
2424

@@ -49,4 +49,4 @@ See [Chocolatey Installation](https://github.com/signalfx/splunk-otel-collector/
4949
<file src="tools\**" target="tools" />
5050
<!--Building from Linux? You may need this instead: <file src="tools/**" target="tools" />-->
5151
</files>
52-
</package>
52+
</package>

internal/buildscripts/packaging/choco/splunk-otel-collector/tools/chocolateyinstall.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,6 @@ try {
135135
}
136136
}
137137
catch {
138-
$SPLUNK_LISTEN_INTERFACE = "0.0.0.0"
139-
write-host "The SPLUNK_LISTEN_INTERFACE parameter is not specified. Using default configuration."
140138
}
141139

142140
try {
@@ -167,7 +165,9 @@ try {
167165

168166
update_registry -path "$regkey" -name "SPLUNK_API_URL" -value "$SPLUNK_API_URL"
169167
update_registry -path "$regkey" -name "SPLUNK_BUNDLE_DIR" -value "$SPLUNK_BUNDLE_DIR"
170-
update_registry -path "$regkey" -name "SPLUNK_LISTEN_INTERFACE" -value "$SPLUNK_LISTEN_INTERFACE"
168+
if ($SPLUNK_LISTEN_INTERFACE) {
169+
update_registry -path "$regkey" -name "SPLUNK_LISTEN_INTERFACE" -value "$SPLUNK_LISTEN_INTERFACE"
170+
}
171171
update_registry -path "$regkey" -name "SPLUNK_HEC_TOKEN" -value "$SPLUNK_HEC_TOKEN"
172172
update_registry -path "$regkey" -name "SPLUNK_HEC_URL" -value "$SPLUNK_HEC_URL"
173173
update_registry -path "$regkey" -name "SPLUNK_INGEST_URL" -value "$SPLUNK_INGEST_URL"

internal/buildscripts/packaging/installer/install.ps1

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
.EXAMPLE
4242
.\install.ps1 -access_token "ACCESSTOKEN" -mode "gateway"
4343
.PARAMETER network_interface
44-
(OPTIONAL) The network interface the collector receivers listen on. (default: "0.0.0.0")
44+
(OPTIONAL) The network interface the collector receivers listen on. (default: "127.0.0.1" for agent mode and "0.0.0.0" otherwise)
4545
.EXAMPLE
4646
.\install.ps1 -access_token "ACCESSTOKEN" -network_interface "127.0.0.1"
4747
.PARAMETER ingest_url
@@ -113,7 +113,7 @@ param (
113113
[string]$realm = "us0",
114114
[string]$memory = "512",
115115
[ValidateSet('agent','gateway')][string]$mode = "agent",
116-
[string]$network_interface = "0.0.0.0",
116+
[string]$network_interface = "",
117117
[string]$ingest_url = "",
118118
[string]$api_url = "",
119119
[string]$trace_url = "",
@@ -582,7 +582,9 @@ update_registry -path "$regkey" -name "SPLUNK_HEC_TOKEN" -value "$hec_token"
582582
update_registry -path "$regkey" -name "SPLUNK_HEC_URL" -value "$hec_url"
583583
update_registry -path "$regkey" -name "SPLUNK_INGEST_URL" -value "$ingest_url"
584584
update_registry -path "$regkey" -name "SPLUNK_MEMORY_TOTAL_MIB" -value "$memory"
585-
update_registry -path "$regkey" -name "SPLUNK_LISTEN_INTERFACE" -value "$network_interface"
585+
if ($network_interface -Ne "") {
586+
update_registry -path "$regkey" -name "SPLUNK_LISTEN_INTERFACE" -value "$network_interface"
587+
}
586588
update_registry -path "$regkey" -name "SPLUNK_REALM" -value "$realm"
587589
update_registry -path "$regkey" -name "SPLUNK_TRACE_URL" -value "$trace_url"
588590

@@ -701,6 +703,6 @@ if ($with_fluentd) {
701703
echo "- Started"
702704
}
703705

704-
if ($network_interface -Eq "0.0.0.0") {
705-
echo "[NOTICE] Starting with version 0.86.0, the collector installer will change its default network listening interface from 0.0.0.0 to 127.0.0.1. Please consult the release notes for more information and configuration options."
706+
if (($network_interface -Eq "") -And ($mode -Eq "agent")) {
707+
echo "[NOTICE] Starting with version 0.86.0, the collector installer changed its default network listening interface from 0.0.0.0 to 127.0.0.1 for agent mode. Please consult the release notes for more information and configuration options."
706708
}

internal/buildscripts/packaging/installer/install.sh

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ Collector:
671671
--mode <agent|gateway> Configure the collector service to run in agent or gateway mode.
672672
(default: "agent")
673673
--listen-interface <ip> network interface the collector receivers listen on.
674-
(default: "$default_listen_interface")
674+
(default: "127.0.0.1" for agent mode and "0.0.0.0" otherwise)
675675
--realm <us0|us1|eu0|...> The Splunk realm to use. The ingest, api, trace, and HEC endpoint URLs will
676676
automatically be inferred by this value.
677677
(default: "$default_realm")
@@ -869,7 +869,7 @@ parse_args_and_install() {
869869
local ingest_url=
870870
local insecure=
871871
local memory="$default_memory_size"
872-
local listen_interface="$default_listen_interface"
872+
local listen_interface=
873873
local realm="$default_realm"
874874
local service_group="$default_service_group"
875875
local stage="$default_stage"
@@ -1103,7 +1103,10 @@ parse_args_and_install() {
11031103
echo "Ballast Size in MIB: $ballast"
11041104
fi
11051105
echo "Memory Size in MIB: $memory"
1106-
echo "Listen network interface: $listen_interface"
1106+
1107+
if [ -n "$listen_interface" ]; then
1108+
echo "Listen network interface: $listen_interface"
1109+
fi
11071110
echo "Realm: $realm"
11081111
echo "Ingest Endpoint: $ingest_url"
11091112
echo "API Endpoint: $api_url"
@@ -1188,7 +1191,9 @@ parse_args_and_install() {
11881191
rm -f "$collector_env_path"
11891192
fi
11901193

1191-
configure_env_file "SPLUNK_LISTEN_INTERFACE" "$listen_interface" "$collector_env_path"
1194+
if [ -n "$listen_interface" ]; then
1195+
configure_env_file "SPLUNK_LISTEN_INTERFACE" "$listen_interface" "$collector_env_path"
1196+
fi
11921197
configure_env_file "SPLUNK_CONFIG" "$collector_config_path" "$collector_env_path"
11931198
configure_env_file "SPLUNK_ACCESS_TOKEN" "$access_token" "$collector_env_path"
11941199
configure_env_file "SPLUNK_REALM" "$realm" "$collector_env_path"
@@ -1305,8 +1310,8 @@ WARNING: Fluentd was not installed since it is currently not supported for ${dis
13051310
EOH
13061311
fi
13071312

1308-
if [ "$listen_interface" = "0.0.0.0" ]; then
1309-
echo "[NOTICE] Starting with version 0.86.0, the collector installer will change its default network listening interface from 0.0.0.0 to 127.0.0.1. Please consult the release notes for more information and configuration options."
1313+
if [ -z "$listen_interface" ] && [ "$mode" = "agent" ]; then
1314+
echo "[NOTICE] Starting with version 0.86.0, the collector installer changed its default network listening interface from 0.0.0.0 to 127.0.0.1 for agent mode with default configuration. Please consult the release notes for more information and configuration options."
13101315
fi
13111316

13121317
exit 0

0 commit comments

Comments
 (0)