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

os10_static_route role #163

Open
bas-1988 opened this issue Feb 14, 2024 · 2 comments
Open

os10_static_route role #163

bas-1988 opened this issue Feb 14, 2024 · 2 comments

Comments

@bas-1988
Copy link

We are really wanting to have a role for static route's.

e.g.

os10_static_route:
  routes:   
    - route: 1.1.1.0/24
      gateway: 10.1.1.1
      state: present
  vrf: 
    name: "xxx"
    routes:
      - route: 2.2.2.0/24
        gateway: 20.1.1.1
        state: present
{% if os10_static_route is defined and os10_static_route %}
  {% for staticroute in os10_static_route.routes %}
        {% if staticroute.route is defined and staticroute.route %}
          {% if staticroute.state is defined and staticroute.state == "absent" %}
no ip route {{ staticroute.route }} {{ staticroute.gateway }}
          {% else %}
ip route {{ staticroute.route }} {{ staticroute.gateway }}
          {% endif %}
        {% endif %}
  {% for vrfstaticroute in os10_static_route.vrf.routes %}
      {% if vrfstaticroute.route is defined and vrfstaticroute.route %}
          {% if vrfstaticroute.state is defined and vrfstaticroute.state == "absent" %}
no ip route vrf {{ os10_static_route.vrf.name }} {{ vrfstaticroute.route }} {{ vrfstaticroute.gateway }}
          {% else %}
ip route vrf {{ os10_static_route.vrf.name }} {{ vrfstaticroute.route }} {{ vrfstaticroute.gateway }}
          {% endif %}
        {% endif %}
      {% endfor %}

Could you please create something like this

@prasadapr
Copy link
Collaborator

Hi @bas-1988, sure we will check update.

@bas-1988
Copy link
Author

Thank you, let me know if you need more information or help

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

No branches or pull requests

2 participants