Skip to content
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

Merged
merged 9 commits into from
Feb 21, 2017
Merged

New Networking Module: NCLU #21101

merged 9 commits into from
Feb 21, 2017

Conversation

isharacomix
Copy link
Contributor

ISSUE TYPE
  • New Module Pull Request
COMPONENT NAME

nclu

ANSIBLE VERSION
ansible 2.2.1.0
  config file = /home/cumulus/cldemo-nclu-ansible/ansible.cfg
  configured module search path = ['/usr/share/ansible']
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


@ansibot
Copy link
Contributor

ansibot commented Feb 7, 2017

@CumulusNetworks

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 shipit if you would like to see it merged.

click here for bot help

@ansibot ansibot added affects_2.3 This issue/PR affects Ansible v2.3 community_review In order to be merged, this PR must follow the community review workflow. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. networking Network category new_module This PR includes a new module. new_plugin This PR includes a new plugin. test_pull_requests labels Feb 7, 2017
@isharacomix
Copy link
Contributor Author

ready_for_review

@abadger abadger removed the needs_triage Needs a first human triage before being processed. label Feb 8, 2017
DOCUMENTATION = '''
---
module: nclu
version_added: "2.2.3"
Copy link
Contributor

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
Copy link
Contributor

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- add int swp1
- add int swp2

## Add 48 interfaces and commit the change.
Copy link
Contributor

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
Copy link
Contributor

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'),
Copy link
Contributor

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 *
Copy link
Contributor

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.
Copy link
Contributor

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'.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"),
Copy link
Contributor

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

@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed community_review In order to be merged, this PR must follow the community review workflow. labels Feb 13, 2017
@gundalow
Copy link
Contributor

Looks good thanks.

I see in the MAINTAINER.txt file we have network/cumulus/: CumulusNetworks

Should I update that to be all the people listed in https://github.com/orgs/CumulusNetworks/people

At the moment Ansibot doesn't know that you are part of CumulusNetworks?

@isharacomix
Copy link
Contributor Author

isharacomix commented Feb 15, 2017

Adding everyone under @CumulusNetworks is probably not worth it. Set it to @isharacomix and @jrrivers - do you want us to pull request MAINTAINER.txt ourselves going forward?

I'm not sure how to convince Ansibot who I belong to. :)

gundalow added a commit to ansible/ansibullbot that referenced this pull request Feb 15, 2017
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)
gundalow added a commit to ansible/ansibullbot that referenced this pull request Feb 15, 2017
* 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
@gundalow
Copy link
Contributor

I've updated the bot so it knows who you are now ansible/ansibullbot#373

@gundalow
Copy link
Contributor

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

@privateip privateip merged commit d1efc8e into ansible:devel Feb 21, 2017
@ansible ansible locked and limited conversation to collaborators Apr 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.3 This issue/PR affects Ansible v2.3 module This issue/PR relates to a module. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. networking Network category new_module This PR includes a new module. new_plugin This PR includes a new plugin.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants