sophos.sophos_firewall.sfos_qos_policy module – Manage QoS Policies (Configure > System Services > Traffic Shaping)

Note

This module is part of the sophos.sophos_firewall collection (version 2.3.1).

It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install sophos.sophos_firewall. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: sophos.sophos_firewall.sfos_qos_policy.

New in sophos.sophos_firewall 2.3.0

Synopsis

  • Manage QoS Policies (Configure > System Services > Traffic Shaping) on Sophos Firewall

Requirements

The below requirements are needed on the host that executes this module.

  • sophosfirewall-python

  • Beginning in version 2.0.0, this module requires use of an httpapi connection plugin. See the HTTPAPI example for details.

Parameters

Parameter

Comments

bandwidth_usage_type

string

Select the type of Bandwidth usage.

Choices:

  • "Individual"

  • "Shared"

burstable_bandwidth

integer

Specify burstable bandwidth (maximum) for ‘Committed’ type and ‘Total’ strategy (KB).

burstable_download_bandwidth

integer

Specify burstable (maximum) download bandwidth for ‘Committed’ type and ‘Individual’ strategy (KB).

burstable_upload_bandwidth

integer

Specify burstable (maximum) upload bandwidth for ‘Committed’ type and ‘Individual’ strategy (KB).

description

string

Specify policy description.

download_bandwidth

integer

Specify download bandwidth for ‘Individual’ strategy and ‘Strict’ type (KB).

guaranteed_bandwidth

integer

Specify guaranteed bandwidth (minimum) for ‘Committed’ type and ‘Total’ strategy (KB).

guaranteed_download_bandwidth

integer

Specify guaranteed download bandwidth (minimum) for ‘Committed’ type and ‘Individual’ strategy (KB).

guaranteed_upload_bandwidth

integer

Specify guaranteed upload bandwidth (minimum) for ‘Committed’ type and ‘Individual’ strategy (KB).

implementation_on

string

Specify implementation strategy of Policy.

Choices:

  • "Total"

  • "Individual"

name

string / required

Specify a name for the QoS Policy.

policy_based_on

string

Select an option for whom the policy is created.

Choices:

  • "User"

  • "Firewall"

  • "Application"

  • "WebCategory"

policy_type

string

Select the type of Policy.

Choices:

  • "Strict"

  • "Committed"

priority

string / required

Set the Bandwidth priority.

Choices:

  • "RealTime"

  • "BusinessCritical"

  • "Normal2"

  • "Normal3"

  • "Normal4"

  • "Normal5"

  • "BulkyFTP"

  • "BestEffort"

schedule_based_rules

list / elements=dictionary

Specify schedule-wise QoS policy details.

burstable_bandwidth

integer

Burstable bandwidth for this schedule rule (KB).

burstable_download_bandwidth

integer

Burstable download bandwidth for this schedule rule (KB).

burstable_upload_bandwidth

integer

Burstable upload bandwidth for this schedule rule (KB).

detail_id

string / required

Detail ID for the schedule rule.

download_bandwidth

integer

Download bandwidth for this schedule rule (KB).

guaranteed_bandwidth

integer

Guaranteed bandwidth for this schedule rule (KB).

guaranteed_download_bandwidth

integer

Guaranteed download bandwidth for this schedule rule (KB).

guaranteed_upload_bandwidth

integer

Guaranteed upload bandwidth for this schedule rule (KB).

policy_type

string

Policy type for this schedule rule.

Choices:

  • "Strict"

  • "Committed"

schedule

string / required

Schedule name for this rule.

total_bandwidth

integer

Total bandwidth for this schedule rule (KB).

upload_bandwidth

integer

Upload bandwidth for this schedule rule (KB).

state

string / required

Use query to retrieve, present to create, updated to modify, or absent to remove

Choices:

  • "present"

  • "updated"

  • "query"

  • "absent"

total_bandwidth

integer

Specify allowed total bandwidth for ‘Strict’ policy type and ‘Total’ implementation strategy (KB).

upload_bandwidth

integer

Specify upload bandwidth for ‘Individual’ strategy and ‘Strict’ type (KB).

Examples

- name: Create QoS Policy - Strict Total
  sophos.sophos_firewall.sfos_qos_policy:
    name: "Strict Total Policy"
    policy_type: "Strict"
    implementation_on: "Total"
    priority: "BusinessCritical"
    policy_based_on: "User"
    bandwidth_usage_type: "Shared"
    total_bandwidth: 1000
    description: "Strict policy with total bandwidth control"
    state: present

- name: Create QoS Policy - Committed Individual
  sophos.sophos_firewall.sfos_qos_policy:
    name: "Committed Individual Policy"
    policy_type: "Committed"
    implementation_on: "Individual"
    priority: "Normal2"
    policy_based_on: "Application"
    bandwidth_usage_type: "Individual"
    guaranteed_upload_bandwidth: 1000
    burstable_upload_bandwidth: 500
    guaranteed_download_bandwidth: 5000
    burstable_download_bandwidth: 2000
    description: "Committed policy with individual bandwidth limits"
    state: present

- name: Create QoS Policy with Schedule-based Rules
  sophos.sophos_firewall.sfos_qos_policy:
    name: "Schedule Based Policy"
    policy_type: "Strict"
    implementation_on: "Total"
    priority: "Normal3"
    policy_based_on: "Firewall"
    bandwidth_usage_type: "Shared"
    total_bandwidth: 2000
    description: "Policy with schedule-based bandwidth rules"
    schedule_based_rules:
      - detail_id: "BusinessHours"
        policy_type: "Strict"
        total_bandwidth: 1500
        schedule: "Business Hours"
      - detail_id: "OffHours"
        policy_type: "Committed"
        guaranteed_bandwidth: 500
        burstable_bandwidth: 1000
        schedule: "Off Hours"
    state: present

- name: Query QoS Policy
  sophos.sophos_firewall.sfos_qos_policy:
    name: "Strict Total Policy"
    state: query

- name: Update QoS Policy
  sophos.sophos_firewall.sfos_qos_policy:
    name: "Strict Total Policy"
    total_bandwidth: 1500
    description: "Updated strict policy"
    state: updated

- name: Remove QoS Policy
  sophos.sophos_firewall.sfos_qos_policy:
    name: "Strict Total Policy"
    state: absent

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

api_response

dictionary

Serialized object containing the API response.

Returned: always

Authors

  • Matt Mullen (@mamullen13316)