From 041768640376540933f933f7ee8689464db993bf Mon Sep 17 00:00:00 2001 From: Daniel Ankers Date: Thu, 1 Feb 2024 14:32:31 +0000 Subject: [PATCH] Try to fix hostname again --- juniper-macros.j2 | 4 ++-- juniper-vxlan.j2 | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/juniper-macros.j2 b/juniper-macros.j2 index 37952d7..a8b4350 100644 --- a/juniper-macros.j2 +++ b/juniper-macros.j2 @@ -1,6 +1,6 @@ -{% macro systemsection(device,name) %} +{% macro systemsection(device) %} system { - host-name {{ name }}; + host-name {{ device['hostname'] }}; root-authentication { encrypted-password "{{ device['config_context']['root_pw'] }}"; ## Client Higher } diff --git a/juniper-vxlan.j2 b/juniper-vxlan.j2 index 4106ef8..2209f75 100644 --- a/juniper-vxlan.j2 +++ b/juniper-vxlan.j2 @@ -1,6 +1,6 @@ -{% set device=({'name':name,'device_role':device_role,'primary_ip4':primary_ip4,'rack':rack,'interfaces':interfaces,'peering_interfaces':peering_interfaces,'config_context':config_context}) %} +{% set device=({'hostname':hostname,'device_role':device_role,'primary_ip4':primary_ip4,'rack':rack,'interfaces':interfaces,'peering_interfaces':peering_interfaces,'config_context':config_context}) %} {% import "juniper-macros.j2" as junos %} -{{ junos.systemsection(device,name) }} +{{ junos.systemsection(device) }} {% if device_role['name'] == 'Leaf' %} {{ junos.chassissection(device) }} {% endif %}