linux-system-roles / postfix

An ansible role which configures postfix
https://linux-system-roles.github.io/postfix/
GNU General Public License v3.0
13 stars 20 forks source link

test: check generated files for ansible_managed, fingerprint #83

Closed richm closed 1 year ago

richm commented 1 year ago

Add the following files: tests/tasks/check_header.yml and tests/templates/get_ansible_managed.j2. Use check_header.yml to check generated files for the ansible_managed and fingerprint headers. check_header.yml takes these parameters. fingerprint is required, and one of __file or __file_content:

e.g. __comment_type: c for C/C++-style comments. plain uses #. See https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_filters.html#adding-comments-to-files for the different types of comment styles supported.

Example:

- name: Check generated files for ansible_managed, fingerprint
  include_tasks: tasks/check_header.yml
  vars:
    __file: /etc/myfile.conf
    __fingerprint: "system_role:my_role"

Signed-off-by: Rich Megginson rmeggins@redhat.com

richm commented 1 year ago

[citest]