linux-system-roles / timesync

An ansible role which configures time synchronization
https://linux-system-roles.github.io/timesync/
MIT License
67 stars 43 forks source link

test: check generated files for ansible_managed, fingerprint #192

Closed richm closed 1 year ago

richm commented 1 year ago

Clean up more ansible-lint issues in code and README

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]

richm commented 1 year ago

[citest]

spetrosi commented 1 year ago

[citest bad]