linux-system-roles / kdump

An ansible role which configures kdump
https://linux-system-roles.github.io/kdump/
MIT License
19 stars 21 forks source link

test: check generated files for ansible_managed, fingerprint #140

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"
richm commented 1 year ago

[citest]