network/tests/roles/linux-system-roles.network
Noriko Hosoi 79b39792e4 System Roles should consistently use ansible_managed in configuration files it manages
bz#2044640

The network role create an ifcfg file for initscripts. The file
used to append a comment "# this file was created by ansible".
This patch replaces the proprietary string with the ansible
standard {{ ansible_managed }} to adjust to the other system
roles.

For the implementation, it borrowed the method from kernel_settings,
getting the ansible managed comment using the get_ansible_managed.j2
template and pass the comment to network_connections which is added
to the ifcfg file.

In case network_provider is nm, the comment is not added to the
ifcfg file as the file is not managed by Ansible.

Note: the required parameter name to pass the ansible managed comment
to the network_connection module is "__header".

Do not use get_ansible_managed.j2 in the test scripts, but use a
hardcoded ansible managed comment to simplify the tests.

tests/tasks/get_profile_stat.yml: replace the '=' style with the YAML
notation in set_fact.

Signed-off-by: Noriko Hosoi <nhosoi@redhat.com>
2022-02-25 06:10:42 +08:00
..
defaults Avoid symlink loop and nonstandard top level roles directory - move to tests 2018-05-16 20:03:05 +02:00
library Avoid symlink loop and nonstandard top level roles directory - move to tests 2018-05-16 20:03:05 +02:00
meta Avoid symlink loop and nonstandard top level roles directory - move to tests 2018-05-16 20:03:05 +02:00
module_utils Modularize role 2018-08-15 10:04:47 +02:00
tasks Avoid symlink loop and nonstandard top level roles directory - move to tests 2018-05-16 20:03:05 +02:00
templates System Roles should consistently use ansible_managed in configuration files it manages 2022-02-25 06:10:42 +08:00