32 lines
949 B
YAML
32 lines
949 B
YAML
---
|
|
- 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"
|