#NEWLINE# def create_binding( name , site , hostheader = '' , ipaddress = '*' , port = 80 , protocol = 'http' , sslflags = 0 ) : #NEWLINE# #INDENT# '\n    Create an IIS binding.\n\n    .. note:\n\n        This function only validates against the binding ipaddress:port:hostheader combination,\n        and will return True even if the binding already exists with a different configuration.\n        It will not modify the configuration of an existing binding.\n\n    :param str site: The IIS site name.\n    :param str hostheader: The host header of the binding.\n    :param str ipaddress: The IP address of the binding.\n    :param str port: The TCP port of the binding.\n    :param str protocol: The application protocol of the binding.\n    :param str sslflags: The flags representing certificate type and storage of the binding.\n    ' #NEWLINE# ret = { #NEWLINE# #INDENT# 'name' : name , #NEWLINE# 'changes' : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , #NEWLINE# 'comment' : str ( ) , #NEWLINE# 'result' : None , #NEWLINE# #UNINDENT# } #NEWLINE# binding_info = _get_binding_info ( hostheader , hostheader , port ) #NEWLINE# current_bindings = __salt__ [ 'win_iis.list_bindings' ] ( site ) #NEWLINE# if ( binding_info in current_bindings ) : #NEWLINE# #INDENT# ret [ 'comment' ] = 'Binding already present: {0}' . format ( binding_info ) #NEWLINE# ret [ 'result' ] = True #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if __opts__ [ 'test' ] : #NEWLINE# #INDENT# ret [ 'comment' ] = 'Binding will be created: {0}' . format ( binding_info ) #NEWLINE# ret [ 'changes' ] = { #NEWLINE# #INDENT# 'old' : None , #NEWLINE# 'new' : binding_info , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ret [ 'comment' ] = 'Created binding: {0}' . format ( binding_info ) #NEWLINE# ret [ 'changes' ] = { #NEWLINE# #INDENT# 'old' : None , #NEWLINE# 'new' : binding_info , #NEWLINE# #UNINDENT# } #NEWLINE# ret [ 'result' ] = __salt__ [ 'win_iis.create_binding' ] ( site , hostheader , ipaddress , port , protocol , sslflags ) #NEWLINE# #UNINDENT# #UNINDENT# return ret