-
Notifications
You must be signed in to change notification settings - Fork 23.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Networking Module: NCLU #21101
New Networking Module: NCLU #21101
Conversation
As a maintainer of a module in the same namespace this new module has been submitted to, your vote counts for shipits. Please review this module and add |
ready_for_review |
DOCUMENTATION = ''' | ||
--- | ||
module: nclu | ||
version_added: "2.2.3" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
version_added: "2.3"
- 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To get a URL use the following:
U(https://docs.cumulusnetworks.com/display/DOCS/Network+Command+Line+Utility)
See http://docs.ansible.com/ansible/dev_guide/developing_modules_documenting.html for details
EXAMPLES = ''' | ||
|
||
## Add two interfaces without committing any changes | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Examples should include a - name:
, see http://docs.ansible.com/ansible/dev_guide/developing_modules_documenting.html#examples-block for details.
- add int swp1 | ||
- add int swp2 | ||
|
||
## Add 48 interfaces and commit the change. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use - name:
rather than a comment
commit: true | ||
description: "Ansible - add swps1-48" | ||
|
||
## Atomically add an interface |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use - name:
rather than a comment
abort = dict(required=False, type='bool', default=False), | ||
commit = dict(required=False, type='bool', default=False), | ||
atomic = dict(required=False, type='bool', default=False)), | ||
mutually_exclusive=[('commands', 'template'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docs should state this
"Mutually exclusive options must be documented as the final sentence on each of the options."
http://docs.ansible.com/ansible/dev_guide/developing_modules_documenting.html#examples-block
return {"changed": _changed, "msg": output} | ||
|
||
# import module snippets | ||
from ansible.module_utils.basic import * |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only import what you need, rather than *
options: | ||
commands: | ||
description: | ||
- A list of strings containing the net commands to run. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mutually exclusive with I(template)
.
description: | ||
- 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'. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mutually exclusive with I(commands)
.
http://docs.ansible.com/ansible/dev_guide/developing_modules_documenting.html#formatting-options
module = AnsibleModule(argument_spec=dict( | ||
commands = dict(required=False, type='list'), | ||
template = dict(required=False, type='str'), | ||
description = dict(required=False, type='str', default="Ansible-originated commit"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Default needs adding to docs
Looks good thanks. I see in the Should I update that to be all the people listed in https://github.com/orgs/CumulusNetworks/people At the moment |
Adding everyone under @CumulusNetworks is probably not worth it. Set it to @isharacomix and @jrrivers - do you want us to pull request I'm not sure how to convince Ansibot who I belong to. :) |
Previously we were notifying a group (GitHub org) which worked, though Ansibot doesn't know is in that group, so we didn't get owner_pr, etc set. ansible/ansible#21101 (comment)
* network/cumulus/: notify individuals not the group Previously we were notifying a group (GitHub org) which worked, though Ansibot doesn't know is in that group, so we didn't get owner_pr, etc set. ansible/ansible#21101 (comment) * Update MAINTAINERS.txt
I've updated the bot so it knows who you are now ansible/ansibullbot#373 |
If in the future you wish to update the MAINTAINERS.txt list (as people join/leave) feel free to raise a PR to do so, like I did in ansible/ansibullbot#373 |
ISSUE TYPE
COMPONENT NAME
nclu
ANSIBLE VERSION
SUMMARY
This PR introduces an ansible module for NCLU, a new command-line interface for configuring networks on Cumulus Linux. This module is designed to be easier to use for individuals who are new to Cumulus Linux and/or network automation in general by exposing the NCLU interface in an automatable way.
https://docs.cumulusnetworks.com/display/DOCS/Network+Command+Line+Utility