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 voss_config module #47533

Merged
merged 2 commits into from
Nov 1, 2018
Merged

New voss_config module #47533

merged 2 commits into from
Nov 1, 2018

Conversation

LindsayHill
Copy link
Contributor

@LindsayHill LindsayHill commented Oct 23, 2018

SUMMARY

New module for managing configurations on Extreme Networks (née Avaya) VOSS-based devices (VSP).

ISSUE TYPE
  • New Module Pull Request
COMPONENT NAME

voss_config

ANSIBLE VERSION
(venv)Lindsays-MacBook:voss lhill$ ansible --version
ansible 2.8.0.dev0 (voss_config baa864a766) last updated 2018/10/23 12:37:04 (GMT -700)
  config file = None
  configured module search path = [u'/Users/lhill/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /Users/lhill/github/ansible/lib/ansible
  executable location = /Users/lhill/github/ansible/bin/ansible
  python version = 2.7.10 (default, Aug 17 2018, 17:41:52) [GCC 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.0.42)]
ADDITIONAL INFORMATION

VOSS uses a 'flat' configuration file, with no indentation. Instead it uses exit to identify the end of an interface-specific, or routing protocol-specific section, e.g.

interface GigabitEthernet 1/1
no shutdown
exit
interface GigabitEthernet 1/2
no shutdown
exit

This is similar to Dell OS 6, but with only a single level of sub-commands. This module identifies the beginning & end of such sections, and maps to 'parents' and 'children' in the ConfigLine object.

There is an additional complexity element in that it may repeat the same "interface XX" or "router XXX" top-level command. Typically this is used to separate out IPv6 configuration options, e.g.:

router ospf
timers basic holddown 45
area 0.0.0.1
exit
router ospf
ipv6 router-id  6.6.6.6
ipv6 area  0.0.0.6
exit

This module internally treats those as a combined object under the same parent.

Example playbook:

(venv)Lindsays-MacBook:playbooks lhill$ cat voss_config_lines.yaml
---
- hosts: vsp200
  gather_facts: no

  tasks:
    - name: Description on 1/2
      voss_config:
        lines:
          - name "ServerB"
        parents: interface GigabitEthernet 1/2
        save_when: changed

Example first run:

(venv)Lindsays-MacBook:playbooks lhill$ ansible-playbook -v voss_config_lines.yaml
Using /Users/lhill/github/ansible-extreme/playbooks/ansible.cfg as config file
/Users/lhill/github/ansible-extreme/playbooks/hosts did not meet host_list requirements, check plugin documentation if this is unexpected
/Users/lhill/github/ansible-extreme/playbooks/hosts did not meet script requirements, check plugin documentation if this is unexpected

PLAY [vsp200] *******************************************************************************************************************

TASK [Description on 1/2] *******************************************************************************************************
changed: [vsp200] => {"changed": true, "commands": ["interface GigabitEthernet 1/2", "name \"ServerB\""], "updates": ["interface GigabitEthernet 1/2", "name \"ServerB\""]}

PLAY RECAP **********************************************************************************************************************
vsp200                     : ok=1    changed=1    unreachable=0    failed=0    skipped=0

(venv)Lindsays-MacBook:playbooks lhill$

Example second run (no change needed):

(venv)Lindsays-MacBook:playbooks lhill$ ansible-playbook -v voss_config_lines.yaml
Using /Users/lhill/github/ansible-extreme/playbooks/ansible.cfg as config file
/Users/lhill/github/ansible-extreme/playbooks/hosts did not meet host_list requirements, check plugin documentation if this is unexpected
/Users/lhill/github/ansible-extreme/playbooks/hosts did not meet script requirements, check plugin documentation if this is unexpected

PLAY [vsp200] *******************************************************************************************************************

TASK [Description on 1/2] *******************************************************************************************************
ok: [vsp200] => {"changed": false}

PLAY RECAP **********************************************************************************************************************
vsp200                     : ok=1    changed=0    unreachable=0    failed=0    skipped=0

(venv)Lindsays-MacBook:playbooks lhill$

@ansibot
Copy link
Contributor

ansibot commented Oct 23, 2018

Hi @LindsayHill, thank you for submitting this pull-request!

click here for bot help

@ansibot
Copy link
Contributor

ansibot commented Oct 23, 2018

@ansibot ansibot added affects_2.8 This issue/PR affects Ansible v2.8 core_review In order to be merged, this PR must follow the core 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. support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team. test This PR relates to tests. labels Oct 23, 2018
@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed core_review In order to be merged, this PR must follow the core review workflow. labels Oct 23, 2018
@LindsayHill
Copy link
Contributor Author

LindsayHill commented Oct 23, 2018

Looks like #46996 changed import statements for tests. Updated.

@LindsayHill
Copy link
Contributor Author

CI is failing due to unrelated transient failures for some systems (e.g. yum repo metadata download failures). Will close/re-open to re-trigger CI

@LindsayHill LindsayHill reopened this Oct 23, 2018
@LindsayHill
Copy link
Contributor Author

CI failures are due to unrelated things - e.g. upstream issues. Will try re-running CI tomorrow.

@bigmstone
Copy link
Contributor

Hopefully CI will get cleaned up quickly.

@bigmstone
Copy link
Contributor

shipit

@ansibot ansibot removed the needs_triage Needs a first human triage before being processed. label Oct 24, 2018
@LindsayHill
Copy link
Contributor Author

Made a small docstring change to the parents: section. Has triggered another CI run

@LindsayHill LindsayHill reopened this Oct 24, 2018
@LindsayHill
Copy link
Contributor Author

Well, we're at "UNSTABLE" now. Guess that's an improvement. Needs this resolved: #47582

@LindsayHill LindsayHill reopened this Oct 25, 2018
@LindsayHill
Copy link
Contributor Author

Still more random unrelated CI failures. At least the MySQL issues seem to be resolved now

@LindsayHill
Copy link
Contributor Author

Still a few random failures due to unrelated upstream things. Will trigger rebuild next week.

@LindsayHill LindsayHill reopened this Oct 30, 2018
@ansibot ansibot added core_review In order to be merged, this PR must follow the core review workflow. and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Oct 30, 2018
@justjais justjais self-requested a review October 31, 2018 16:33
@ganeshrn
Copy link
Member

ganeshrn commented Nov 1, 2018

@LindsayHill @bigmstone Thank you!

@ganeshrn ganeshrn merged commit a1b0d20 into ansible:devel Nov 1, 2018
Tomorrow9 pushed a commit to Tomorrow9/ansible that referenced this pull request Dec 4, 2018
* New voss_config module

* Updated test import paths as per ansible#46996
@ansible ansible locked and limited conversation to collaborators Jul 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.8 This issue/PR affects Ansible v2.8 core_review In order to be merged, this PR must follow the core review workflow. module This issue/PR relates to a module. networking Network category new_module This PR includes a new module. new_plugin This PR includes a new plugin. support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team. test This PR relates to tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants