Skip to content

[ansible][windows] Add option to set service CLI args #6371

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 30, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
MY_CUSTOM_VAR1: value1
MY_CUSTOM_VAR2: value2
MY_CUSTOM_VAR3: 'value3 with spaces'
splunk_otel_collector_command_line_args: "--discovery"
install_splunk_dotnet_auto_instrumentation: true
splunk_dotnet_auto_instrumentation_version: 1.8.0
splunk_dotnet_auto_instrumentation_system_wide: true
Expand Down
14 changes: 14 additions & 0 deletions deployments/ansible/molecule/custom_vars/windows-verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,17 @@
assert:
that: (item.key + '=' + (item.value | string)) in collector_env.value
loop: "{{ collector_reg_values | dict2items }}"

- name: Get splunk-otel-collector service ImagePath
ansible.windows.win_reg_stat:
path: HKLM:\\SYSTEM\\CurrentControlSet\\Services\\splunk-otel-collector
name: ImagePath
register: collector_imagepath

- name: Assert service ImagePath ends with splunk_otel_collector_command_line_args
assert:
that:
- collector_imagepath.value.endswith(splunk_otel_collector_command_line_args)
when:
- splunk_otel_collector_command_line_args is defined
- splunk_otel_collector_command_line_args != ''
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
- "{{ 'SPLUNK_MEMORY_TOTAL_MIB=' + (splunk_memory_total_mib | string)
if (splunk_memory_total_mib | string) != '' else '' }}"
- "{{ 'SPLUNK_REALM=' + splunk_realm if splunk_realm != '' else '' }}"
- "{{ 'COLLECTOR_SVC_ARGS=' + splunk_otel_collector_command_line_args
if splunk_otel_collector_command_line_args != '' else '' }}"

- name: Filter out undefined arguments
when: splunk_collector_msi_is_configurable is defined
Expand Down Expand Up @@ -95,4 +97,4 @@
ansible.windows.win_template:
src: "{{splunk_otel_collector_config_source}}"
dest: "{{splunk_otel_collector_config}}"
when: splunk_otel_collector_config_source != ""
when: splunk_otel_collector_config_source != ''
Loading