Sha256: c03467a2244e3fc500572c7d289f24b4d5f7f20fc8401978ad36da26ef64d2c1

Contents?: true

Size: 1.05 KB

Versions: 4

Compression:

Stored size: 1.05 KB

Contents

module Specinfra
  module Command
    class Fedora < RedHat
      def check_enabled(service, target="multi-user.target")
        host = Specinfra.configuration.ssh ? Specinfra.configuration.ssh.host : 'localhost'
        if property.has_key?(:os_by_host) && property[:os_by_host][host][:release].to_i < 15
          super
        else
          # Fedora 15+ uses systemd which no longer has runlevels but targets
          # For backwards compatibility, Fedora provides pseudo targets for
          # runlevels
          if target.is_a? Integer
            target = "runlevel#{target}.target"
          end
          "systemctl --plain list-dependencies #{target} | grep '^#{escape(service)}.service$'"
        end
      end

      def check_running(service)
        host = Specinfra.configuration.ssh ? Specinfra.configuration.ssh.host : 'localhost'
        if property.has_key?(:os_by_host) && property[:os_by_host][host][:release].to_i < 15
          super
        else
          "systemctl is-active #{escape(service)}.service"
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
specinfra-2.0.0.beta6 lib/specinfra/command/fedora.rb
specinfra-2.0.0.beta5 lib/specinfra/command/fedora.rb
specinfra-2.0.0.beta4 lib/specinfra/command/fedora.rb
specinfra-2.0.0.beta3 lib/specinfra/command/fedora.rb