Cleanup inline_template usage
1 parent a28e50b commit 03ba889c4b9a0dac4c6ba3c1a557f9fb96ab5a9d
@Andreas Jaggi Andreas Jaggi authored on 13 Aug 2012
Showing 2 changed files
View
3
■■
manifests/iface.pp
if $auto == 1 {
interfaces::auto { $ifname_real: }
}
 
$str = "iface ${ifname_real} ${family} ${method}\n\t<%= options.join('\n\t') %>\n\n"
concat::fragment{"interfaces::iface_${name}":
target => '/etc/network/interfaces',
content => inline_template($str),
content => inline_template("iface <%= ifname_real -%> <%= family -%> <%= method -%>\n\t<%= options.join('\n\t') -%>\n\n"),
}
}
View
3
■■
manifests/mapping.pp
define interfaces::mapping ( $script, $maps ) {
$str = "mapping ${name}\n\tscript ${script}\n\t<%= maps.join('\n\t') %>\n\n"
concat::fragment{"interfaces::mapping_${name}":
target => '/etc/network/interfaces',
content => inline_template($str),
content => inline_template("mapping <%= name -%>\n\tscript <%= script -%>\n\t<%= maps.join('\n\t') -%>\n\n"),
}
}