@@ -208,7 +208,7 @@ def get_info(host, *, users=None, connection=None):
208208 )
209209
210210 data ["bin" ] = {}
211- for bin in ["dpkg" , "rpm" , "yum" , "apt" , "pkg" ]:
211+ for bin in ["dpkg" , "rpm" , "yum" , "apt" , "pkg" , "zypper" ]:
212212 path = ssh_cmd (connection , "which {}" .format (bin ))
213213 if path :
214214 data ["bin" ][bin ] = path
@@ -231,7 +231,13 @@ def install_package(host, pkg, data, *, connection=None):
231231 # timeout doesn't work over ssh.
232232 output = ssh_cmd (connection , powershell (r".\{} ; sleep 10" .format (pkg )), True )
233233 else :
234- output = ssh_sudo (connection , "yum -y install {}" .format (pkg ), True )
234+ # generally this "else" is for rpm packages
235+ if "yum" in data ["bin" ]:
236+ output = ssh_sudo (connection , "yum -y install {}" .format (pkg ), True )
237+ elif "zypper" in data ["bin" ]: # suse case
238+ output = ssh_sudo (connection , "zypper install -y --allow-unsigned-rpm {}" .format (pkg ), True )
239+ else :
240+ log .error ("Don't know how to install rpm package. No yum or zypper in PATH." )
235241 if output is None :
236242 log .error ("Installation failed on '{}'" .format (host ))
237243
0 commit comments