@depends(HAS_ESX_CLI)
def enable_firewall_ruleset(host, username, password, ruleset_enable, ruleset_name, protocol=None, port=None, esxi_hosts=None):
 cmd = 'network firewall ruleset set --enabled {0} --ruleset-id={1}'.format(ruleset_enable, ruleset_name)
 ret = {}
 if esxi_hosts:
  if (not isinstance(esxi_hosts, list)):
   raise CommandExecutionError("'esxi_hosts' must be a list.")
  for esxi_host in esxi_hosts:
   response = salt.utils.vmware.esxcli(host, username, password, cmd, protocol=protocol, port=port, esxi_host=esxi_host)
   ret.update({esxi_host: response})
 else:
  response = salt.utils.vmware.esxcli(host, username, password, cmd, protocol=protocol, port=port)
  ret.update({host: response})
 return ret

@ depends ( HAS_ESX_CLI ) def enable_firewall_ruleset ( host , username , password , ruleset_enable , ruleset_name , protocol = None , port = None , esxi_hosts = None ) : cmd = 'network firewall ruleset set --enabled {0} --ruleset-id={1}' . format ( ruleset_enable , ruleset_name ) ret = { } if esxi_hosts : if ( not isinstance ( esxi_hosts , list ) ) : raise CommandExecutionError ( "'esxi_hosts' must be a list." ) for esxi_host in esxi_hosts : response = salt . utils . vmware . esxcli ( host , username , password , cmd , protocol = protocol , port = port , esxi_host = esxi_host ) ret . update ( { esxi_host : response } ) else : response = salt . utils . vmware . esxcli ( host , username , password , cmd , protocol = protocol , port = port ) ret . update ( { host : response } ) return ret
enable or disable an esxi firewall rule set .