|
22 | 22 | dest: /etc/otel/collector/splunk-otel-collector.conf
|
23 | 23 | state: present
|
24 | 24 | check_mode: yes
|
| 25 | + register: config |
| 26 | + failed_when: config is changed |
25 | 27 |
|
26 | 28 | - name: Assert SPLUNK_INGEST_URL env var is set
|
27 | 29 | ansible.builtin.lineinfile:
|
28 | 30 | line: SPLUNK_INGEST_URL=https://fake-splunk-ingest.com
|
29 | 31 | dest: /etc/otel/collector/splunk-otel-collector.conf
|
30 | 32 | state: present
|
31 | 33 | check_mode: yes
|
| 34 | + register: config |
| 35 | + failed_when: config is changed |
32 | 36 |
|
33 | 37 | - name: Assert SPLUNK_API_URL env var is set
|
34 | 38 | ansible.builtin.lineinfile:
|
35 | 39 | line: SPLUNK_API_URL=https://fake-splunk-api.com
|
36 | 40 | dest: /etc/otel/collector/splunk-otel-collector.conf
|
37 | 41 | state: present
|
38 | 42 | check_mode: yes
|
| 43 | + register: config |
| 44 | + failed_when: config is changed |
39 | 45 |
|
40 | 46 | - name: Assert SPLUNK_HEC_URL env var is set
|
41 | 47 | ansible.builtin.lineinfile:
|
42 | 48 | line: SPLUNK_HEC_URL=https://fake-splunk-ingest.com/v1/log
|
43 | 49 | dest: /etc/otel/collector/splunk-otel-collector.conf
|
44 | 50 | state: present
|
45 | 51 | check_mode: yes
|
| 52 | + register: config |
| 53 | + failed_when: config is changed |
46 | 54 |
|
47 | 55 | - name: Assert OTELCOL_OPTIONS env var is set per splunk_otel_collector_command_line_args
|
48 | 56 | ansible.builtin.lineinfile:
|
49 | 57 | line: OTELCOL_OPTIONS=--discovery
|
50 | 58 | dest: /etc/otel/collector/splunk-otel-collector.conf
|
51 | 59 | state: present
|
52 | 60 | check_mode: yes
|
| 61 | + register: config |
| 62 | + failed_when: config is changed |
53 | 63 |
|
54 | 64 | - name: Assert MY_CUSTOM_VAR1 env var is set
|
55 | 65 | ansible.builtin.lineinfile:
|
56 | 66 | line: MY_CUSTOM_VAR1=value1
|
57 | 67 | dest: /etc/otel/collector/splunk-otel-collector.conf
|
58 | 68 | state: present
|
59 | 69 | check_mode: yes
|
| 70 | + register: config |
| 71 | + failed_when: config is changed |
60 | 72 |
|
61 | 73 | - name: Assert MY_CUSTOM_VAR2 env var is set
|
62 | 74 | ansible.builtin.lineinfile:
|
63 | 75 | line: MY_CUSTOM_VAR2=value2
|
64 | 76 | dest: /etc/otel/collector/splunk-otel-collector.conf
|
65 | 77 | state: present
|
66 | 78 | check_mode: yes
|
| 79 | + register: config |
| 80 | + failed_when: config is changed |
67 | 81 |
|
68 | 82 | - name: Populate package facts
|
69 | 83 | ansible.builtin.package_facts:
|
|
78 | 92 | dest: /etc/systemd/system/splunk-otel-collector.service.d/service-owner.conf
|
79 | 93 | state: present
|
80 | 94 | check_mode: yes
|
| 95 | + register: config |
| 96 | + failed_when: config is changed |
81 | 97 |
|
82 | 98 | - name: Assert custom service group is set
|
83 | 99 | ansible.builtin.lineinfile:
|
84 | 100 | line: Group=custom-group
|
85 | 101 | dest: /etc/systemd/system/splunk-otel-collector.service.d/service-owner.conf
|
86 | 102 | state: present
|
87 | 103 | check_mode: yes
|
| 104 | + register: config |
| 105 | + failed_when: config is changed |
88 | 106 |
|
89 | 107 | - name: Assert SPLUNK_MEMORY_TOTAL_MIB env var is set
|
90 | 108 | ansible.builtin.lineinfile:
|
91 | 109 | line: SPLUNK_MEMORY_TOTAL_MIB=256
|
92 | 110 | dest: /etc/otel/collector/splunk-otel-collector.conf
|
93 | 111 | state: present
|
94 | 112 | check_mode: yes
|
| 113 | + register: config |
| 114 | + failed_when: config is changed |
95 | 115 |
|
96 | 116 | - name: Assert SPLUNK_LISTEN_INTERFACE env var is set
|
97 | 117 | ansible.builtin.lineinfile:
|
98 | 118 | line: SPLUNK_LISTEN_INTERFACE=1.2.3.4
|
99 | 119 | dest: /etc/otel/collector/splunk-otel-collector.conf
|
100 | 120 | state: present
|
101 | 121 | check_mode: yes
|
| 122 | + register: config |
| 123 | + failed_when: config is changed |
102 | 124 |
|
103 | 125 | - name: Assert GOMEMLIMIT env var is set
|
104 | 126 | ansible.builtin.lineinfile:
|
105 | 127 | line: GOMEMLIMIT=230
|
106 | 128 | dest: /etc/otel/collector/splunk-otel-collector.conf
|
107 | 129 | state: present
|
108 | 130 | check_mode: yes
|
| 131 | + register: config |
| 132 | + failed_when: config is changed |
109 | 133 |
|
110 | 134 | - name: Check custom_fluentd.conf
|
111 | 135 | stat:
|
|
124 | 148 | state: present
|
125 | 149 | check_mode: yes
|
126 | 150 | when: fluentd_supported
|
| 151 | + register: config |
| 152 | + failed_when: config is changed |
127 | 153 |
|
128 | 154 | - name: Send a test log message
|
129 | 155 | ansible.builtin.uri:
|
|
0 commit comments