nclu - Configure network interfaces using NCLU
New in version 2.3.
Synopsis
- Interface to the Network Command Line Utility, developed to make it easier to configure operating systems running ifupdown2 and Quagga, such as Cumulus Linux. Command documentation is available at https://docs.cumulusnetworks.com/display/DOCS/Network+Command+Line+Utility
Parameters
Parameter | Choices/Defaults | Comments |
---|---|---|
abort | Default: "no" | Boolean. When true, perform a 'net abort' before the block. This cleans out any uncommitted changes in the buffer. Mutually exclusive with atomic. |
atomic | Default: "no" | When true, equivalent to both commit and abort being true. Mutually exclusive with commit and atomic. |
commands | A list of strings containing the net commands to run. Mutually exclusive with template. | |
commit | Default: "no" | When true, performs a 'net commit' at the end of the block. Mutually exclusive with atomic. |
description | Default: "Ansible-originated commit" | Commit description that will be recorded to the commit log if commit or atomic are true. |
template | A single, multi-line string with jinja2 formatting. This string will be broken by lines, and each line will be run through net. Mutually exclusive with commands. |
Examples
- name: Add two interfaces without committing any changes nclu: commands: - add int swp1 - add int swp2 - name: Modify hostname to Cumulus-1 and commit the change nclu: commands: - add hostname Cumulus-1 commit: true - name: Add 48 interfaces and commit the change. nclu: template: | {% for iface in range(1,49) %} add int swp{{iface}} {% endfor %} commit: true description: "Ansible - add swps1-48" - name: Atomically add an interface nclu: commands: - add int swp1 atomic: true description: "Ansible - add swp1" - name: Configure BGP AS and add 2 EBGP neighbors using BGP Unnumbered nclu: commands: - add bgp autonomous-system 65000 - add bgp neighbor swp51 interface remote-as external - add bgp neighbor swp52 interface remote-as external commit: true
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key | Returned | Description |
---|---|---|
changed bool | changed | whether the interface was changed Sample: True |
msg string | always | human-readable report of success or failure Sample: interface bond0 config updated |
Status
This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.
Maintenance
This module is flagged as community which means that it is maintained by the Ansible Community. See Module Maintenance & Support for more info.
For a list of other modules that are also maintained by the Ansible Community, see here.
Author
- Cumulus Networks
Hint
If you notice any issues in this documentation you can edit this document to improve it.
© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.6/modules/nclu_module.html