Sha256: c8cd9cc019740f422044b4ea16fb29deded6082b53ba696ca581b155e062c8d8

Contents?: true

Size: 1.19 KB

Versions: 3

Compression:

Stored size: 1.19 KB

Contents

module Invoker
  module Power
    module Distro
      class Base
        RESOLVER_FILE = "/etc/dnsmasq.d/dev-tld"
        RINETD_FILE = "/etc/rinetd.conf"

        def self.distro_installer
          case Facter[:operatingsystem].value
          when "Ubuntu"
            require "invoker/power/setup/distro/ubuntu"
            Ubuntu.new
          when "Fedora"
            require "invoker/power/setup/distro/redhat"
            Redhat.new
          when "Archlinux"
            require "invoker/power/setup/distro/arch"
            Arch.new
          else
            raise "Your selected distro is not supported by Invoker"
          end
        end

        def resolver_file
          RESOLVER_FILE
        end

        def rinetd_file
          RINETD_FILE
        end

        # Install required software
        def install_required_software
          raise "Unimplemented"
        end

        def restart_services
          if Facter[:systemctl] == "true"
            system("systemctl restart rinetd")
            system("systemctl restart dnsmasq")
          else
            system("service rinetd restart")
            system("service dnsmasq restart")
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
invoker-1.3.2 lib/invoker/power/setup/distro/base.rb
invoker-1.3.1 lib/invoker/power/setup/distro/base.rb
invoker-1.3.0 lib/invoker/power/setup/distro/base.rb