community.general.cnos_system (0.1.1) — module

Manage the system attributes on Lenovo CNOS devices

Authors: Anil Kumar Muraleedharan (@amuraleedhar)

preview | supported by community

Install collection

Install with ansible-galaxy collection install community.general:==0.1.1


Add to requirements.yml

  collections:
    - name: community.general
      version: 0.1.1

Description

This module provides declarative management of node system attributes on Lenovo CNOS devices. It provides an option to configure host system parameters or remove those parameters from the device active configuration.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: configure hostname and domain-name
  cnos_system:
    hostname: cnos01
    domain_name: test.example.com
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: remove configuration
  cnos_system:
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: configure name servers
  cnos_system:
    name_servers:
      - 8.8.8.8
      - 8.8.4.4
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: configure DNS Lookup sources
  cnos_system:
    lookup_source: MgmtEth0/0/CPU0/0
    lookup_enabled: yes
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: configure name servers with VRF support
  nxos_system:
    name_servers:
      - { server: 8.8.8.8, vrf: mgmt }
      - { server: 8.8.4.4, vrf: mgmt }

Inputs

    
state:
    choices:
    - present
    - absent
    default: present
    description:
    - State of the configuration values in the device's current active configuration.  When
      set to I(present), the values should be configured in the device active configuration
      and when set to I(absent) the values should not be in the device active configuration

hostname:
    description:
    - Configure the device hostname parameter. This option takes an ASCII string value
      or keyword 'default'

domain_name:
    description:
    - Configures the default domain name suffix to be used when referencing this node
      by its FQDN.  This argument accepts either a list of domain names or a list of dicts
      that configure the domain name and VRF name or keyword 'default'. See examples.

name_servers:
    description:
    - List of DNS name servers by IP address to use to perform name resolution lookups.  This
      argument accepts either a list of DNS servers or a list of hashes that configure
      the name server and VRF name or keyword 'default'. See examples.

domain_search:
    description:
    - Configures a list of domain name suffixes to search when performing DNS name resolution.
      This argument accepts either a list of domain names or a list of dicts that configure
      the domain name and VRF name or keyword 'default'. See examples.

lookup_source:
    description:
    - Provides one or more source interfaces to use for performing DNS lookups. The interface
      must be a valid interface configured. on the device.

lookup_enabled:
    description:
    - Administrative control for enabling or disabling DNS lookups. When this argument
      is set to True, lookups are performed and when it is set to False, lookups are not
      performed.
    type: bool

Outputs

commands:
  description: The list of configuration mode commands to send to the device
  returned: always
  sample:
  - hostname cnos01
  - ip domain-name test.example.com vrf default
  type: list