The HostManager class enables the execution of low-level tasks on remote hosts. It leverages the testinfra framework for performing these tasks remotely. However, it would be beneficial to introduce a new method that utilizes the ansible-runner module, allowing the direct execution of playbooks within the environment.
This additional method would greatly assist in migrating system tests for installation and upgrades to the new framework. Furthermore, it would prove invaluable for handling more intricate tasks whenever the tests demand it.
Note:
The inventory used should be the one provided in the HostManager constructor.
Warning:
It may be necessary to implement a method that handles exceptions in case the playbook fails, enhancing the readability of the error messages.
Description
The HostManager class enables the execution of low-level tasks on remote hosts. It leverages the testinfra framework for performing these tasks remotely. However, it would be beneficial to introduce a new method that utilizes the ansible-runner module, allowing the direct execution of playbooks within the environment.
This additional method would greatly assist in migrating system tests for installation and upgrades to the new framework. Furthermore, it would prove invaluable for handling more intricate tasks whenever the tests demand it.
Design
The proposed method can be defined as follows: