def rule_absent(name, method, port=None, proto='tcp', direction='in', port_origin='d', ip_origin='s', ttl=None, reload=False):
 ip = name
 ret = {'name': name, 'changes': {}, 'result': True, 'comment': 'Rule not present.'}
 exists = __salt__['csf.exists'](method, ip, port=port, proto=proto, direction=direction, port_origin=port_origin, ip_origin=ip_origin, ttl=ttl)
 if (not exists):
  return ret
 else:
  rule = __salt__['csf.remove_rule'](method=method, ip=ip, port=port, proto=proto, direction=direction, port_origin=port_origin, ip_origin=ip_origin, comment='', ttl=ttl)
  if rule:
   comment = 'Rule has been removed.'
  if reload:
   if __salt__['csf.reload']():
    comment += ' Csf reloaded.'
   else:
    comment += 'Csf unable to be reloaded.'
  ret['comment'] = comment
  ret['changes']['Rule'] = 'Removed'
 return ret

def rule_absent ( name , method , port = None , proto = 'tcp' , direction = 'in' , port_origin = 'd' , ip_origin = 's' , ttl = None , reload = False ) : ip = name ret = { 'name' : name , 'changes' : { } , 'result' : True , 'comment' : 'Rule not present.' } exists = __salt__ [ 'csf.exists' ] ( method , ip , port = port , proto = proto , direction = direction , port_origin = port_origin , ip_origin = ip_origin , ttl = ttl ) if ( not exists ) : return ret else : rule = __salt__ [ 'csf.remove_rule' ] ( method = method , ip = ip , port = port , proto = proto , direction = direction , port_origin = port_origin , ip_origin = ip_origin , comment = '' , ttl = ttl ) if rule : comment = 'Rule has been removed.' if reload : if __salt__ [ 'csf.reload' ] ( ) : comment += ' Csf reloaded.' else : comment += 'Csf unable to be reloaded.' ret [ 'comment' ] = comment ret [ 'changes' ] [ 'Rule' ] = 'Removed' return ret
ensure iptable is not present .