def set_installed_variant_rpm_facts(facts):
 installed_rpms = []
 for base_rpm in ['openshift', 'atomic-openshift', 'origin']:
  optional_rpms = ['master', 'node', 'clients', 'sdn-ovs']
  variant_rpms = (([base_rpm] + ['{0}-{1}'.format(base_rpm, r) for r in optional_rpms]) + [('tuned-profiles-%s-node' % base_rpm)])
  for rpm in variant_rpms:
   (exit_code, _, _) = module.run_command(['rpm', '-q', rpm])
   if (exit_code == 0):
    installed_rpms.append(rpm)
 facts['common']['installed_variant_rpms'] = installed_rpms
 return facts

def set_installed_variant_rpm_facts ( facts ) : installed_rpms = [ ] for base_rpm in [ 'openshift' , 'atomic-openshift' , 'origin' ] : optional_rpms = [ 'master' , 'node' , 'clients' , 'sdn-ovs' ] variant_rpms = ( ( [ base_rpm ] + [ '{0}-{1}' . format ( base_rpm , r ) for r in optional_rpms ] ) + [ ( 'tuned-profiles-%s-node' % base_rpm ) ] ) for rpm in variant_rpms : ( exit_code , _ , _ ) = module . run_command ( [ 'rpm' , '-q' , rpm ] ) if ( exit_code == 0 ) : installed_rpms . append ( rpm ) facts [ 'common' ] [ 'installed_variant_rpms' ] = installed_rpms return facts
set rpm facts of installed variant args: facts : existing facts returns: dict: the facts dict updated with installed_variant_rpms .