From 3252f4972a38e066662c7d196a99610fd15c974c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Gaidamour?= <jeremie.gaidamour@inria.fr> Date: Fri, 6 Nov 2015 16:03:48 +0100 Subject: [PATCH] [dev] Added group in dhcp configuration --- generators/dhcp/templates/dhcp.erb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/generators/dhcp/templates/dhcp.erb b/generators/dhcp/templates/dhcp.erb index 673aa74b6b6..74c2c763310 100644 --- a/generators/dhcp/templates/dhcp.erb +++ b/generators/dhcp/templates/dhcp.erb @@ -6,6 +6,9 @@ site_uid = data.fetch('site_uid') data.fetch('network_interfaces').each { |network_interface| +%> +group { +<% data.fetch('nodes').sort_by { |item| item.to_s.split(/(\d+)/).map { |e| [e.to_i, e] } }.each { |node_uid, node_hash| network_interface != 'bmc' ? node_uid_net = node_uid : node_uid_net = node_uid + '-bmc' @@ -19,9 +22,10 @@ end %> -host <%= node_uid_net %>.<%= site_uid %>.grid5000.fr { - hardware ethernet <%= node_mac.upcase %>; - fixed-address <%= node_ip %>; -} + host <%= node_uid_net %>.<%= site_uid %>.grid5000.fr { + hardware ethernet <%= node_mac.upcase %>; + fixed-address <%= node_ip %>; + } <% } %> +} <% } %> -- GitLab