Skip to content

Commit

Permalink
add verification for beats fields
Browse files Browse the repository at this point in the history
  • Loading branch information
tbauriedel committed Jan 17, 2024
1 parent fa5fd46 commit 8f85f90
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions molecule/beats_peculiar/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,10 @@
- beats_filebeat_version.stdout.find('8.4.1') == -1
- elasticstack_release == 8

- name: Fetch filebeat.yml
ansible.builtin.command: cat /etc/filebeat/filebeat.yml
register: filebeatyml

- name: Show filebeat.yml
ansible.builtin.debug:
var: filebeatyml.stdout_lines

#- name: Check for fields being set
# ansible.builtin.command: >
# pcregrep -M 'fields:(\n).*testfield: thisisatest' /etc/filebeat/filebeat.yml
- name: Ensure field is set correctly
ansible.builtin.lineinfile:
dest: /etc/filebeat/filebeat.yml
line: " testfield: thisisatest"
check_mode: true
register: _field
failed_when: _field.changed

0 comments on commit 8f85f90

Please sign in to comment.