def network_security_group_absent(name, resource_group, connection_auth=None):
    '''
    .. versionadded:: 2019.2.0

    Ensure a network security group does not exist in the resource group.

    :param name:
        Name of the network security group.

    :param resource_group:
        The resource group assigned to the network security group.

    :param connection_auth:
        A dict with subscription and authentication parameters to be used in connecting to the
        Azure Resource Manager API.
    '''
    ret = {
        'name': name,
        'result': False,
        'comment': '',
        'changes': {}
    }

    if not isinstance(connection_auth, dict):
        ret['comment'] = 'Connection information must be specified via connection_auth dictionary!'
        return ret

    nsg = __salt__['azurearm_network.network_security_group_get'](
        name,
        resource_group,
        azurearm_log_level='info',
        **connection_auth
    )

    if 'error' in nsg:
        ret['result'] = True
        ret['comment'] = 'Network security group {0} was not found.'.format(name)
        return ret

    elif __opts__['test']:
        ret['comment'] = 'Network security group {0} would be deleted.'.format(name)
        ret['result'] = None
        ret['changes'] = {
            'old': nsg,
            'new': {},
        }
        return ret

    deleted = __salt__['azurearm_network.network_security_group_delete'](name, resource_group, **connection_auth)

    if deleted:
        ret['result'] = True
        ret['comment'] = 'Network security group {0} has been deleted.'.format(name)
        ret['changes'] = {
            'old': nsg,
            'new': {}
        }
        return ret

    ret['comment'] = 'Failed to delete network security group {0}!'.format(name)
    return ret
def network_security_group_absent ( name , resource_group , connection_auth = None ) : ret = { 'name' : name , 'result' : False , 'comment' : '' , 'changes' : { } } if not isinstance ( connection_auth , dict ) : ret [ 'comment' ] = 'Connection information must be specified via connection_auth dictionary!' return ret nsg = __salt__ [ 'azurearm_network.network_security_group_get' ] ( name , resource_group , azurearm_log_level = 'info' , ** connection_auth ) if 'error' in nsg : ret [ 'result' ] = True ret [ 'comment' ] = 'Network security group {0} was not found.' . format ( name ) return ret elif __opts__ [ 'test' ] : ret [ 'comment' ] = 'Network security group {0} would be deleted.' . format ( name ) ret [ 'result' ] = None ret [ 'changes' ] = { 'old' : nsg , 'new' : { } , } return ret deleted = __salt__ [ 'azurearm_network.network_security_group_delete' ] ( name , resource_group , ** connection_auth ) if deleted : ret [ 'result' ] = True ret [ 'comment' ] = 'Network security group {0} has been deleted.' . format ( name ) ret [ 'changes' ] = { 'old' : nsg , 'new' : { } } return ret ret [ 'comment' ] = 'Failed to delete network security group {0}!' . format ( name ) return ret
.. versionadded:: 2019.2.0

    Ensure a network security group does not exist in the resource group.

    :param name:
        Name of the network security group.

    :param resource_group:
        The resource group assigned to the network security group.

    :param connection_auth:
        A dict with subscription and authentication parameters to be used in connecting to the
        Azure Resource Manager API.