Skip to content

Commit 3f3aca6

Browse files
test
1 parent f759935 commit 3f3aca6

File tree

6 files changed

+21
-0
lines changed

6 files changed

+21
-0
lines changed

.github/workflows/ansible.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ on:
1212
- 'deployments/ansible/galaxy.yml'
1313
branches:
1414
- main
15+
- ansible-discovery-mode
1516
pull_request:
1617
paths:
1718
- '.github/workflows/ansible.yml'

deployments/ansible/molecule/custom_vars/converge.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
splunk_otel_collector_additional_env_vars:
2121
MY_CUSTOM_VAR1: value1
2222
MY_CUSTOM_VAR2: value2
23+
splunk_discovery_mode: yes
2324
tasks:
2425
- name: "Include signalfx.splunk_otel_collector.collector role"
2526
include_role:

deployments/ansible/molecule/custom_vars/verify.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,13 @@
6565
state: present
6666
check_mode: yes
6767

68+
- name: Assert discovery mode is enabled
69+
ansible.builtin.lineinfile:
70+
line: OTELCOL_OPTIONS=--discovery
71+
dest: /etc/otel/collector/splunk-otel-collector.conf
72+
state: present
73+
check_mode: yes
74+
6875
- name: Populate package facts
6976
ansible.builtin.package_facts:
7077

deployments/ansible/molecule/default/verify.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,10 @@
5656
dest: /etc/otel/collector/splunk-otel-collector.conf
5757
state: present
5858
check_mode: yes
59+
60+
- name: Assert discovery mode is not enabled
61+
ansible.builtin.lineinfile:
62+
line: OTELCOL_OPTIONS=--discovery
63+
dest: /etc/otel/collector/splunk-otel-collector.conf
64+
state: absent
65+
check_mode: yes

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,5 @@ signalfx_dotnet_auto_instrumentation_enable_profiler_memory: false
9696
signalfx_dotnet_auto_instrumentation_global_tags: ""
9797
signalfx_dotnet_auto_instrumentation_iisreset: true
9898
signalfx_dotnet_auto_instrumentation_additional_options: {}
99+
100+
splunk_discovery_mode: false

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,6 @@ SPLUNK_COLLECTD_DIR={{ splunk_collectd_dir }}
3232
{{ key }}={{ value }}
3333
{% endfor %}
3434
{% endif %}
35+
{% if splunk_discovery_mode is defined and splunk_discovery_mode %}
36+
OTELCOL_OPTIONS=--discovery
37+
{% endif %}

0 commit comments

Comments
 (0)