def install_overlay(module, name, list_url=None):
 layman_conf = BareConfig(read_configfile=True)
 layman = init_layman(layman_conf)
 if layman.is_installed(name):
  return False
 if module.check_mode:
  mymsg = (("Would add layman repo '" + name) + "'")
  module.exit_json(changed=True, msg=mymsg)
 if (not layman.is_repo(name)):
  if (not list_url):
   raise ModuleError(("Overlay '%s' is not on the list of known overlays and URL of the remote list was not provided." % name))
  overlay_defs = layman_conf.get_option('overlay_defs')
  dest = path.join(overlay_defs, (name + '.xml'))
  download_url(module, list_url, dest)
  layman = init_layman()
 if (not layman.add_repos(name)):
  raise ModuleError(layman.get_errors())
 return True

def install_overlay ( module , name , list_url = None ) : layman_conf = BareConfig ( read_configfile = True ) layman = init_layman ( layman_conf ) if layman . is_installed ( name ) : return False if module . check_mode : mymsg = ( ( "Would add layman repo '" + name ) + "'" ) module . exit_json ( changed = True , msg = mymsg ) if ( not layman . is_repo ( name ) ) : if ( not list_url ) : raise ModuleError ( ( "Overlay '%s' is not on the list of known overlays and URL of the remote list was not provided." % name ) ) overlay_defs = layman_conf . get_option ( 'overlay_defs' ) dest = path . join ( overlay_defs , ( name + '.xml' ) ) download_url ( module , list_url , dest ) layman = init_layman ( ) if ( not layman . add_repos ( name ) ) : raise ModuleError ( layman . get_errors ( ) ) return True
installs the overlay repository .