class Construqt::Flavour::Ubuntu::Services::ConntrackD
Public Class Methods
new(service)
click to toggle source
# File lib/construqt/flavour/ubuntu/flavour_ubuntu_services.rb, line 134 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 142 def down(ifname) "/usr/share/doc/conntrackd/examples/sync/primary-backup.sh backup" end
interfaces(host, ifname, iface, writer)
click to toggle source
# File lib/construqt/flavour/ubuntu/flavour_ubuntu_services.rb, line 151 def interfaces(host, ifname, iface, writer) throw "only vrrp ifaces could be used to conntrack: #{ifname}:#{iface.name}" unless iface.vrrp throw "conntrack needs a ipv4 address #{ifname}:#{iface.name}" unless iface.address.first_ipv4 throw "conntrack currently a ipv4 address #{iface.host.name}:#{ifname}:#{iface.name}" unless iface.address.first_ipv4 other_if = iface.vrrp.delegate.interfaces.find{|i| i.host != host } throw "conntrack currently a ipv4 address #{other_if.host.name}:#{other_if.name}" unless other_if.address.first_ipv4 #binding.pry host.result.etc_conntrackd_conntrackd.add(ifname, iface.address.first_ipv4, other_if.address.first_ipv4) end
up(ifname)
click to toggle source
# File lib/construqt/flavour/ubuntu/flavour_ubuntu_services.rb, line 138 def up(ifname) "/usr/share/doc/conntrackd/examples/sync/primary-backup.sh primary" end
vrrp(host, ifname, iface)
click to toggle source
# File lib/construqt/flavour/ubuntu/flavour_ubuntu_services.rb, line 146 def vrrp(host, ifname, iface) #binding.pry host.result.etc_network_vrrp(iface.name).add_master(up(ifname)).add_backup(down(ifname)) end