Project

General

Profile

Actions

Support #26430

closed

Safemode doesn't allow to access 'host_subnet' on #<Safemode::ScopeObject>

Added by Stefan Eriksson about 5 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Unattended installations
Target version:
-
Triaged:
No
Fixed in Releases:
Found in Releases:

Description

Hi I'm trying to create a finish template that statically adds ip in the interfaces file rathar than dhcp.

But when I preview the below I get
Safemode doesn't allow to access 'host_subnet' on #<Safemode::ScopeObject>

real=`ip -o link | awk '/<%= @host.mac -%>/ {print $2;}' | sed s/://`
cat << EOF > /etc/network/interfaces
#loopback
auto lo
iface lo inet loopback

auto $real
allow-hotplug $real
iface $real inet static
    address <%= @host.ip %>
    dns-search <%= @host.domain %>
    gateway <%= host_subnet.gateway %>
    netmask <%= host_subnet.mask %>
    dns-nameservers <%= host_subnet.dns_primary %> <%= host_subnet.dns_secondary %>
EOF

what should I change to get the subnet gateway/netmast?

Thanks

Actions #1

Updated by Lukas Zapletal about 5 years ago

  • Status changed from New to Closed

Hello, host_subnet seems to be undefined variable. Do you want to use \@host.subnet instead?

@host.subnet.xxxx

Please use our community forum for questions.

Actions

Also available in: Atom PDF