nl2go.ip_route

Ansible Role: IP Route

This Ansible Role helps you manage IP routes.

Role Variables

You can find available variables below, with their default values (check defaults/main.yml):

  • ip_route_configs: {}

You define IP routes using the ip_route_configs variable.

Example configuration:

ip_route_configs:
  eth0:
    - gateway: 172.0.1.1
      network: 172.0.1.0/24

The example above sets up a route for the network 172.0.1.0/24 using the gateway 172.0.1.1 on the device eth0.

This configuration is stored in /etc/network/{if-up.d|if-down.d}.

To remove a specific route, use the state: absent option:

ip_route_configs:
  eth0:
    - network: 172.0.1.0/24
      state: absent

Routes are identified by the network.

Tags

Tags help you run specific parts of the role. The available tags are:

  • ip_route: Runs all tasks in the role.
  • ip_route_config, config: Executes only the configuration tasks.

Dependencies

No dependencies.

Example Playbook

Here’s how to use it in a playbook:

- hosts: all
  roles:
     - nl2go.ip_route

Development

You can use docker-molecule to run Molecule according to the instructions, or install Molecule locally (not recommended because of possible version conflicts).

To run tests, use:

molecule test --all

Maintainers

License

Check the LICENSE.md file for more information.

Author Information

This role was created in 2020 by Newsletter2Go GmbH.

Informazioni sul progetto

Manages IP routes.

Installa
ansible-galaxy install nl2go.ip_route
Licenza
mit
Download
5.3k
Proprietario