ansible-sshd/tests
Rich Megginson c5c519f73b test: check generated files for ansible_managed, fingerprint
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`:

* `__file` - the full path of the file to check e.g. `/etc/realmd.conf`
* `__file_content` - the output of `slurp` of the file
* `__fingerprint` - required - the fingerprint string `system_role:$ROLENAME` e.g.
  `__fingerprint: "system_role:postfix"`
* `__comment_type` - optional, default `plain` - the type of comments used

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>
2023-04-26 07:52:03 -06:00
..
roles Add a symlink to make tests working in CI without modification to ansible.cfg 2020-11-06 11:35:10 +01:00
tasks test: check generated files for ansible_managed, fingerprint 2023-04-26 07:52:03 -06:00
templates test: check generated files for ansible_managed, fingerprint 2023-04-26 07:52:03 -06:00
inventory Add tests 2015-01-12 21:01:08 +00:00
requirements.yml Add support for managing selinux and firewall on RHEL 2023-01-13 10:42:40 +01:00
tests_all_options.yml test: check generated files for ansible_managed, fingerprint 2023-04-26 07:52:03 -06:00
tests_alternative_file.yml ansible-lint - align with current Ansible recommendations 2023-04-10 14:21:30 -06:00
tests_alternative_file_role.yml ansible-lint - align with current Ansible recommendations 2023-04-10 14:21:30 -06:00
tests_backup.yml ansible-lint - align with current Ansible recommendations 2023-04-10 14:21:30 -06:00
tests_config_namespace.yml ansible-lint - align with current Ansible recommendations 2023-04-10 14:21:30 -06:00
tests_default.yml ansible-lint - align with current Ansible recommendations 2023-04-10 14:21:30 -06:00
tests_default_include.yml ansible-lint - align with current Ansible recommendations 2023-04-10 14:21:30 -06:00
tests_duplicate_role.yml ansible-lint - align with current Ansible recommendations 2023-04-10 14:21:30 -06:00
tests_firewall_selinux.yml ansible-lint - align with current Ansible recommendations 2023-04-10 14:21:30 -06:00
tests_hostkeys.yml ansible-lint - align with current Ansible recommendations 2023-04-10 14:21:30 -06:00
tests_hostkeys_fips.yml ansible-lint - align with current Ansible recommendations 2023-04-10 14:21:30 -06:00
tests_hostkeys_missing.yml ansible-lint - align with current Ansible recommendations 2023-04-10 14:21:30 -06:00
tests_hostkeys_role.yml ansible-lint - align with current Ansible recommendations 2023-04-10 14:21:30 -06:00
tests_include_present.yml ansible-lint - align with current Ansible recommendations 2023-04-10 14:21:30 -06:00
tests_indent.yml Make sure the list options are correctly indented 2023-04-14 19:01:19 +02:00
tests_match.yml ansible-lint - align with current Ansible recommendations 2023-04-10 14:21:30 -06:00
tests_match_iterate.yml ansible-lint - align with current Ansible recommendations 2023-04-10 14:21:30 -06:00
tests_os_defaults.yml ansible-lint - align with current Ansible recommendations 2023-04-10 14:21:30 -06:00
tests_precedence.yml ansible-lint - align with current Ansible recommendations 2023-04-10 14:21:30 -06:00
tests_set_common.yml ansible-lint - align with current Ansible recommendations 2023-04-10 14:21:30 -06:00
tests_set_uncommon.yml ansible-lint - align with current Ansible recommendations 2023-04-10 14:21:30 -06:00
tests_sshd_enable.yml ansible-lint - align with current Ansible recommendations 2023-04-10 14:21:30 -06:00
tests_sysconfig.yml ansible-lint - align with current Ansible recommendations 2023-04-10 14:21:30 -06:00