Skip to content

Commit d99d856

Browse files
authored
[ansible] Add option to set service cli args (#6270)
1 parent f47538e commit d99d856

File tree

6 files changed

+30
-0
lines changed

6 files changed

+30
-0
lines changed

deployments/ansible/CHANGELOG.md

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

3+
## ansible-v0.32.0
4+
5+
### 💡 Enhancements 💡
6+
7+
- Add support for the `splunk_otel_collector_command_line_args` option to
8+
configure the command line arguments for the Splunk OpenTelemetry Collector
9+
service.
10+
311
## ansible-v0.31.0
412

513
### 🛑 Breaking changes 🛑

deployments/ansible/molecule/custom_vars/converge.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
splunk_service_user: custom-user
1313
splunk_service_group: custom-group
1414
splunk_memory_total_mib: 256
15+
splunk_otel_collector_command_line_args: "--discovery"
1516
gomemlimit: 230
1617
splunk_listen_interface: 1.2.3.4
1718
splunk_fluentd_config: /etc/otel/collector/fluentd/custom_fluentd.conf

deployments/ansible/molecule/custom_vars/verify.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@
4444
state: present
4545
check_mode: yes
4646

47+
- name: Assert OTELCOL_OPTIONS env var is set per splunk_otel_collector_command_line_args
48+
ansible.builtin.lineinfile:
49+
line: OTELCOL_OPTIONS=--discovery
50+
dest: /etc/otel/collector/splunk-otel-collector.conf
51+
state: present
52+
check_mode: yes
53+
4754
- name: Assert MY_CUSTOM_VAR1 env var is set
4855
ansible.builtin.lineinfile:
4956
line: MY_CUSTOM_VAR1=value1

deployments/ansible/roles/collector/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,16 @@ $> ansible-playbook playbook.yaml -e start_service=false
121121
`splunk_otel_collector_proxy_http` or `splunk_otel_collector_proxy_https` is
122122
defined. (**default:** `localhost,127.0.0.1,::1`)
123123

124+
- `splunk_otel_collector_command_line_args`: Command-line arguments to pass to the
125+
Splunk OpenTelemetry Collector. These will be added as arguments to the service
126+
command line.
127+
(**default:** `""`)
128+
129+
Example:
130+
```yaml
131+
splunk_otel_collector_command_line_args: "--discovery --set=processors.batch.timeout=10s"
132+
```
133+
124134
- `splunk_memory_total_mib`: Amount of memory in MiB allocated to the Splunk OTel
125135
Collector. (**default:** `512`)
126136

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ splunk_realm: us0
88

99
splunk_otel_collector_version: latest
1010

11+
# Command-line arguments to pass to the collector service.
12+
splunk_otel_collector_command_line_args: ""
13+
1114
# Set this variable to /etc/otel/collector/gateway_config.yaml on linux,
1215
# "Program Files\Splunk\OpenTelemetry Collector\gateway_config.yaml" on Windows
1316
# in order to deploy splunk-otel-collector in gateway mode.

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
OTELCOL_CONFIG={{ splunk_otel_collector_command_line_args }}
12
SPLUNK_CONFIG={{ splunk_otel_collector_config }}
23
SPLUNK_ACCESS_TOKEN={{ splunk_access_token }}
34
SPLUNK_REALM={{ splunk_realm }}

0 commit comments

Comments
 (0)