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

Add ip value to ansible_net_neighbors #748

Merged
merged 11 commits into from
Feb 20, 2023

Conversation

ollylawrence
Copy link
Contributor

SUMMARY

Adds a value ip to ansible_net_neighbors from ios.ios_facts this way you can use the ip value of a CDP neighbor in plays.

This all comes from needing to cycle though a class of devices on the network and then interact with them.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

ios.ios_facts

ADDITIONAL INFORMATION

Output of ansible_net_neighbors in main:

        "net_neighbors": {
            "FastEthernet1": [
                {
                    "host": "DC-TEST-RACK",
                    "platform": "cisco WS-C3750X-48",
                    "port": "GigabitEthernet1/0/1"
                }
            ],
            "GigabitEthernet1/3": [
                {
                    "host": "SEPBCC49351F8CC",
                    "platform": "Cisco IP Phone 8851",
                    "port": "Port 1"
                }
            ],
            "GigabitEthernet1/4": [
                {
                    "host": "SEPBCC49351FA5A",
                    "platform": "Cisco IP Phone 8851",
                    "port": "Port 1"
                }
            ],
            "GigabitEthernet1/48": [
                {
                    "host": "DC-TEST-RACK",
                    "platform": "cisco WS-C3750X-48",
                    "port": "GigabitEthernet1/0/42"
                }
            ],
            "GigabitEthernet2/47": [
                {
                    "host": "DC-TEST-RACK",
                    "platform": "cisco WS-C3750X-48",
                    "port": "GigabitEthernet1/0/41"
                }
            ],
            "GigabitEthernet5/48": [
                {
                    "host": "e0cbbc32dacb",
                    "platform": "Meraki MR33 Cloud Managed AP",
                    "port": "Port 0"
                }
            ]

Pull request:

        "net_neighbors": {
            "FastEthernet1": [
                {
                    "host": "DC-TEST-RACK",
                    "ip": "10.5.49.2",
                    "platform": "cisco WS-C3750X-48",
                    "port": "GigabitEthernet1/0/1"
                }
            ],
            "GigabitEthernet1/3": [
                {
                    "host": "SEPBCC49351F8CC",
                    "ip": "10.39.160.14",
                    "platform": "Cisco IP Phone 8851",
                    "port": "Port 1"
                }
            ],
            "GigabitEthernet1/4": [
                {
                    "host": "SEPBCC49351FA5A",
                    "ip": "10.39.160.13",
                    "platform": "Cisco IP Phone 8851",
                    "port": "Port 1"
                }
            ],
            "GigabitEthernet1/48": [
                {
                    "host": "DC-TEST-RACK",
                    "ip": "10.5.49.2",
                    "platform": "cisco WS-C3750X-48",
                    "port": "GigabitEthernet1/0/42"
                }
            ],
            "GigabitEthernet2/47": [
                {
                    "host": "DC-TEST-RACK",
                    "ip": "10.5.49.2",
                    "platform": "cisco WS-C3750X-48",
                    "port": "GigabitEthernet1/0/41"
                }
            ],
            "GigabitEthernet5/48": [
                {
                    "host": "e0cbbc32dacb",
                    "ip": "6.50.218.203",
                    "platform": "Meraki MR33 Cloud Managed AP",
                    "port": "Port 0"
                }
            ]

olly added 2 commits February 14, 2023 19:06
 so that ip addresses of cdp neighbours can be used in ansible
 so that ip addresses of cdp neighbours can be used in ansible
@softwarefactory-project-zuul
Copy link

Build failed.
https://ansible.softwarefactory-project.io/zuul/buildset/7c054286b16e4b9280bc761186de6ee9

ansible-galaxy-importer RETRY_LIMIT in 15s
✔️ build-ansible-collection SUCCESS in 9m 07s
ansible-ee-integration-ios-latest RETRY_LIMIT in 21m 25s (non-voting)
ansible-ee-integration-ios-stable-2.9 RETRY_LIMIT in 22m 44s (non-voting)
ansible-ee-integration-ios-stable-2.11 FAILURE in 30m 00s (non-voting)
ansible-ee-integration-ios-stable-2.12 FAILURE in 19m 14s (non-voting)
ansible-ee-integration-ios-libssh-latest FAILURE in 1h 00m 31s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.9 FAILURE in 56m 29s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.11 FAILURE in 59m 56s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.12 FAILURE in 1h 00m 20s (non-voting)
✔️ ansible-tox-linters SUCCESS in 11m 03s

@KB-perByte KB-perByte self-requested a review February 15, 2023 13:07
@KB-perByte
Copy link
Collaborator

Hey @ollylawrence would you please add a Unit test and a changelog to the PR, else it's LGTM!
Regards

@softwarefactory-project-zuul
Copy link

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/9c57c4dc36844a75b354da3b4ca5b1f7

✔️ ansible-galaxy-importer SUCCESS in 3m 27s
✔️ build-ansible-collection SUCCESS in 8m 37s
ansible-ee-integration-ios-latest FAILURE in 20m 50s (non-voting)
ansible-ee-integration-ios-stable-2.9 RETRY_LIMIT in 22m 39s (non-voting)
ansible-ee-integration-ios-stable-2.11 FAILURE in 24m 06s (non-voting)
ansible-ee-integration-ios-stable-2.12 FAILURE in 22m 35s (non-voting)
ansible-ee-integration-ios-libssh-latest FAILURE in 31m 57s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.9 FAILURE in 32m 16s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.11 FAILURE in 1h 28m 23s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.12 FAILURE in 32m 36s (non-voting)
✔️ ansible-tox-linters SUCCESS in 10m 16s

@ollylawrence
Copy link
Contributor Author

ollylawrence commented Feb 17, 2023

@KB-perByte Added unit test and change log, sorry should have known.

Unit test fine locally and the change log should follow convention I hope.

Cheers

@softwarefactory-project-zuul
Copy link

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/d7d9c2d33e284d0ca565de2b5df6ce25

✔️ ansible-galaxy-importer SUCCESS in 3m 24s
✔️ build-ansible-collection SUCCESS in 8m 48s
ansible-ee-integration-ios-latest FAILURE in 15m 39s (non-voting)
ansible-ee-integration-ios-stable-2.9 FAILURE in 14m 06s (non-voting)
ansible-ee-integration-ios-stable-2.11 FAILURE in 15m 32s (non-voting)
ansible-ee-integration-ios-stable-2.12 FAILURE in 12m 40s (non-voting)
ansible-ee-integration-ios-libssh-latest FAILURE in 25m 28s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.9 FAILURE in 24m 35s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.11 FAILURE in 24m 53s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.12 FAILURE in 25m 17s (non-voting)
✔️ ansible-tox-linters SUCCESS in 10m 54s

@softwarefactory-project-zuul
Copy link

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/966428a2b93d43baad3b40987d1371c4

✔️ ansible-galaxy-importer SUCCESS in 4m 37s
✔️ build-ansible-collection SUCCESS in 8m 29s
ansible-ee-integration-ios-latest FAILURE in 19m 19s (non-voting)
ansible-ee-integration-ios-stable-2.9 FAILURE in 16m 52s (non-voting)
ansible-ee-integration-ios-stable-2.11 FAILURE in 19m 12s (non-voting)
ansible-ee-integration-ios-stable-2.12 FAILURE in 16m 25s (non-voting)
ansible-ee-integration-ios-libssh-latest FAILURE in 25m 45s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.9 FAILURE in 25m 37s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.11 FAILURE in 24m 09s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.12 FAILURE in 24m 56s (non-voting)
✔️ ansible-tox-linters SUCCESS in 10m 19s

@softwarefactory-project-zuul
Copy link

Build failed.
https://ansible.softwarefactory-project.io/zuul/buildset/cf835bd4eaed498e858dbed62727d321

ansible-galaxy-importer RETRY_LIMIT in 16s
✔️ build-ansible-collection SUCCESS in 9m 00s
ansible-ee-integration-ios-latest FAILURE in 17m 15s (non-voting)
ansible-ee-integration-ios-stable-2.9 FAILURE in 17m 26s (non-voting)
ansible-ee-integration-ios-stable-2.11 FAILURE in 16m 35s (non-voting)
ansible-ee-integration-ios-stable-2.12 FAILURE in 17m 21s (non-voting)
ansible-ee-integration-ios-libssh-latest FAILURE in 24m 17s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.9 FAILURE in 26m 01s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.11 FAILURE in 25m 53s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.12 FAILURE in 24m 08s (non-voting)
✔️ ansible-tox-linters SUCCESS in 10m 48s

@KB-perByte KB-perByte merged commit dc03ddd into ansible-collections:main Feb 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants