Closed BelenValdivia closed 1 year ago
07/06/2023
08/06/2023
- name: run Python script
hosts: windows1
tasks:
- name: run python_script.py script
ansible.builtin.script:
executable: python
cmd: /home/belen/python_script.py
09/06/2023
Meeting with @BelenValdivia about issues encountered with the testinfra syntaxis while using the Ansible task script.
Currently, it appears that using windows.ansible('script', 'script_python_testing.py executable=python', check=False)
solves the problem to some extent. However, we still need to conduct further research to ensure a comprehensive solution is in place.
12/06/2023 Created PR https://github.com/wazuh/qa-system-framework/pull/53
04/07/2023
In communication with Belen, it was explained that it is required to add #!/usr/bin/env python3 or #!/usr/bin/env python to the script in order to make it work. It will be retested.
Adding #!/usr/bin/env python3 or #!/usr/bin/env python did not affect the result of the test.
Tested in a different virtual environment and it worked. 2/3 reviews were passed. Approval from the last reviewer is pending.
Description
The HostManager class enables the execution of low-level tasks on remote hosts. It leverages the test-infra framework for performing these tasks remotely. It would be beneficial to introduce a new method that runs a Python script on a host.