Skip to content

This repository contains the network.interfaces Ansible Collection.

License

Notifications You must be signed in to change notification settings

redhat-cop/network.interfaces

Repository files navigation

Ansible Network interfaces

CI[! OpenSSF Best Practices](https://bestpractices.coreinfrastructure.org/projects/7650)

This repository contains the network.interfaces Ansible Collection.

About

  • Ansible Network interfaces Collection contains the role that provides a platform-agnostic way of managing interfaces protocol/resources. This collection provides the user the capabilities to gather, deploy, remediate, detect, persist and perform health checks for network interfaces resources.

  • Network interfaces collection can be used by anyone who is looking to manage and maintain interfaces protocol/resources. This includes system administrators and IT professionals.

This collection includes the following roles:

  • deploy: Ensure consistent configuration deployment across network devices.
  • detect: Identify configuration drifts between desired and actual states.
  • remediate: Automatically correct configuration drifts and restore compliance.
  • gather: Collect facts and running configurations from network devices.
  • persist: Save network device configurations and facts to local or remote repositories for backup or audit purposes.
  • health_checks: Enables to perform health checks for interfaces.

Included content

Click on the name of a role to view its documentation:

Roles

Name Description
network.interfaces.deploy Deploy consistent network configurations.
network.interfaces.detect Identify configuration drifts and discrepancies.
network.interfaces.remediate Correct configuration drifts and restore compliance.
network.interfaces.gather Collect facts and running configurations from network devices.
network.interfaces.persist Save configurations and facts to local or remote repositories.
network.interfaces.health_checks Perform health checks for the interfaces.

Requirements

Installation

To consume this Validated Content from Automation Hub, the following needs to be added to ansible.cfg:

[galaxy]
server_list = automation_hub

[galaxy_server.automation_hub]
url=https://console.redhat.com/api/automation-hub/content/published/
auth_url=https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token
token=<SuperSecretToken>

Get the required token from the Automation Hub Web UI.

With this configured, simply run the following commands:

ansible-galaxy collection install network.base
ansible-galaxy collection install network.interfaces

Use Cases

Build Brownfield Inventory:

  • Users want to be able to get the facts for INTERFACES resources and store it as host_vars thus enabling the capability to get facts for all the hosts within the inventory and store facts in a structured format that acts as SOT.

interfaces Resource Management:

  • Users want to be able to manage the interfaces, L2 interfaces and L3 interfaces configurations. This also includes the enablement of gathering facts, updating INTERFACE resource host-vars and deploying config onto the appliance.

Detect Drift and remediate: This enables users to detect any drift between the provided config and the running config and if required then override the running config.

interfaces Health Checks: Users want to be able to perform health checks for INTERFACES resources. These health checks should be able to provide the interface's admin operational state with the necessary details.

  • So in summary this platform-agnostic role enables the user to perform interfaces health checks. Users can perform the following health checks: all_operational_state_up min_operational_state_up all_administratnal_state_up min_administratnal_state_up

Testing

The project uses tox to run ansible-lint and ansible-test sanity. Assuming this repository is checked out in the proper structure, e.g. collections_root/ansible_collections/network/interfaces, run:

  tox -e ansible-lint
  tox -e py39-sanity

To run integration tests, ensure that your inventory has a network_base group. Depending on what test target you are running, comment out the host(s).

[network_hosts]
ios
junos

[ios:vars]
< enter inventory details for this group >

[junos:vars]
< enter inventory details for this group >
  ansible-test network-integration -i /path/to/inventory --python 3.9 [target]

Contributing

We welcome community contributions to this collection. If you find problems, please open an issue or create a PR against this repository.

Don't know how to start? Refer to the Ansible community guide!

Want to submit code changes? Take a look at the Quick-start development guide.

We also use the following guidelines:

Code of Conduct

This collection follows the Ansible project's Code of Conduct. Please read and familiarize yourself with this document.

Release notes

Release notes are available here.

Related information

Licensing

GNU General Public License v3.0 or later.

See LICENSE to see the full text.

About

This repository contains the network.interfaces Ansible Collection.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages