Skip to content
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

fix: add loop control for options list task in otelwinreg #5132

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all 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
2 changes: 2 additions & 0 deletions deployments/ansible/roles/collector/tasks/otel_win_reg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
{{ (splunk_otel_collector_options_list | default([])) + [item.key + '=' + (value | string)] }}
loop: >
{{ splunk_otel_collector_options | default({}) | combine(splunk_otel_collector_additional_env_vars) | dict2items }}
loop_control:
label: "{{ item.key }}"
Copy link
Contributor

@hughesjj hughesjj Jul 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I note in your example you have item=KEYOFMYSECRETVALUE, so wanted to double check that we indeed want item.key.

In general I'm for adding the loop control + label

Copy link
Contributor

@hughesjj hughesjj Jul 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

relevant parts of code for other reviewers:

  • ansible docs
  • splunk_otel_collector_options
    •   SPLUNK_ACCESS_TOKEN: "{{ splunk_access_token }}"
        SPLUNK_API_URL: "{{ splunk_api_url }}"
        GOMEMLIMIT: "{{ gomemlimit if gomemlimit != '' else omit }}"
        SPLUNK_BUNDLE_DIR: >-
          {{ splunk_bundle_dir if splunk_bundle_dir != '' else
          '{{ansible_env.ProgramFiles}}\Splunk\OpenTelemetry Collector\agent-bundle' }}
        SPLUNK_COLLECTD_DIR: "{{ splunk_collectd_dir if splunk_collectd_dir != '' else omit }}"
        SPLUNK_CONFIG: >-
          {{ splunk_otel_collector_config if splunk_otel_collector_config != '' else
          '{{ ansible_env.ProgramData }}\Splunk\OpenTelemetry Collector\agent_config.yaml' }}
        SPLUNK_INGEST_URL: "{{ splunk_ingest_url }}"
        SPLUNK_HEC_TOKEN: "{{ splunk_hec_token }}"
        SPLUNK_HEC_URL: "{{ splunk_hec_url }}"
        SPLUNK_LISTEN_INTERFACE: "{{ splunk_listen_interface if splunk_listen_interface != '' else omit }}"
        SPLUNK_MEMORY_TOTAL_MIB: "{{ splunk_memory_total_mib }}"
        SPLUNK_REALM: "{{ splunk_realm }}"
        SPLUNK_TRACE_URL: "{{ splunk_trace_url }}"
      
  • splunk_otel_collector_additional_env_vars (looks empty from defaults)


- name: Set Splunk OpenTelemetry Collector registry value
ansible.windows.win_regedit:
Expand Down
Loading