cisco.mso.ndo_set_rule_policy module – Manage Tenant Set Rule Policies on Cisco Nexus Dashboard Orchestrator (NDO).

Note

This module is part of the cisco.mso collection (version 2.12.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.mso. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: cisco.mso.ndo_set_rule_policy.

New in cisco.mso 2.12.0

Synopsis

  • Manage Tenant Set Rule Policies on Cisco Nexus Dashboard Orchestrator (NDO).

  • This module is only supported on ND v4.1 (NDO v5.1) and later.

Requirements

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

  • Multi Site Orchestrator v2.1 or newer

Parameters

Parameter

Comments

description

string

The description of the Set Rule Policy.

host

aliases: hostname

string

IP Address or hostname of the ACI Multi Site Orchestrator host.

If the value is not specified in the task, the value of environment variable MSO_HOST will be used instead.

login_domain

string

The login domain name to use for authentication.

The default value is Local.

If the value is not specified in the task, the value of environment variable MSO_LOGIN_DOMAIN will be used instead.

When using a HTTPAPI connection plugin the inventory variable ansible_httpapi_login_domain will be used if this attribute is not specified.

name

aliases: set_rule_policy

string

The name of the Set Rule Policy.

output_level

string

Influence the output of this MSO module.

normal means the standard output, incl. current dict

info adds informational output, incl. previous, proposed and sent dicts

debug adds debugging output, incl. filter_string, method, response, status and url information

If the value is not specified in the task, the value of environment variable MSO_OUTPUT_LEVEL will be used instead.

Choices:

  • "debug"

  • "info"

  • "normal" ← (default)

password

string

The password to use for authentication.

If the value is not specified in the task, the value of environment variables MSO_PASSWORD or ANSIBLE_NET_PASSWORD will be used instead.

port

integer

Port number to be used for the REST connection.

The default value depends on parameter `use_ssl`.

If the value is not specified in the task, the value of environment variable MSO_PORT will be used instead.

set_additional_community

aliases: set_add_communities

list / elements=string

The append list of communities to configure in the Set Rule Policy.

Providing an empty list will remove the set_additional_community=[] from the Set Rule Policy.

set_as_path

dictionary

The Autonomous System (AS) path rules to add to the Set Rule Policy.

Providing an empty dictionary will remove the set_as_path={} rules from the Set Rule Policy.

last_asn_count

integer

The prepend last AS count.

The value must be between 1 and 10.

path_asn_list

list / elements=dictionary

The list of path AS numbers to prepend.

Providing an empty list will remove the set_as_path.path_asn_list=[].

asn

integer / required

The AS number.

The value must be between 1 and 10.

order

integer / required

The order of the AS number.

The value must be between 0 and 31.

set_community

dictionary

The community rule to add to the Set Rule Policy.

Providing an empty dictionary will remove the set_community={} rule from the Set Rule Policy.

community

string

The community value.

criteria

string

The criteria to be applied to the community value.

Choices:

  • "none"

  • "replace"

  • "append"

set_dampening

dictionary

The dampening rule to add to the Set Rule Policy.

Providing an empty dictionary will remove the set_dampening={} rule from the Set Rule Policy.

half_life

integer

The half life time in minutes.

The value must be between 1 and 60.

max_suppress_time

integer

The maximum suppress time in minutes.

The value must be between 1 and 255.

reuse_limit

integer

The re-use limit.

The value must be between 1 and 20000.

suppress_limit

integer

The suppress limit.

The value must be between 1 and 20000.

set_metric

string

The metric rule to add to the Set Rule Policy.

The value must be between 0 and 999999999.

Providing an empty string will remove the set_metric="" rule from the Set Rule Policy.

set_metric_type

string

The type of metric rule to add to the Set Rule Policy.

Providing an empty string will remove the set_metric_type="" from the Set Rule Policy.

Choices:

  • "ospf_type1"

  • "ospf_type2"

  • "type1"

  • "type2"

  • ""

set_multi_path

boolean

The multipath option to add to the Set Rule Policy.

Providing a value of false will remove multipath from the Set Rule Policy.

Enabling multipath requires set_next_hop_propagate=true to be enabled.

Choices:

  • false

  • true

set_next_hop

string

The next hop rule to add to the Set Rule Policy.

The value must be a valid IPv4 or IPv6 address.

Providing an empty string will remove the set_next_hop="" rule from the Set Rule Policy.

set_next_hop_propagate

boolean

The next hop propagation value to add to the Set Rule Policy.

Providing a value of false will remove next hop propagation from the Set Rule Policy.

set_next_hop_propagate cannot be enabled with set_route_tag configured.

Choices:

  • false

  • true

set_preference

string

The preference rule to add to the Set Rule Policy.

The value must be between 0 and 999999999.

Providing an empty string will remove the set_preference="" rule from the Set Rule Policy.

set_route_tag

string

The route tag rule to add to the Set Rule Policy.

The value must be a number between 0 and 999999999.

Providing an empty string will remove the set_route_tag="" rule from the Set Rule Policy.

set_weight

string

The weight rule to add to the Set Rule Policy.

The value must be a number between 0 and 9999.

Providing an empty string will remove the set_weight="" rule from the Set Rule Policy.

state

string

Determines the desired state of the resource.

Use absent to remove the resource.

Use query to list the resource.

Use present to create or update the resource.

Choices:

  • "absent"

  • "query" ← (default)

  • "present"

template

string

The name of the template.

The template must be a tenant template.

This parameter or template_id is required.

template_id

string

The ID of the tenant template.

This parameter or template is required.

timeout

integer

The socket level timeout in seconds.

The default value is 30 seconds.

If the value is not specified in the task, the value of environment variable MSO_TIMEOUT will be used instead.

use_proxy

boolean

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

If the value is not specified in the task, the value of environment variable MSO_USE_PROXY will be used instead.

The default is true.

Choices:

  • false

  • true

use_ssl

boolean

If false, an HTTP connection will be used instead of the default HTTPS connection.

If the value is not specified in the task, the value of environment variable MSO_USE_SSL will be used instead.

When using a HTTPAPI connection plugin the inventory variable ansible_httpapi_use_ssl will be used if this attribute is not specified.

The default is false when using a HTTPAPI connection plugin (mso or nd) and true when using the legacy connection method (only for mso).

Choices:

  • false

  • true

username

string

The username to use for authentication.

If the value is not specified in the task, the value of environment variables MSO_USERNAME or ANSIBLE_NET_USERNAME will be used instead.

uuid

aliases: set_rule_policy_uuid

string

The UUID of the Set Rule Policy.

This parameter is required when the name attribute needs to be updated.

validate_certs

boolean

If false, SSL certificates will not be validated.

This should only set to false when used on personally controlled sites using self-signed certificates.

If the value is not specified in the task, the value of environment variable MSO_VALIDATE_CERTS will be used instead.

The default is true.

Choices:

  • false

  • true

Notes

Note

  • The template must exist before using this module in your playbook. Use cisco.mso.ndo_template to create the Tenant template.

  • This module was written to support Multi Site Orchestrator v2.1 or newer. Some or all functionality may not work on earlier versions.

See Also

See also

cisco.mso.ndo_template

Manage Templates on Cisco Nexus Dashboard Orchestrator (NDO).

Examples

- name: Create a new Set Rule Policy
  cisco.mso.ndo_set_rule_policy:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    template: tenant_template
    name: set_rule_policy_1
    description: Ansible Set Rule Policy
    set_community:
      community: no-export
      criteria: replace
    set_additional_community:
      - no-advertise
      - extended:color:35
    set_route_tag: 500
    set_dampening:
      half_life: 15
      reuse_limit: 750
      suppress_limit: 2000
      max_suppress_time: 60
    set_weight: 50
    set_next_hop: 'aa::'
    set_preference: 200
    set_metric: 100
    set_metric_type: type2
    set_as_path:
      last_asn_count: 10
      path_asn_list:
        - order: 11
          asn: 1
        - order: 10
          asn: 2
    state: present
  register: create_set_rule_policy_1

- name: Update the name of the Set Rule Policy using UUID
  cisco.mso.ndo_set_rule_policy:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    template_id: "{{ create_tenant.current.templateId }}"
    uuid: "{{ create_set_rule_policy_1.current.uuid }}"
    name: set_rule_policy_1_updated
    state: present
  register: update_set_rule_policy_1

- name: Query an existing Set Rule Policy using UUID
  cisco.mso.ndo_set_rule_policy:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    template: tenant_template
    uuid: "{{ create_set_rule_policy_1.current.uuid }}"
    state: query
  register: query_with_uuid

- name: Query an existing Set Rule Policy using name
  cisco.mso.ndo_set_rule_policy:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    template: tenant_template
    name: set_rule_policy_1_updated
    state: query
  register: query_with_name

- name: Query all Set Rule Policies
  cisco.mso.ndo_set_rule_policy:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    template: tenant_template
    state: query
  register: query_all

- name: Remove set rules from a Set Rule Policy
  cisco.mso.ndo_set_rule_policy:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    template: tenant_template
    name: set_rule_policy_1_updated
    set_additional_community: []
    set_community: {}
    set_route_tag: ''
    set_propagate_next_hop: false
    state: present

- name: Delete an existing Set Rule Policy using UUID
  cisco.mso.ndo_set_rule_policy:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    template: tenant_template
    uuid: "{{ create_set_rule_policy_1.current.uuid }}"
    state: absent

- name: Delete an existing Set Rule Policy using Name
  cisco.mso.ndo_set_rule_policy:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    template: tenant_template
    name: set_rule_policy_1_updated
    state: absent

Authors

  • Samita Bhattacharjee (@samiib)