Skip to content

Commit 51476c7

Browse files
authored
Fix current problems with molecule checks (#360)
There are two problems that both break tests. I try to solve them in a single PR because one would block merging the other. Both are "new problems" that arose through updates of tools being used. The checks worked in the past. * Having `become` only in tasks where needed might be good coding style but it breaks tests with Rocky Linux and might have other unpredicted side effects. So I'm removing it. * Starting `rsyslog` on Rocky Linux fails with "Timeout". There' no further information so I decided to replace it with reading journald instead of rsyslog. This might have been a move to make in the future anyway.
1 parent 87a7dc6 commit 51476c7

File tree

5 files changed

+2
-47
lines changed

5 files changed

+2
-47
lines changed

molecule/elasticstack_default/converge.yml

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
logstash_pipeline_unsafe_shutdown: true
2121
logstash_redis_password: "{{ lookup('ansible.builtin.password', '/tmp/redispassword', chars=['ascii_letters'], length=15) }}"
2222
redis_requirepass: "{{ logstash_redis_password }}"
23-
beats_filebeat_syslog_udp: true
24-
beats_filebeat_syslog_tcp: true
23+
beats_filebeat_journald: true
2524
beats_filebeat_modules:
2625
- system
2726
beats_fields:
@@ -51,19 +50,3 @@
5150
- name: Include Beats
5251
ansible.builtin.include_role:
5352
name: beats
54-
- name: Install rsyslog
55-
ansible.builtin.package:
56-
name: rsyslog
57-
- name: Remove cache # noqa: risky-shell-pipe
58-
ansible.builtin.shell: >
59-
if test -n "$(ps -p $$ | grep bash)"; then set -o pipefail; fi;
60-
rm -rf /var/cache/*
61-
changed_when: false
62-
- name: Configure rsyslog
63-
ansible.builtin.lineinfile:
64-
line: "*.* @@localhost:514"
65-
path: /etc/rsyslog.conf
66-
- name: Start rsyslog
67-
ansible.builtin.service:
68-
name: rsyslog
69-
state: started

molecule/elasticstack_default/verify.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@
1717
port: 5044
1818
when: "'logstash' in group_names"
1919

20-
- name: Wait for syslog port to open
21-
ansible.builtin.wait_for:
22-
port: 514
23-
2420
- name: Set elasticsearch_ca variable if not already done by user
2521
ansible.builtin.set_fact:
2622
elasticsearch_ca: "{{ groups[elasticstack_elasticsearch_group_name][0] }}"

molecule/logstash_full_stack-oss/converge.yml

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,14 @@
1919
logstash_security: false
2020
logstash_pipeline_unsafe_shutdown: true
2121
elasticstack_security: false
22-
beats_filebeat_syslog_udp: true
23-
beats_filebeat_syslog_tcp: true
22+
beats_filebeat_journald: true
2423
logstash_beats_tls: false
2524
elasticstack_release: 7
2625
elasticstack_no_log: false
2726
tasks:
2827
- name: "Include Elastics repos role"
2928
ansible.builtin.include_role:
3029
name: repos
31-
- name: Install rsyslog
32-
ansible.builtin.package:
33-
name: rsyslog
34-
- name: Start rsyslog
35-
ansible.builtin.service:
36-
name: rsyslog
37-
state: started
3830
- name: "Include Elasticsearch role"
3931
ansible.builtin.include_role:
4032
name: elasticsearch
@@ -47,12 +39,3 @@
4739
- name: "Include Logstash"
4840
ansible.builtin.include_role:
4941
name: logstash
50-
- name: Configure rsyslog
51-
ansible.builtin.lineinfile:
52-
line: "*.* @@localhost:514"
53-
path: /etc/rsyslog.conf
54-
- name: Restart rsyslog
55-
ansible.builtin.service:
56-
name: rsyslog
57-
state: restarted
58-
changed_when: false

molecule/logstash_full_stack-oss/verify.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@
1313
- name: Run syntax check
1414
ansible.builtin.command: "/usr/share/logstash/bin/logstash --path.settings=/etc/logstash -t"
1515
when: "'logstash' in group_names"
16-
- name: Check for open port tcp {{ elasticstack_beats_port }}
17-
ansible.builtin.wait_for:
18-
port: "{{ elasticstack_beats_port }}"
19-
when: "'logstash' in group_names"
2016
- name: Query for Logstasch indices
2117
ansible.builtin.shell: >
2218
curl -s http://localhost:{{ elasticstack_elasticsearch_http_port }}/_cat/indices |

roles/elasticsearch/tasks/main.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,6 @@
204204
when: elasticsearch_jna_workaround | bool
205205

206206
- name: Set jvm heap size
207-
become: yes
208207
ansible.builtin.template:
209208
src: "jvm.options.d/heap.options.j2"
210209
dest: "{{ elasticsearch_conf_dir }}/jvm.options.d/10-heap.options"
@@ -216,7 +215,6 @@
216215
when: (elasticsearch_heap)
217216

218217
- name: Set jvm paths
219-
become: yes
220218
ansible.builtin.template:
221219
src: "jvm.options.d/paths.options.j2"
222220
dest: "{{ elasticsearch_conf_dir }}/jvm.options.d/50-paths.options"
@@ -227,7 +225,6 @@
227225
notify: Restart Elasticsearch
228226

229227
- name: Set jvm custom options
230-
become: yes
231228
ansible.builtin.template:
232229
src: "jvm.options.d/custom.options.j2"
233230
dest: "{{ elasticsearch_conf_dir }}/jvm.options.d/90-custom.options"

0 commit comments

Comments
 (0)