use of org.platformlayer.ops.filesystem.TemplatedFile in project platformlayer by platformlayer.
the class CollectdMetricSet method addChildren.
@Override
protected void addChildren() throws OpsException {
File confDir = new File("/etc/collectd/conf");
TemplatedFile confFile = TemplatedFile.build(Injection.getInstance(CollectdModelBuilder.class), new File(confDir, getMetricKey() + ".conf"));
addChild(confFile);
}
use of org.platformlayer.ops.filesystem.TemplatedFile in project platformlayer by platformlayer.
the class NetworkBridge method addChildren.
@Override
protected void addChildren() throws OpsException {
// We would need proxy_arp if they were on the same IPV4 network
// Do we need proxy_ndp ???
// echo 1 > /proc/sys/net/ipv6/conf/eth0/proxy_ndp
addChild(SysctlSetting.build("net.ipv4.ip_forward", "1"));
addChild(SysctlSetting.build("net.ipv6.conf.all.forwarding", "1"));
addChild(SysctlSetting.build("net.ipv6.conf.all.proxy_ndp", "1"));
{
File scriptPath = new File("/etc/network/if-up.d/nat-for-bridge");
TemplatedFile nat = addChild(TemplatedFile.build(template, scriptPath));
nat.setFileMode("0755");
// Simulate an ifup run
Command command = Command.build(scriptPath);
CommandEnvironment env = new CommandEnvironment();
env.put("IFACE", template.getPublicInterface());
env.put("MODE", "start");
env.put("ADDRFAM", "inet");
command.setEnvironment(env);
nat.setUpdateAction(command);
}
}
Aggregations