Class: Construqt::Flavour::Ubuntu::Services::Radvd
- Inherits:
-
Object
- Object
- Construqt::Flavour::Ubuntu::Services::Radvd
- Defined in:
- lib/construqt/flavour/ubuntu/flavour_ubuntu_services.rb
Instance Method Summary collapse
- #down(ifname) ⇒ Object
-
#initialize(service) ⇒ Radvd
constructor
A new instance of Radvd.
- #interfaces(host, ifname, iface, writer) ⇒ Object
- #up(ifname) ⇒ Object
- #vrrp(host, ifname, iface) ⇒ Object
Constructor Details
#initialize(service) ⇒ Radvd
Returns a new instance of Radvd.
89 90 91 |
# File 'lib/construqt/flavour/ubuntu/flavour_ubuntu_services.rb', line 89 def initialize(service) @service = service end |
Instance Method Details
#down(ifname) ⇒ Object
97 98 99 |
# 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) ⇒ Object
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 |
# 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) ⇒ Object
93 94 95 |
# 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) ⇒ Object
101 102 103 104 |
# 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 |