def _get_shebang(interpreter, task_vars, args=tuple()):
 interpreter_config = (u'ansible_%s_interpreter' % os.path.basename(interpreter).strip())
 if (interpreter_config not in task_vars):
  return (None, interpreter)
 interpreter = task_vars[interpreter_config].strip()
 shebang = (u'#!' + interpreter)
 if args:
  shebang = ((shebang + u' ') + u' '.join(args))
 return (shebang, interpreter)

def _get_shebang ( interpreter , task_vars , args = tuple ( ) ) : interpreter_config = ( u'ansible_%s_interpreter' % os . path . basename ( interpreter ) . strip ( ) ) if ( interpreter_config not in task_vars ) : return ( None , interpreter ) interpreter = task_vars [ interpreter_config ] . strip ( ) shebang = ( u'#!' + interpreter ) if args : shebang = ( ( shebang + u' ' ) + u' ' . join ( args ) ) return ( shebang , interpreter )
note not stellar api: returns none instead of always returning a shebang line .