Method: Construqt::Interfaces#add_openvpn

Defined in:
lib/construqt/interfaces.rb

#add_openvpn(host, name, cfg) ⇒ Object

def add_template(host, name, cfg)

  cfg['clazz'] = "template"
 cfg['host'] = host
cfg['name'] = name
   self.add_device(host,name, cfg)
 end


52
53
54
55
56
57
58
59
60
# File 'lib/construqt/interfaces.rb', line 52

def add_openvpn(host, name, cfg)
  cfg['clazz'] = "opvn"
  cfg['ipv6'] ||= nil
  cfg['ipv4'] ||= nil
  dev = add_device(host, name, cfg)
  dev.address.interface = host.interfaces[name] if dev.address
  dev.network.name = "#{name}-#{host.name}"
  dev
end