cisco.intersight.intersight_system_qos_policy_info module – Gather information about System QoS Policies in Cisco Intersight

Note

This module is part of the cisco.intersight collection (version 2.3.0).

You might already have this collection installed if you are using the ansible package. 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 cisco.intersight.

To use it in a playbook, specify: cisco.intersight.intersight_system_qos_policy_info.

Synopsis

  • Retrieve comprehensive information about System QoS Policies and their configured classes from Cisco Intersight.

  • Query policies by organization, policy name, or filter by specific criteria.

  • Returns structured data combining policy metadata with detailed QoS class configurations.

  • Each policy includes all six QoS classes (Bronze, Silver, Gold, Platinum, Best Effort, FC) with their current settings.

  • Supports filtering by organization and policy name.

  • If no filters are provided, all System QoS Policies will be returned.

  • Returns structured data with both policy information and associated QoS class details.

Parameters

Parameter

Comments

api_key_id

string / required

Public API Key ID associated with the private key.

If not set, the value of the INTERSIGHT_API_KEY_ID environment variable is used.

api_private_key

path / required

Filename (absolute path) or string of PEM formatted private key data to be used for Intersight API authentication.

If a string is used, Ansible vault should be used to encrypt string data.

Ex. ansible-vault encrypt_string –vault-id tme@/Users/dsoper/Documents/vault_password_file ‘—–BEGIN EC PRIVATE KEY—–

<your private key data>

—–END EC PRIVATE KEY—–’

If not set, the value of the INTERSIGHT_API_PRIVATE_KEY environment variable is used.

api_uri

string

URI used to access the Intersight API.

If not set, the value of the INTERSIGHT_API_URI environment variable is used.

Default: "https://intersight.com/api/v1"

name

string

The exact name of the System QoS Policy to retrieve information from.

When specified, only the matching policy and its classes will be returned.

organization

string

The name of the organization to filter System QoS Policies by.

Use ‘default’ for the default organization.

When specified, only policies from this organization will be returned.

use_proxy

boolean

If no, it will not use a proxy, even if one is defined in an environment variable on the target hosts.

Choices:

  • false

  • true ← (default)

validate_certs

boolean

Boolean control for verifying the api_uri TLS certificate

Choices:

  • false

  • true ← (default)

Examples

# Basic Usage Examples

- name: Get all System QoS Policies
  cisco.intersight.intersight_system_qos_policy_info:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
  register: all_qos_policies

- name: Get System QoS Policies from specific organization
  cisco.intersight.intersight_system_qos_policy_info:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    organization: DevNet
  register: devnet_qos_policies

- name: Get specific System QoS Policy by name
  cisco.intersight.intersight_system_qos_policy_info:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    organization: DevNet
    name: lab-system-qos
  register: specific_qos_policy

- name: Display QoS classes from retrieved policy
  ansible.builtin.debug:
    msg: "Policy {{ item.Name }} has {{ item.Classes | length }} QoS classes configured"
  loop: "{{ specific_qos_policy.intersight_system_qos_policies }}"

# Advanced filtering and conditional tasks

- name: Get all System QoS policies and show enabled classes
  cisco.intersight.intersight_system_qos_policy_info:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
  register: qos_policies

- name: Show enabled QoS classes for each policy
  ansible.builtin.debug:
    msg: |
      Policy: {{ item.Name }}
      Enabled Classes: {{ item.Classes | selectattr('AdminState', 'equalto', 'Enabled') | map(attribute='Name') | list }}
  loop: "{{ qos_policies.intersight_system_qos_policies }}"

- name: Check if specific policy exists
  cisco.intersight.intersight_system_qos_policy_info:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    name: production-qos
  register: policy_check

- name: Fail if production policy doesn't exist
  ansible.builtin.fail:
    msg: "Production QoS policy not found!"
  when: policy_check.intersight_system_qos_policies | length == 0

Return Values

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

Key

Description

intersight_system_qos_policies

list / elements=dictionary

A list of System QoS Policies with their configurations

Returned: always

Sample: [{"Classes": [{"AdminState": "Disabled", "Cos": 1, "Mtu": 1500, "Name": "Bronze", "PacketDrop": true, "Weight": 7}, {"AdminState": "Disabled", "Cos": 2, "Mtu": 1500, "Name": "Silver", "PacketDrop": true, "Weight": 8}, {"AdminState": "Enabled", "Cos": 4, "Mtu": 1500, "Name": "Gold", "PacketDrop": true, "Weight": 9}, {"AdminState": "Enabled", "Cos": 5, "Mtu": 1500, "Name": "Platinum", "PacketDrop": true, "Weight": 10}, {"AdminState": "Enabled", "Cos": 255, "Mtu": 1500, "Name": "Best Effort", "PacketDrop": true, "Weight": 5}, {"AdminState": "Enabled", "Cos": 3, "Mtu": 2240, "Name": "FC", "PacketDrop": false, "Weight": 5}], "CreateTime": "2023-05-15T10:30:45.123Z", "Description": "System QoS policy for lab use", "ModTime": "2023-05-15T10:30:45.123Z", "Moid": "64620ac769726530014a1234", "Name": "lab-system-qos", "ObjectType": "fabric.SystemQosPolicy", "Organization": {"Moid": "675450ee69726530014753e2", "ObjectType": "organization.Organization"}, "Tags": [{"Key": "Site", "Value": "RCDN"}]}]

Authors

  • Ron Gershburg (@rgershbu)