def create_vdir(name, site, sourcepath, app='/'):
 ret = {'name': name, 'changes': {}, 'comment': str(), 'result': None}
 current_vdirs = __salt__['win_iis.list_vdirs'](site, app)
 if (name in current_vdirs):
  ret['comment'] = 'Virtual directory already present: {0}'.format(name)
  ret['result'] = True
 elif __opts__['test']:
  ret['comment'] = 'Virtual directory will be created: {0}'.format(name)
  ret['changes'] = {'old': None, 'new': name}
 else:
  ret['comment'] = 'Created virtual directory: {0}'.format(name)
  ret['changes'] = {'old': None, 'new': name}
  ret['result'] = __salt__['win_iis.create_vdir'](name, site, sourcepath, app)
 return ret

def create_vdir ( name , site , sourcepath , app = '/' ) : ret = { 'name' : name , 'changes' : { } , 'comment' : str ( ) , 'result' : None } current_vdirs = __salt__ [ 'win_iis.list_vdirs' ] ( site , app ) if ( name in current_vdirs ) : ret [ 'comment' ] = 'Virtual directory already present: {0}' . format ( name ) ret [ 'result' ] = True elif __opts__ [ 'test' ] : ret [ 'comment' ] = 'Virtual directory will be created: {0}' . format ( name ) ret [ 'changes' ] = { 'old' : None , 'new' : name } else : ret [ 'comment' ] = 'Created virtual directory: {0}' . format ( name ) ret [ 'changes' ] = { 'old' : None , 'new' : name } ret [ 'result' ] = __salt__ [ 'win_iis.create_vdir' ] ( name , site , sourcepath , app ) return ret
create an iis virtual directory .