#NEWLINE# def deployed( name , sourcepath , apppool = '' , hostheader = '' , ipaddress = '*' , port = 80 , protocol = 'http' ) : #NEWLINE# #INDENT# '\n    Ensure the website has been deployed.\n\n    .. note:\n\n        This function only validates against the site name, and will return True even\n        if the site already exists with a different configuration. It will not modify\n        the configuration of an existing site.\n\n    :param str name: The IIS site name.\n    :param str sourcepath: The physical path of the IIS site.\n    :param str apppool: The name of the IIS application pool.\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\n    .. note:\n\n        If an application pool is specified, and that application pool does not already exist,\n        it will be created.\n    ' #NEWLINE# ret = { #NEWLINE# #INDENT# 'name' : name , #NEWLINE# 'changes' : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , #NEWLINE# 'result' : None , #NEWLINE# 'comment' : '' , #NEWLINE# #UNINDENT# } #NEWLINE# current_sites = __salt__ [ 'win_iis.list_sites' ] ( ) #NEWLINE# if ( name in current_sites ) : #NEWLINE# #INDENT# ret [ 'comment' ] = 'Site already present: {0}' . format ( name ) #NEWLINE# ret [ 'result' ] = True #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if __opts__ [ 'test' ] : #NEWLINE# #INDENT# ret [ 'comment' ] = 'Site will be created: {0}' . format ( name ) #NEWLINE# ret [ 'changes' ] = { #NEWLINE# #INDENT# 'old' : None , #NEWLINE# 'new' : name , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ret [ 'comment' ] = 'Created site: {0}' . format ( name ) #NEWLINE# ret [ 'changes' ] = { #NEWLINE# #INDENT# 'old' : None , #NEWLINE# 'new' : name , #NEWLINE# #UNINDENT# } #NEWLINE# ret [ 'result' ] = __salt__ [ 'win_iis.create_site' ] ( name , sourcepath , apppool , hostheader , ipaddress , port , protocol ) #NEWLINE# #UNINDENT# #UNINDENT# return ret