#NEWLINE# def dhcp_options_present( name , dhcp_options_id = None , vpc_name = None , vpc_id = None , domain_name = None , domain_name_servers = None , ntp_servers = None , netbios_name_servers = None , netbios_node_type = None , tags = None , region = None , key = None , keyid = None , profile = None ) : #NEWLINE# #INDENT# '\n    Ensure a set of DHCP options with the given settings exist.\n    Note that the current implementation only SETS values during option set\n    creation.  It is unable to update option sets in place, and thus merely\n    verifies the set exists via the given name and/or dhcp_options_id param.\n\n    name\n        (string)\n        Name of the DHCP options.\n\n    vpc_name\n        (string)\n        Name of a VPC to which the options should be associated.  Either\n        vpc_name or vpc_id must be provided.\n\n    vpc_id\n        (string)\n        Id of a VPC to which the options should be associated.  Either\n        vpc_name or vpc_id must be provided.\n\n    domain_name\n        (string)\n        Domain name to be assiciated with this option set.\n\n    domain_name_servers\n        (list of strings)\n        The IP address(es) of up to four domain name servers.\n\n    ntp_servers\n        (list of strings)\n        The IP address(es) of up to four desired NTP servers.\n\n    netbios_name_servers\n        (list of strings)\n        The IP address(es) of up to four NetBIOS name servers.\n\n    netbios_node_type\n        (string)\n        The NetBIOS node type (1, 2, 4, or 8).  For more information about\n        the allowed values, see RFC 2132.  The recommended is 2 at this\n        time (broadcast and multicast are currently not supported).\n\n    tags\n        (dict of key:value pairs)\n        A set of tags to be added.\n\n    region\n        (string)\n        Region to connect to.\n\n    key\n        (string)\n        Secret key to be used.\n\n    keyid\n        (string)\n        Access key to be used.\n\n    profile\n        (various)\n        A dict with region, key and keyid, or a pillar key (string) that\n        contains a dict with region, key and keyid.\n\n    .. versionadded:: 2016.3.0\n    ' #NEWLINE# ret = { #NEWLINE# #INDENT# 'name' : name , #NEWLINE# 'result' : True , #NEWLINE# 'comment' : '' , #NEWLINE# 'changes' : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# _new = { #NEWLINE# #INDENT# 'domain_name' : domain_name , #NEWLINE# 'domain_name_servers' : domain_name_servers , #NEWLINE# 'ntp_servers' : ntp_servers , #NEWLINE# 'netbios_name_servers' : netbios_name_servers , #NEWLINE# 'netbios_node_type' : netbios_node_type , #NEWLINE# #UNINDENT# } #NEWLINE# r = __salt__ [ 'boto_vpc.dhcp_options_exists' ] ( dhcp_options_id = dhcp_options_id , dhcp_options_name = name , region = region , key = key , keyid = keyid , profile = profile ) #NEWLINE# if ( 'error' in r ) : #NEWLINE# #INDENT# ret [ 'result' ] = False #NEWLINE# ret [ 'comment' ] = 'Failed to validate DHCP options: {0}.' . format ( r [ 'error' ] [ 'message' ] ) #NEWLINE# return ret #NEWLINE# #UNINDENT# if r . get ( 'exists' ) : #NEWLINE# #INDENT# ret [ 'comment' ] = 'DHCP options already present.' #NEWLINE# return ret #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if __opts__ [ 'test' ] : #NEWLINE# #INDENT# ret [ 'comment' ] = 'DHCP options {0} are set to be created.' . format ( name ) #NEWLINE# ret [ 'result' ] = None #NEWLINE# return ret #NEWLINE# #UNINDENT# r = __salt__ [ 'boto_vpc.create_dhcp_options' ] ( domain_name = domain_name , domain_name_servers = domain_name_servers , ntp_servers = ntp_servers , netbios_name_servers = netbios_name_servers , netbios_node_type = netbios_node_type , dhcp_options_name = name , tags = tags , vpc_id = vpc_id , vpc_name = vpc_name , region = region , key = key , keyid = keyid , profile = profile ) #NEWLINE# if ( not r . get ( 'created' ) ) : #NEWLINE# #INDENT# ret [ 'result' ] = False #NEWLINE# ret [ 'comment' ] = 'Failed to create DHCP options: {1}' . format ( r [ 'error' ] [ 'message' ] ) #NEWLINE# return ret #NEWLINE# #UNINDENT# ret [ 'changes' ] [ 'old' ] = { #NEWLINE# #INDENT# 'dhcp_options' : None , #NEWLINE# #UNINDENT# } #NEWLINE# ret [ 'changes' ] [ 'new' ] = { #NEWLINE# #INDENT# 'dhcp_options' : _new , #NEWLINE# #UNINDENT# } #NEWLINE# ret [ 'comment' ] = 'DHCP options {0} created.' . format ( name ) #NEWLINE# return ret