【发布时间】:2019-10-25 12:58:44
【问题描述】:
我有一个以下 ruby 模板
interface <%= @interface %>
state <%= @state %>
priority <%= @priority %>
virtual_router_id 1
unicast_src_ip <%= @ipaddress_interface %>
在 unicast_src_ip 我会添加@interface-s ip 地址。 接口名称是动态的。 因此,如果我在@interface 中获得 eth0,@ipadress_interface 应该是 eth0 (@ipaddress_eth0) 的 ip。 如果我预定义了 NIC 的名称,例如 nic01。 @ipadress_nic01 就像一个魅力。但不幸的是,我只有在木偶运行时才知道 if 名称
【问题讨论】:
标签: templates puppet embedded-ruby