cisco.mso.ndo_endpoint_ip_tag_policy module – Manage Endpoint IP Tag Policies on Cisco Nexus Dashboard Orchestrator (NDO).

Note

This module is part of the cisco.mso collection (version 2.13.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_endpoint_ip_tag_policy.

New in cisco.mso 2.13.0

Synopsis

  • Manage Endpoint IP Tag 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

annotations

list / elements=dictionary

The list of annotations.

Providing an empty list will remove the annotations from the parent object.

key

string

The annotation key.

value

string

The value associated with annotations.key.

endpoint_ip_address

aliases: ip

string

The endpoint IP address of the Endpoint IP Tag 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.

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.

policy_tags

aliases: tags

list / elements=dictionary

The list of Policy Tags.

Providing an empty list will remove the policy_tags from the parent object.

key

string

The Policy Tag key.

value

string

The value associated with policy_tags.key.

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.

state

string

Use absent for removing.

Use query for listing an object or multiple objects.

Use present for creating or updating.

Choices:

  • "absent"

  • "query" ← (default)

  • "present"

template

string

The name of the template.

The template must be a Tenant Policy template.

This parameter or template_id is required.

template_id

string

The ID of the template.

The template must be a Tenant Policy 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: enpoint_ip_tag_policy_uuid

string

The UUID of the Endpoint IP Tag Policy.

The UUID must be used when updating endpoint_ip_address or vrf.

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

vrf

dictionary

The VRF reference details.

reference

aliases: ref

dictionary

The reference details of the VRF.

This parameter can be used instead of vrf.uuid.

name

string / required

The name of the VRF.

schema

string

The name of the schema associated with the VRF.

This parameter can be used instead of vrf.reference.schema_id.

schema_id

string

The schema ID associated with the VRF.

This parameter can be used instead of vrf.reference.schema.

template

string

The name of the template associated with the VRF.

This parameter can be used instead of vrf.reference.template_id.

template_id

string

The template ID associated with the VRF.

This parameter can be used instead of vrf.reference.template.

uuid

string

The UUID of the VRF.

This parameter can be used instead of vrf.reference.

Notes

Note

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

  • The vrf must exist before using this module in your playbook. Use cisco.mso.mso_schema_template_vrf to create the VRF.

  • 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).

cisco.mso.mso_schema_template_vrf

Manage VRFs in schema templates.

Examples

- name: Create an Endpoint IP Tag Policy
  cisco.mso.ndo_endpoint_ip_tag_policy:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    template: ansible_tenant_policy_template
    endpoint_ip_address: 1.1.1.1
    vrf:
      reference:
        name: ansible_vrf
        template: ansible_tenant_template
        schema: ansible_schema
    annotations:
      - key: key_1
        value: value_1
      - key: key_2
        value: value_2
    policy_tags:
      - key: key_1
        value: value_1
      - key: key_2
        value: value_2
    state: present
  register: create_enpoint_ip_tag_policy

- name: Update an Endpoint IP Tag Policy using IP address and VRF
  cisco.mso.ndo_endpoint_ip_tag_policy:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    template: ansible_tenant_policy_template
    endpoint_ip_address: 1.1.1.1
    vrf:
      reference:
        name: ansible_vrf
        template: ansible_tenant_template
        schema: ansible_schema
    annotations:
      - key: key_1
        value: value_1
    policy_tags:
      - key: key_1
        value: value_1
      - key: key_2
        value: value_2
      - key: key_3
        value: value_3
    state: present

- name: Update an Endpoint IP Tag Policy using UUID
  cisco.mso.ndo_endpoint_ip_tag_policy:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    template: ansible_tenant_policy_template
    uuid: "{{ create_enpoint_ip_tag_policy.current.uuid }}"
    endpoint_ip_address: 2.2.2.2
    vrf:
      reference:
        name: ansible_vrf_2
        template: ansible_tenant_template
        schema: ansible_schema
    annotations:
      - key: key_1
        value: value_1
    policy_tags:
      - key: key_1
        value: value_1
      - key: key_2
        value: value_2
      - key: key_3
        value: value_3
    state: present

- name: Query an Endpoint IP Tag Policy using IP address and VRF
  cisco.mso.ndo_endpoint_ip_tag_policy:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    template: ansible_tenant_policy_template
    endpoint_ip_address: 2.2.2.2
    vrf:
      reference:
        name: ansible_vrf
        template: ansible_tenant_template
        schema: ansible_schema
    state: query
  register: query_with_ip_and_vrf

- name: Query an Endpoint IP Tag Policy using UUID
  cisco.mso.ndo_endpoint_ip_tag_policy:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    template: ansible_test
    uuid: "{{ create_enpoint_ip_tag_policy.current.uuid }}"
    state: query
  register: query_with_uuid

- name: Query all Endpoint IP Tag Policies in a template
  cisco.mso.ndo_endpoint_ip_tag_policy:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    template: ansible_tenant_policy_template
    state: query
  register: query_all_objects

- name: Delete an Endpoint IP Tag Policy using its IP address and VRF
  cisco.mso.ndo_endpoint_ip_tag_policy:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    template: ansible_tenant_policy_template
    endpoint_ip_address: 1.1.1.1
    vrf:
      reference:
        name: ansible_vrf
        template: ansible_tenant_template
        schema: ansible_schema
    state: absent

- name: Delete an Endpoint IP Tag Policy using UUID
  cisco.mso.ndo_endpoint_ip_tag_policy:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    template: ansible_tenant_policy_template
    uuid: "{{ create_enpoint_ip_tag_policy.current.uuid }}"
    state: absent

Authors

  • Gaspard Micol (@gmicol)