cisco.mso.mso_schema_site_contract_service_graph_listener module – Manage the listener for Azure site contract service graph in schema sites

Note

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

Synopsis

  • Manage the listener for Azure site contract service graph in schema sites on Cisco ACI Multi-Site.

  • This module is only compatible with NDO versions 3.7 and 4.2+. NDO versions 4.0 and 4.1 are not supported.

Requirements

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

  • Multi Site Orchestrator v2.1 or newer

Parameters

Parameter

Comments

contract

string / required

The name of the contract.

device

aliases: device_name

string

The name of the device.

frontend_ip

string

The frontend ip of the listener. Only supported for Network load balancers.

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.

listener

aliases: name, listener_name

string

The name of the listener.

listener_port

integer

The port of the listener.

listener_protocol

string

The protocol of the listener.

Choices:

  • "http"

  • "https"

  • "tcp"

  • "udp"

  • "tls"

  • "inherit"

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.

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.

rules

list / elements=dictionary

The rules of the listener.

action

string

The action of the rule.

action_type

string / required

The action type of the rule.

Choices:

  • "fixed_response"

  • "forward"

  • "redirect"

  • "ha_port"

content_type

string

The content type of the rule.

Choices:

  • "text_plain"

  • "text_css"

  • "text_html"

  • "app_js"

  • "app_json"

custom_url

string

The custom url of the rule.

floating_ip

string

The floating ip of the rule.

health_check

dictionary

The health check of the rule.

host

string

The host of the health check. The host attribute will be enabled when the use_host_from_rule is false.

interval

integer

The interval of the health check.

path

string

The path of the health check.

port

integer

The port of the health check.

protocol

string

The protocol of the health check.

Choices:

  • "http"

  • "https"

  • "tcp"

  • "udp"

  • "tls"

  • "inherit"

success_code

string

The success code of the health check.

timeout

integer

The timeout of the health check.

unhealthy_threshold

integer

The unhealthy threshold of the health check.

use_host_from_rule

boolean

The use host from rule of the health check.

Choices:

  • false

  • true

host

string

The host of the rule.

name

string / required

The name of the rule.

path

string

The path of the rule.

port

integer

The port of the rule.

priority

integer / required

The priority of the rule.

protocol

string

The protocol of the rule.

Choices:

  • "http"

  • "https"

  • "tcp"

  • "udp"

  • "tls"

  • "inherit"

provider_epg

dictionary

The provider epg of the rule.

anp_name

aliases: anp

string / required

The application profile name of the provider epg reference.

epg_name

aliases: epg

string / required

The epg (Endpoint Group) name of the provider epg reference.

schema

string

The schema name of the provider epg reference.

template

string

The template name of the provider epg reference.

redirect_code

string

The redirect code of the rule.

Choices:

  • "unknown"

  • "permanently_moved"

  • "found"

  • "see_other"

  • "temporary_redirect"

redirect_host_name

string

The redirect host name of the rule.

redirect_path

string

The redirect path of the rule.

redirect_port

integer

The redirect port of the rule.

redirect_protocol

string

The redirect protocol of the rule.

Choices:

  • "http"

  • "https"

  • "tcp"

  • "udp"

  • "tls"

  • "inherit"

redirect_query

string

The redirect query of the rule.

response_body

string

The response body of the rule.

response_code

string

The response code of the rule.

target_ip_type

string

The target ip type of the rule.

Choices:

  • "unspecified"

  • "primary"

  • "secondary"

url_type

string

The url type of the rule.

Choices:

  • "original"

  • "custom"

schema

string / required

The name of the schema.

security_policy

string

The security policy of the listener.

Choices:

  • "default"

  • "elb_sec_2016_18"

  • "elb_sec_fs_2018_06"

  • "elb_sec_tls_1_2_2017_01"

  • "elb_sec_tls_1_2_ext_2018_06"

  • "elb_sec_tls_1_1_2017_01"

  • "elb_sec_2015_05"

  • "elb_sec_tls_1_0_2015_04"

  • "app_gw_ssl_default"

  • "app_gw_ssl_2015_501"

  • "app_gw_ssl_2017_401"

  • "app_gw_ssl_2017_401s"

service_node_index

integer

The index of the service node in the site contract service graph. The value starts from 0.

site

string / required

The name of the site.

ssl_certificates

list / elements=dictionary

The ssl certificates of the listener.

certificate_store

string / required

The certificate store of the ssl certificate.

Choices:

  • "default"

  • "iam"

  • "acm"

name

string / required

The name of the ssl certificate.

state

string

Use present or absent for adding or removing.

Use query for listing an object or multiple objects.

Choices:

  • "absent"

  • "present" ← (default)

  • "query"

template

string / required

The name of the template.

tenant

string

The name of the tenant.

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.

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

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

Manage the service graph association with a contract in schema template.

Examples

- name: Add a listener for Network Load-Balancer
  cisco.mso.mso_schema_site_contract_service_graph_listener:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    contract: "Contract2"
    schema: mso_schema
    template: ansible_template1
    site: mso_site
    service_node_index: 0
    listener: nlb_li_tcp
    listener_port: 80
    listener_protocol: tcp
    tenant: mso_tenant
    frontend_ip: "10.10.10.10"
    device: ans_test_nlb
    security_policy: default
    rules:
      - name: rule1
        priority: 1
        action_type: forward
        port: 80
        protocol: tcp
        health_check:
          port: 80
          protocol: tcp
          interval: 5
          unhealthy_threshold: 2
          success_code: 200-399

- name: Add a listener for Application Load-Balancer
  cisco.mso.mso_schema_site_contract_service_graph_listener:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    contract: "Contract2"
    schema: mso_schema
    template: ansible_template1
    site: mso_site
    service_node_index: 1
    listener: aplb_li_https
    tenant: mso_tenant
    device: ans_test_aplb
    listener_port: 443
    listener_protocol: https
    security_policy: default
    ssl_certificates:
      - name: ans_test_keyring
        certificate_store: default
    rules:
      - name: rule1
        priority: 1
        action_type: forward
        port: 80
        protocol: http
        provider_epg:
          anp_name: AP1
          epg_name: EPG1
        health_check:
          port: 80
          protocol: http
          path: "health_check_path"
          interval: 30
          timeout: 30
          unhealthy_threshold: 3
          use_host_from_rule: true
          success_code: "200"
        target_ip_type: unspecified

- name: Query all listeners
  cisco.mso.mso_schema_site_contract_service_graph_listener:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    contract: "Contract2"
    schema: mso_schema
    template: ansible_template1
    site: mso_site
    state: query
  register: query_all_listeners

- name: Query all listeners with name ans_li_common
  cisco.mso.mso_schema_site_contract_service_graph_listener:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    contract: "Contract2"
    schema: mso_schema
    template: ansible_template1
    site: mso_site
    listener: ans_li_common
    state: query
  register: query_all_ans_li_common

- name: Query a listener with name - aplb_li_https
  cisco.mso.mso_schema_site_contract_service_graph_listener:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    contract: "Contract2"
    schema: mso_schema
    template: ansible_template1
    site: mso_site
    service_node_index: 1
    listener: aplb_li_https
    state: query
  register: query_aplb_li_https

- name: Remove an existing listener - ans_li_common
  cisco.mso.mso_schema_site_contract_service_graph_listener:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    contract: "Contract2"
    schema: mso_schema
    template: ansible_template1
    site: mso_site
    service_node_index: 1
    listener: aplb_li_https
    state: absent

Authors

  • Sabari Jaganathan (@sajagana)