Class: Construqt::Flavour::Ubuntu::Services::RouteService
- Inherits:
-
Object
- Object
- Construqt::Flavour::Ubuntu::Services::RouteService
- Defined in:
- lib/construqt/flavour/ubuntu/flavour_ubuntu_services.rb
Instance Method Summary collapse
- #down(ifname) ⇒ Object
-
#initialize(service) ⇒ RouteService
constructor
A new instance of RouteService.
- #interfaces(host, ifname, iface, writer) ⇒ Object
- #up(ifname) ⇒ Object
- #vrrp(host, ifname, iface) ⇒ Object
Constructor Details
#initialize(service) ⇒ RouteService
Returns a new instance of RouteService.
163 164 165 |
# File 'lib/construqt/flavour/ubuntu/flavour_ubuntu_services.rb', line 163 def initialize(service) @service = service end |
Instance Method Details
#down(ifname) ⇒ Object
171 172 173 |
# File 'lib/construqt/flavour/ubuntu/flavour_ubuntu_services.rb', line 171 def down(ifname) "/sbin/ip route del #{@service.rt.dst.to_string} via #{@service.rt.via}" end |
#interfaces(host, ifname, iface, writer) ⇒ Object
179 180 |
# File 'lib/construqt/flavour/ubuntu/flavour_ubuntu_services.rb', line 179 def interfaces(host, ifname, iface, writer) end |
#up(ifname) ⇒ Object
167 168 169 |
# File 'lib/construqt/flavour/ubuntu/flavour_ubuntu_services.rb', line 167 def up(ifname) "/sbin/ip route add #{@service.rt.dst.to_string} via #{@service.rt.via}" end |
#vrrp(host, ifname, iface) ⇒ Object
175 176 177 |
# File 'lib/construqt/flavour/ubuntu/flavour_ubuntu_services.rb', line 175 def vrrp(host, ifname, iface) host.result.etc_network_vrrp(iface.name).add_master(up(ifname)).add_backup(down(ifname)) end |