def ubuntu(module):
 release = module.params['release']
 stream = module.params['stream']
 store = module.params['store']
 arch = module.params['arch']
 region = module.params['region']
 virt = module.params['virt']
 url = get_ubuntu_url(release, stream)
 req = get_url(module, url)
 reader = csv.reader(req, delimiter=' DCTB ')
 try:
  (ami, aki, ari, tag, serial) = lookup_ubuntu_ami(reader, release, stream, store, arch, region, virt)
  module.exit_json(changed=False, ami=ami, aki=aki, ari=ari, tag=tag, serial=serial)
 except KeyError:
  module.fail_json(msg='No matching AMI found')

def ubuntu ( module ) : release = module . params [ 'release' ] stream = module . params [ 'stream' ] store = module . params [ 'store' ] arch = module . params [ 'arch' ] region = module . params [ 'region' ] virt = module . params [ 'virt' ] url = get_ubuntu_url ( release , stream ) req = get_url ( module , url ) reader = csv . reader ( req , delimiter = ' DCTB ' ) try : ( ami , aki , ari , tag , serial ) = lookup_ubuntu_ami ( reader , release , stream , store , arch , region , virt ) module . exit_json ( changed = False , ami = ami , aki = aki , ari = ari , tag = tag , serial = serial ) except KeyError : module . fail_json ( msg = 'No matching AMI found' )
get the ami for ubuntu .