Test Audita configuration rendering
This commit is contained in:
31
tests/verify-config.yml
Normal file
31
tests/verify-config.yml
Normal file
@@ -0,0 +1,31 @@
|
||||
---
|
||||
- name: Verify rendered Audita configuration
|
||||
hosts: localhost
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: Read rendered configuration
|
||||
become: true
|
||||
ansible.builtin.slurp:
|
||||
src: /usr/local/etc/audita/config.yml
|
||||
register: audita_rendered_config_file
|
||||
|
||||
- name: Check rendered configuration
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- '(audita_rendered_config_file.content | b64decode | from_yaml) == audita_expected_config'
|
||||
|
||||
- name: Validate rendered configuration
|
||||
ansible.builtin.command:
|
||||
argv:
|
||||
- /usr/local/bin/audita
|
||||
- config
|
||||
- validate
|
||||
- --config
|
||||
- /usr/local/etc/audita/config.yml
|
||||
register: audita_rendered_config_validation
|
||||
changed_when: false
|
||||
|
||||
- name: Check rendered configuration validation output
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- audita_rendered_config_validation.stdout == "config is valid"
|
||||
Reference in New Issue
Block a user