cisco.nd.nd_service (0.5.0) — module

Manages Service Package on Nexus Dashboard.

| "added in version" 0.5.0 of cisco.nd"

Authors: Sabari Jaganathan (@sajagana)

preview | supported by community

Install collection

Install with ansible-galaxy collection install cisco.nd:==0.5.0


Add to requirements.yml

  collections:
    - name: cisco.nd
      version: 0.5.0

Description

Manages Service Package of the Nexus Dashboard.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Import a service package
  cisco.nd.nd_service:
    import_url: "https://nd_service.cisco.com/cisco-terraform-v0.1.16.aci"
    state: present
  register: import_result
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Query a service package with import_id
  cisco.nd.nd_service:
    import_id: "{{ import_result.current.metadata.id }}"
    state: query
  register: query_result_import_id
  until:
    - query_result_import_id.current is defined
    - query_result_import_id.current != {}
    - query_result_import_id.current.status.downloadPercentage == 100
  retries: 5
  delay: 5
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove a service package with import_id
  cisco.nd.nd_service:
    import_id: "{{ query_result_import_id.current.metadata.id }}"
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove a service package with import_url that has one match
  cisco.nd.nd_service:
    import_url: "http://nd_service.cisco.com/cisco-terraform-v0.1.15.aci"
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Query all service packages with import_url
  cisco.nd.nd_service:
    import_url: "https://nd_service.cisco.com/cisco-terraform-v0.1.16.aci"
    state: query
  register: query_reseult_import_url
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove all service packages with import_id when the query_result_import_url has more than one match
  cisco.nd.nd_service:
    import_id: "{{ item.metadata.id }}"
    state: absent
  loop: "{{ query_reseult_import_url.current }}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Query all imported service packages
  cisco.nd.nd_service:
    state: query
  register: query_results

Inputs

    
host:
    aliases:
    - hostname
    description:
    - IP Address or hostname of the Nexus Dashboard (ND) host.
    - If the value is not specified in the task, the value of environment variable C(ND_HOST)
      will be used instead.
    type: str

port:
    description:
    - 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 C(ND_PORT)
      will be used instead.
    type: int

state:
    choices:
    - present
    - query
    - absent
    default: present
    description:
    - Use C(present) for importing a Service Package. The C(present) state is not idempotent.
    - Use C(query) for listing all the Service Packages.
    - Use C(absent) for deleting a Service Package.
    type: str

timeout:
    default: 30
    description:
    - The socket level timeout in seconds.
    - If the value is not specified in the task, the value of environment variable C(ND_TIMEOUT)
      will be used instead.
    type: int

use_ssl:
    description:
    - If C(no), 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 C(ND_USE_SSL)
      will be used instead.
    type: bool

password:
    description:
    - The password to use for authentication.
    - If the value is not specified in the task, the value of environment variables C(ND_PASSWORD)
      or C(ANSIBLE_NET_PASSWORD) will be used instead.
    type: str

username:
    description:
    - The username to use for authentication.
    - If the value is not specified in the task, the value of environment variables C(ND_USERNAME)
      or C(ANSIBLE_NET_USERNAME) will be used instead.
    type: str

import_id:
    aliases:
    - id
    description:
    - The ID of the imported Service Package.
    type: str

use_proxy:
    description:
    - If C(no), 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 C(ND_USE_PROXY)
      will be used instead.
    type: bool

import_url:
    aliases:
    - url
    description:
    - The remote location of the Service Package.
    type: str

login_domain:
    description:
    - The login domain name to use for authentication.
    - The default value is DefaultAuth.
    - If the value is not specified in the task, the value of environment variable C(ND_LOGIN_DOMAIN)
      will be used instead.
    type: str

output_level:
    choices:
    - debug
    - info
    - normal
    default: normal
    description:
    - Influence the output of this ND module.
    - C(normal) means the standard output, incl. C(current) dict
    - C(info) adds informational output, incl. C(previous), C(proposed) and C(sent) dicts
    - C(debug) adds debugging output, incl. C(filter_string), C(method), C(response),
      C(status) and C(url) information
    - If the value is not specified in the task, the value of environment variable C(ND_OUTPUT_LEVEL)
      will be used instead.
    type: str

validate_certs:
    description:
    - If C(no), SSL certificates will not be validated.
    - This should only set to C(no) when used on personally controlled sites using self-signed
      certificates.
    - If the value is not specified in the task, the value of environment variable C(ND_VALIDATE_CERTS)
      will be used instead.
    type: bool