Sha256: 9fa3d5ea7668f42a829c2675474b10e391e407fa15bb8530b1137f66feb71f8c

Contents?: true

Size: 889 Bytes

Versions: 21

Compression:

Stored size: 889 Bytes

Contents

class Service
  def initialize(teuton_host, param)
    @teuton_host = teuton_host
    @parent = teuton_host.parent
    @host = teuton_host.host
    @param = param
  end

  def is_running?
    @parent.target("Service #{@param} is running?")
    @parent.run "systemctl status #{@param}", on: @host
    @parent.expect_one ["Active:", "running"]
  end

  def is_inactive?
    @parent.target("Service #{@param} is inactive?")
    @parent.run "systemctl status #{@param}", on: @host
    @parent.expect_one ["Active:", "inactive"]
  end

  def is_enable?
    @parent.target("Service #{@param} is enable?")
    @parent.run "systemctl status #{@param}", on: @host
    @parent.expect_one ["Loaded:", "enable"]
  end

  def is_disable?
    @parent.target("Service #{@param} is disable?")
    @parent.run "systemctl status #{@param}", on: @host
    @parent.expect_one ["Loaded:", "disable"]
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
teuton-2.9.2 lib/teuton/case/builtin/service.rb
teuton-2.9.1 lib/teuton/case/builtin/service.rb
teuton-2.9.0 lib/teuton/case/builtin/service.rb
teuton-2.8.0 lib/teuton/case/builtin/service.rb
teuton-2.7.3 lib/teuton/case/builtin/service.rb
teuton-2.7.2 lib/teuton/case/builtin/service.rb
teuton-2.7.1 lib/teuton/case/builtin/service.rb
teuton-2.7.0 lib/teuton/case/builtin/service.rb
teuton-2.6.0 lib/teuton/case/builtin/service.rb
teuton-2.5.0 lib/teuton/case_manager/case/builtin/service.rb
teuton-2.4.5 lib/teuton/case_manager/case/builtin/service.rb
teuton-2.4.4 lib/teuton/case_manager/case/builtin/service.rb
teuton-2.4.3 lib/teuton/case_manager/case/builtin/service.rb
teuton-2.4.2 lib/teuton/case_manager/case/builtin/service.rb
teuton-2.4.1 lib/teuton/case_manager/case/builtin/service.rb
teuton-2.4.0 lib/teuton/case_manager/case/builtin/service.rb
teuton-2.3.11 lib/teuton/case_manager/case/builtin/service.rb
teuton-2.3.10 lib/teuton/case_manager/case/builtin/service.rb
teuton-2.3.9 lib/teuton/case_manager/case/builtin/service.rb
teuton-2.3.8 lib/teuton/case_manager/case/builtin/service.rb