community.network.cnos_system – Manage the system attributes on Lenovo CNOS devices

Note

This plugin is part of the community.network collection (version 3.0.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 community.network.

To use it in a playbook, specify: community.network.cnos_system.

Synopsis

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

Parameters

Parameter Choices/Defaults Comments
domain_name
string
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.
domain_search
string
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.
hostname
string
Configure the device hostname parameter. This option takes an ASCII string value or keyword 'default'
lookup_enabled
boolean
    Choices:
  • no
  • yes
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.
lookup_source
string
Provides one or more source interfaces to use for performing DNS lookups. The interface must be a valid interface configured. on the device.
name_servers
string
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.
state
string
    Choices:
  • present
  • absent
State of the configuration values in the device's current active configuration. When set to present, the values should be configured in the device active configuration and when set to absent the values should not be in the device active configuration

Examples

- name: Configure hostname and domain-name
  community.network.cnos_system:
    hostname: cnos01
    domain_name: test.example.com

- name: Remove configuration
  community.network.cnos_system:
    state: absent

- name: Configure name servers
  community.network.cnos_system:
    name_servers:
      - 8.8.8.8
      - 8.8.4.4

- name: Configure DNS Lookup sources
  community.network.cnos_system:
    lookup_source: MgmtEth0/0/CPU0/0
    lookup_enabled: yes

- 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 }

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description
commands
list / elements=string
always
The list of configuration mode commands to send to the device

Sample:
['hostname cnos01', 'ip domain-name test.example.com vrf default']


Authors

  • Anil Kumar Muraleedharan (@amuraleedhar)

© 2012–2018 Michael DeHaan
© 2018–2021 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/community/network/cnos_system_module.html