class Construqt::Flavour::Ubuntu::Services::Radvd
Public Class Methods
new(service)
click to toggle source
# File lib/construqt/flavour/ubuntu/flavour_ubuntu_services.rb, line 89 def initialize(service) @service = service end
Public Instance Methods
down(ifname)
click to toggle source
# File lib/construqt/flavour/ubuntu/flavour_ubuntu_services.rb, line 97 def down(ifname) "kill `cat /run/radvd.#{ifname}.pid`" end
interfaces(host, ifname, iface, writer)
click to toggle source
# File lib/construqt/flavour/ubuntu/flavour_ubuntu_services.rb, line 106 def interfaces(host, ifname, iface, writer) # binding.pry return unless iface.address && iface.address.first_ipv6 writer.lines.up(up(ifname)) writer.lines.down(down(ifname)) host.result.add(self, <<RADV, Construqt::Resources::Rights.root_0644(Construqt::Resources::Component::RADVD), "etc", "network", "radvd.#{ifname}.conf") interface #{ifname} { AdvManagedFlag on; AdvSendAdvert on; AdvOtherConfigFlag on; #AdvAutonomous on; #AdvLinkMTU 1480; #MinRtrAdvInterval 3; #MaxRtrAdvInterval 60; prefix #{iface.address.first_ipv6.network.to_string} { AdvOnLink on; AdvAutonomous #{@service.adv_autonomous? ? "on" : "off"}; AdvRouterAddr on; }; }; RADV end
up(ifname)
click to toggle source
# File lib/construqt/flavour/ubuntu/flavour_ubuntu_services.rb, line 93 def up(ifname) "/usr/sbin/radvd -C /etc/network/radvd.#{ifname}.conf -p /run/radvd.#{ifname}.pid" end
vrrp(host, ifname, iface)
click to toggle source
# File lib/construqt/flavour/ubuntu/flavour_ubuntu_services.rb, line 101 def vrrp(host, ifname, iface) #binding.pry host.result.etc_network_vrrp(iface.name).add_master(up(ifname)).add_backup(down(ifname)) end