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

adding support for loopback interface #36141

Merged
merged 4 commits into from Feb 14, 2018
Merged

adding support for loopback interface #36141

merged 4 commits into from Feb 14, 2018

Conversation

IPvSean
Copy link
Contributor

@IPvSean IPvSean commented Feb 13, 2018

SUMMARY

currently the loopback interface lo is not supported with vyos_l3_interface, this commit fixes that. Right now there is a limit of loopback interfaces to just lo, if you want more interfaces you need to use a dummy interface https://wiki.vyos.net/wiki/Dummy_interfaces

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

vyos_l3_interface

ANSIBLE VERSION
[vagrant@ansible test]$ ansible --version
ansible 2.6.0
  config file = /home/vagrant/.ansible.cfg
  configured module search path = [u'/home/vagrant/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.5 (default, Aug  4 2017, 00:39:18) [GCC 4.8.5 20150623 (Red Hat 4.8.5-16)]
ADDITIONAL INFORMATION

The following playbook will now work with loopback interface

---
- hosts: network
  connection: network_cli
  vars:
    interface_data:
      spine01:
          - { name: lo, ipv4: 10.0.0.1/32 }
          - { name: eth2, ipv4: 192.168.11.1/30 }
          - { name: eth3, ipv4: 192.168.12.1/30 }
      spine02:
          - { name: lo, ipv4: 10.0.0.2/32 }
          - { name: eth2, ipv4: 192.168.21.1/30 }
          - { name: eth3, ipv4: 192.168.22.1/30 }
      leaf01:
          - { name: lo, ipv4: 10.0.0.11/32 }
          - { name: eth6, ipv4: 192.168.11.2/30 }
          - { name: eth7, ipv4: 192.168.21.2/30 }
      leaf02:
          - { name: lo, ipv4: 10.0.0.12/32 }
          - { name: eth6, ipv4: 192.168.12.2/30 }
          - { name: eth7, ipv4: 192.168.22.2/30 }
  tasks:
    - name: Set IP addresses on aggregate
      vyos_l3_interface:
        aggregate: "{{interface_data[inventory_hostname]}}"

currently the loopback interface lo is not supported with vyos_l3_interface, this commit fixes that.  Right now there is a limit of loopback interfaces to just lo, if you want more interfaces you need to use a dummy interface https://wiki.vyos.net/wiki/Dummy_interfaces
@ansibot
Copy link
Contributor

ansibot commented Feb 13, 2018

@ansibot ansibot added core_review In order to be merged, this PR must follow the core review workflow. feature_pull_request module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. networking Network category support:network This issue/PR relates to code supported by the Ansible Network Team. labels Feb 13, 2018
@ansibot
Copy link
Contributor

ansibot commented Feb 13, 2018

The test ansible-test sanity --test pep8 [explain] failed with 10 errors:

lib/ansible/modules/network/vyos/vyos_l3_interface.py:120:15: E111 indentation is not a multiple of four
lib/ansible/modules/network/vyos/vyos_l3_interface.py:122:15: E111 indentation is not a multiple of four
lib/ansible/modules/network/vyos/vyos_l3_interface.py:126:19: E111 indentation is not a multiple of four
lib/ansible/modules/network/vyos/vyos_l3_interface.py:128:19: E111 indentation is not a multiple of four
lib/ansible/modules/network/vyos/vyos_l3_interface.py:131:19: E111 indentation is not a multiple of four
lib/ansible/modules/network/vyos/vyos_l3_interface.py:133:19: E111 indentation is not a multiple of four
lib/ansible/modules/network/vyos/vyos_l3_interface.py:137:15: E111 indentation is not a multiple of four
lib/ansible/modules/network/vyos/vyos_l3_interface.py:140:15: E111 indentation is not a multiple of four
lib/ansible/modules/network/vyos/vyos_l3_interface.py:145:15: E111 indentation is not a multiple of four
lib/ansible/modules/network/vyos/vyos_l3_interface.py:148:15: E111 indentation is not a multiple of four

click here for bot help

@ansibot ansibot added ci_verified Changes made in this PR are causing tests to fail. 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 Feb 13, 2018
fixing issues for sanity test

lib/ansible/modules/network/vyos/vyos_l3_interface.py:120:15: E111 indentation is not a multiple of four
lib/ansible/modules/network/vyos/vyos_l3_interface.py:122:15: E111 indentation is not a multiple of four
lib/ansible/modules/network/vyos/vyos_l3_interface.py:126:19: E111 indentation is not a multiple of four
lib/ansible/modules/network/vyos/vyos_l3_interface.py:128:19: E111 indentation is not a multiple of four
lib/ansible/modules/network/vyos/vyos_l3_interface.py:131:19: E111 indentation is not a multiple of four
lib/ansible/modules/network/vyos/vyos_l3_interface.py:133:19: E111 indentation is not a multiple of four
lib/ansible/modules/network/vyos/vyos_l3_interface.py:137:15: E111 indentation is not a multiple of four
lib/ansible/modules/network/vyos/vyos_l3_interface.py:140:15: E111 indentation is not a multiple of four
lib/ansible/modules/network/vyos/vyos_l3_interface.py:145:15: E111 indentation is not a multiple of four
lib/ansible/modules/network/vyos/vyos_l3_interface.py:148:15: E111 indentation is not a multiple of four
@ansibot ansibot removed the ci_verified Changes made in this PR are causing tests to fail. label Feb 13, 2018
@ansibot
Copy link
Contributor

ansibot commented Feb 13, 2018

The test ansible-test sanity --test pylint [explain] failed with 1 error:

lib/ansible/modules/network/vyos/vyos_l3_interface.py:140:0: syntax-error unindent does not match any outer indentation level (<string>, line 140)

The test ansible-test sanity --test ansible-doc --python 3.5 [explain] failed with 1 error:

lib/ansible/modules/network/vyos/vyos_l3_interface.py:0:0: has a documentation error formatting or is missing documentation.

The test ansible-test sanity --test ansible-doc --python 2.6 [explain] failed with 1 error:

lib/ansible/modules/network/vyos/vyos_l3_interface.py:0:0: has a documentation error formatting or is missing documentation.

The test ansible-test sanity --test ansible-doc --python 2.7 [explain] failed with 1 error:

lib/ansible/modules/network/vyos/vyos_l3_interface.py:0:0: has a documentation error formatting or is missing documentation.

The test ansible-test sanity --test ansible-doc --python 3.7 [explain] failed with 1 error:

lib/ansible/modules/network/vyos/vyos_l3_interface.py:0:0: has a documentation error formatting or is missing documentation.

The test ansible-test sanity --test ansible-doc --python 3.6 [explain] failed with 1 error:

lib/ansible/modules/network/vyos/vyos_l3_interface.py:0:0: has a documentation error formatting or is missing documentation.

The test ansible-test sanity --test compile --python 2.6 [explain] failed with 1 error:

lib/ansible/modules/network/vyos/vyos_l3_interface.py:140:20: SyntaxError: else:

The test ansible-test sanity --test compile --python 3.5 [explain] failed with 1 error:

lib/ansible/modules/network/vyos/vyos_l3_interface.py:140:20: SyntaxError: else:

The test ansible-test sanity --test compile --python 2.7 [explain] failed with 1 error:

lib/ansible/modules/network/vyos/vyos_l3_interface.py:140:20: SyntaxError: else:

The test ansible-test sanity --test compile --python 3.6 [explain] failed with 1 error:

lib/ansible/modules/network/vyos/vyos_l3_interface.py:140:20: SyntaxError: else:

The test ansible-test sanity --test compile --python 3.7 [explain] failed with 1 error:

lib/ansible/modules/network/vyos/vyos_l3_interface.py:140:20: SyntaxError: else:

The test ansible-test sanity --test import --python 2.6 [explain] failed with 1 error:

lib/ansible/modules/network/vyos/vyos_l3_interface.py:140:20: IndentationError: unindent does not match any outer indentation level

The test ansible-test sanity --test import --python 2.7 [explain] failed with 1 error:

lib/ansible/modules/network/vyos/vyos_l3_interface.py:140:20: IndentationError: unindent does not match any outer indentation level

The test ansible-test sanity --test import --python 3.5 [explain] failed with 1 error:

lib/ansible/modules/network/vyos/vyos_l3_interface.py:140:20: IndentationError: unindent does not match any outer indentation level

The test ansible-test sanity --test import --python 3.6 [explain] failed with 1 error:

lib/ansible/modules/network/vyos/vyos_l3_interface.py:140:20: IndentationError: unindent does not match any outer indentation level

The test ansible-test sanity --test import --python 3.7 [explain] failed with 1 error:

lib/ansible/modules/network/vyos/vyos_l3_interface.py:140:20: IndentationError: unindent does not match any outer indentation level

The test ansible-test sanity --test pep8 [explain] failed with 2 errors:

lib/ansible/modules/network/vyos/vyos_l3_interface.py:139:33: E128 continuation line under-indented for visual indent
lib/ansible/modules/network/vyos/vyos_l3_interface.py:140:15: E901 IndentationError: unindent does not match any outer indentation level

The test ansible-test sanity --test validate-modules [explain] failed with 1 error:

lib/ansible/modules/network/vyos/vyos_l3_interface.py:0:0: E401 Python SyntaxError while parsing module

The test ansible-test sanity --test yamllint [explain] failed with 1 error:

lib/ansible/modules/network/vyos/vyos_l3_interface.py:140:20: python-syntax-error unindent does not match any outer indentation level (<unknown>, line 140)

click here for bot help

@ansibot ansibot added the ci_verified Changes made in this PR are causing tests to fail. label Feb 13, 2018
@ansibot ansibot removed the ci_verified Changes made in this PR are causing tests to fail. label Feb 13, 2018
@ansibot
Copy link
Contributor

ansibot commented Feb 13, 2018

The test ansible-test sanity --test pep8 [explain] failed with 4 errors:

lib/ansible/modules/network/vyos/vyos_l3_interface.py:139:33: E128 continuation line under-indented for visual indent
lib/ansible/modules/network/vyos/vyos_l3_interface.py:142:33: E128 continuation line under-indented for visual indent
lib/ansible/modules/network/vyos/vyos_l3_interface.py:147:33: E128 continuation line under-indented for visual indent
lib/ansible/modules/network/vyos/vyos_l3_interface.py:150:33: E128 continuation line under-indented for visual indent

click here for bot help

@ansibot ansibot added the ci_verified Changes made in this PR are causing tests to fail. label Feb 13, 2018
@ansibot ansibot added core_review In order to be merged, this PR must follow the core review workflow. and removed ci_verified Changes made in this PR are causing tests to fail. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Feb 13, 2018
@ganeshrn ganeshrn merged commit a52a7d2 into ansible:devel Feb 14, 2018
ganeshrn pushed a commit to ganeshrn/ansible that referenced this pull request Feb 14, 2018
* adding support for loopback interface

currently the loopback interface lo is not supported with vyos_l3_interface, this commit fixes that.  Right now there is a limit of loopback interfaces to just lo, if you want more interfaces you need to use a dummy interface https://wiki.vyos.net/wiki/Dummy_interfaces

* fixing spacing as per pep8 test

fixing issues for sanity test

lib/ansible/modules/network/vyos/vyos_l3_interface.py:120:15: E111 indentation is not a multiple of four
lib/ansible/modules/network/vyos/vyos_l3_interface.py:122:15: E111 indentation is not a multiple of four
lib/ansible/modules/network/vyos/vyos_l3_interface.py:126:19: E111 indentation is not a multiple of four
lib/ansible/modules/network/vyos/vyos_l3_interface.py:128:19: E111 indentation is not a multiple of four
lib/ansible/modules/network/vyos/vyos_l3_interface.py:131:19: E111 indentation is not a multiple of four
lib/ansible/modules/network/vyos/vyos_l3_interface.py:133:19: E111 indentation is not a multiple of four
lib/ansible/modules/network/vyos/vyos_l3_interface.py:137:15: E111 indentation is not a multiple of four
lib/ansible/modules/network/vyos/vyos_l3_interface.py:140:15: E111 indentation is not a multiple of four
lib/ansible/modules/network/vyos/vyos_l3_interface.py:145:15: E111 indentation is not a multiple of four
lib/ansible/modules/network/vyos/vyos_l3_interface.py:148:15: E111 indentation is not a multiple of four

* ugh, missed on spacing issue

* getting rid of continuation lines, the CI system does not like it

(cherry picked from commit a52a7d2)
ganeshrn added a commit that referenced this pull request Feb 14, 2018
* adding support for loopback interface

currently the loopback interface lo is not supported with vyos_l3_interface, this commit fixes that.  Right now there is a limit of loopback interfaces to just lo, if you want more interfaces you need to use a dummy interface https://wiki.vyos.net/wiki/Dummy_interfaces

* fixing spacing as per pep8 test

fixing issues for sanity test

* ugh, missed on spacing issue

* getting rid of continuation lines, the CI system does not like it

(cherry picked from commit a52a7d2)
@mkrizek mkrizek removed the needs_triage Needs a first human triage before being processed. label Feb 16, 2018
@ansibot ansibot added feature This issue/PR relates to a feature request. and removed feature_pull_request labels Mar 5, 2018
@ansible ansible locked and limited conversation to collaborators Apr 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
core_review In order to be merged, this PR must follow the core review workflow. feature This issue/PR relates to a feature request. module This issue/PR relates to a module. networking Network category support:network This issue/PR relates to code supported by the Ansible Network Team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants