Skip to content
Snippets Groups Projects
Commit adbade16 authored by Attila Farkas's avatar Attila Farkas
Browse files

use regex to parse ip instead of netaddr

parent 528fddc9
No related branches found
No related tags found
1 merge request!13Resolve "Integrate KYPO CRP interface Ansible role to Creator"
......@@ -16,7 +16,7 @@ interface_name: >-
{%- import "roles/common/templates/network.j2" as network with context -%}
{%- if interface_identification in ansible_interfaces -%}
{{ interface_identification }}
{%- elif interface_identification | ipv4 -%}
{%- elif interface_identification | regex_search("^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$") -%}
{{ network.ip_to_interface(interface_identification) }}
{%- elif interface_identification | regex_search("^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$")-%}
{{ network.mac_to_interface(interface_identification) }}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment