From 3a02e5b774b2e4100e322d4ead8175fc29c7fa9f 2020-01-07 22:34:33 From: Branko Majic Date: 2020-01-07 22:34:33 Subject: [PATCH] MAR-148: Clean-up TODO entries for the common role coming from bugs in earlier versions of software: - Switch to using the systemd task for reloads. - Add back validation of pipreqcheck activation script file permissions. - Add back validation of missing ntp/ntpdate packages. --- diff --git a/roles/common/handlers/main.yml b/roles/common/handlers/main.yml index 816adde4665644bc0d57004062be342acd3f1591..e9c594c29525dbb28cd496ff3c5518603ca602e4 100644 --- a/roles/common/handlers/main.yml +++ b/roles/common/handlers/main.yml @@ -28,16 +28,9 @@ name: ferm state: restarted -# @TODO: Replace this with use of systemd module once Ansible is upgraded to -# version 2.2+. - name: Reload systemd - command: "systemctl daemon-reload" - tags: - # [ANSIBLE0012] Commands should not change things if nothing needs doing - # This task is invoked only if user is very specific about requiring to - # run the handlers manually as a way to bring the system to consistency - # after interrupted runs. - - skip_ansible_lint + systemd: + daemon_reload: true - name: Restart NTP server service: diff --git a/roles/common/molecule/default/tests/test_default.py b/roles/common/molecule/default/tests/test_default.py index de8455cf5f380af3ec864e583bc8a6ad3e0611bf..1aeef9fbec2d94e59c6ee47c82014a754d0b9fd3 100644 --- a/roles/common/molecule/default/tests/test_default.py +++ b/roles/common/molecule/default/tests/test_default.py @@ -250,9 +250,7 @@ def test_pipreqcheck_virtualenv(host, virtualenv_activate_path): assert virtualenv_activate.is_file assert virtualenv_activate.user == 'pipreqcheck' assert virtualenv_activate.group == 'pipreqcheck' - # @TODO: Possibly due to some timing issues, this file might - # sometimes end-up being 0640, sometimes 0644. - # assert virtualenv_activate.mode == 0o644 + assert virtualenv_activate.mode == 0o644 @pytest.mark.parametrize('config_dir', [ diff --git a/roles/common/molecule/default/tests/test_parameters_mandatory.py b/roles/common/molecule/default/tests/test_parameters_mandatory.py index 7227fe0f059a7e0052f3980dd62eca93bcf6a63c..8d40e530704cfc33b942d86f8282e0e18d8006e0 100644 --- a/roles/common/molecule/default/tests/test_parameters_mandatory.py +++ b/roles/common/molecule/default/tests/test_parameters_mandatory.py @@ -133,12 +133,8 @@ def test_ntp_software_not_installed(host): Tests if NTP packages are absent. """ - # @TODO: This throws an exception. It seems version of Testinfra - # used cannot properly check for absence of package. - # assert not host.package('ntp').is_installed - # assert not host.package('ntpdate').is_installed - - pass + assert not host.package('ntp').is_installed + assert not host.package('ntpdate').is_installed def test_ntp_listening_interfaces(host):