def create_annotation(module):
 annotation = {}
 if (module.params['duration'] != None):
  duration = module.params['duration']
 else:
  duration = 0
 if (module.params['start'] != None):
  start = module.params['start']
 else:
  start = int(time.time())
 if (module.params['stop'] != None):
  stop = module.params['stop']
 else:
  stop = (int(time.time()) + duration)
 annotation['start'] = int(start)
 annotation['stop'] = int(stop)
 annotation['category'] = module.params['category']
 annotation['description'] = module.params['description']
 annotation['title'] = module.params['title']
 return annotation

def create_annotation ( module ) : annotation = { } if ( module . params [ 'duration' ] != None ) : duration = module . params [ 'duration' ] else : duration = 0 if ( module . params [ 'start' ] != None ) : start = module . params [ 'start' ] else : start = int ( time . time ( ) ) if ( module . params [ 'stop' ] != None ) : stop = module . params [ 'stop' ] else : stop = ( int ( time . time ( ) ) + duration ) annotation [ 'start' ] = int ( start ) annotation [ 'stop' ] = int ( stop ) annotation [ 'category' ] = module . params [ 'category' ] annotation [ 'description' ] = module . params [ 'description' ] annotation [ 'title' ] = module . params [ 'title' ] return annotation
takes ansible module object .