Skip to content

Commit

Permalink
feat: add conditional to differentiate extensions in windows
Browse files Browse the repository at this point in the history
  • Loading branch information
rafabailon committed Mar 6, 2024
1 parent a68f2cc commit 4120ae7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion deps/wazuh_testing/wazuh_testing/tools/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,9 +482,13 @@ def install_package(self, host, url, system='ubuntu'):
host_manager.install_package('my_host', 'http://example.com/package.deb', system='ubuntu')
"""
result = False
extension = '.msi'

if system == 'windows':
result = self.get_host(host).ansible("win_package", f"path={url} arguments=/S", check=False)
if host.lower().endswith(extension):
result = self.get_host(host).ansible("win_package", f"path={url} arguments=/passive", check=False)
else:
result = self.get_host(host).ansible("win_package", f"path={url} arguments=/S", check=False)
elif system == 'ubuntu':
result = self.get_host(host).ansible("apt", f"deb={url}", check=False)
if result['changed'] and result['stderr'] == '':
Expand Down

0 comments on commit 4120ae7

Please sign in to comment.