Documentation

nclu - Configure network interfaces using NCLU

New in version 2.3.

Synopsis

Options

parameter required default choices comments
abort
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
no
When true, equivalent to both commit and abort being true. Mutually exclusive with commit and atomic.
commands
no
A list of strings containing the net commands to run. Mutually exclusive with template.
commit
no
When true, performs a 'net commit' at the end of the block. Mutually exclusive with atomic.
description
no Ansible-originated commit
Commit description that will be recorded to the commit log if commit or atomic are true.
template
no
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: 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"

Return Values

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

name description returned type sample
msg human-readable report of success or failure always string interface bond0 config updated
changed whether the interface was changed changed bool True


Status

This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.

Support

This module is community maintained without core committer oversight.

For more information on what this means please read Module Support

For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Helping Testing PRs and Developing Modules.