Skip to content

Commit

Permalink
Fix custom urls/tokens for windows (open-telemetry#2517)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffreyc-splunk authored Jan 27, 2023
1 parent f58c454 commit c94e077
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 5 deletions.
2 changes: 2 additions & 0 deletions deployments/ansible/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased

- Fix custom URLs and HEC token configuration on windows

## ansible-v0.14.0

### 💡 Enhancements 💡
Expand Down
35 changes: 30 additions & 5 deletions deployments/ansible/roles/collector/tasks/otel_win_reg.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,29 @@
---
- name: Set default ingest url
set_fact:
splunk_ingest_url: https://ingest.{{splunk_realm}}.signalfx.com
when: splunk_ingest_url is not defined or (splunk_ingest_url | trim) == ""

- name: Set default api url
set_fact:
splunk_api_url: https://api.{{splunk_realm}}.signalfx.com
when: splunk_api_url is not defined or (splunk_api_url | trim) == ""

- name: Set default trace url
set_fact:
splunk_trace_url: "{{splunk_ingest_url}}/v2/trace"
when: splunk_trace_url is not defined or (splunk_trace_url | trim) == ""

- name: Set default hec url
set_fact:
splunk_hec_url: "{{splunk_ingest_url}}/v1/log"
when: splunk_hec_url is not defined or (splunk_hec_url | trim) == ""

- name: Set default hec token
set_fact:
splunk_hec_token: "{{splunk_access_token}}"
when: splunk_hec_token is not defined or (splunk_hec_token | trim) == ""

- name: Create registry path for collector
ansible.windows.win_regedit:
path: "{{registry_key}}"
Expand Down Expand Up @@ -33,7 +58,7 @@
path: "{{registry_key}}"
state: present
name: SPLUNK_API_URL
data: https://api.{{splunk_realm}}.signalfx.com
data: "{{splunk_api_url}}"
type: string

- name: Set registry values
Expand Down Expand Up @@ -65,23 +90,23 @@
path: "{{registry_key}}"
state: present
name: SPLUNK_HEC_TOKEN
data: "{{splunk_access_token}}"
data: "{{splunk_hec_token}}"
type: string

- name: Set registry values
ansible.windows.win_regedit:
path: "{{registry_key}}"
state: present
name: SPLUNK_HEC_URL
data: https://ingest.{{splunk_realm}}.signalfx.com/v1/log
data: "{{splunk_hec_url}}"
type: string

- name: Set registry values
ansible.windows.win_regedit:
path: "{{registry_key}}"
state: present
name: SPLUNK_INGEST_URL
data: https://ingest.{{splunk_realm}}.signalfx.com
data: "{{splunk_ingest_url}}"
type: string

- name: Set registry values
Expand All @@ -97,5 +122,5 @@
path: "{{registry_key}}"
state: present
name: SPLUNK_TRACE_URL
data: https://ingest.{{splunk_realm}}.signalfx.com/v2/trace
data: "{{splunk_trace_url}}"
type: string

0 comments on commit c94e077

Please sign in to comment.