Sha256: 813ca1805a279c8f75f5aa7fc8bf317bca275509898df005cce2277815d032e5

Contents?: true

Size: 779 Bytes

Versions: 16

Compression:

Stored size: 779 Bytes

Contents

require 'mkit/app/model/setting'
require 'mkit/config/config'

module MKIt
  module HAProxy
    module_function
    
    def start
      %x{#{MKIt::Config.mkit.haproxy.ctrl.start}}
    end
  
    def stop
      %x{#{MKIt::Config.mkit.haproxy.ctrl.stop}}
    end

    def restart
      stop
      start
    end

    def status
      %x{#{MKIt::Config.mkit.haproxy.ctrl.status}}
    end

    def reload
      %x{#{MKIt::Config.mkit.haproxy.ctrl.reload}}
    end

    def create_config_file(filename:, data:)
      File.write("#{MKIt::Config.mkit.haproxy.config_dir}/#{filename}", data)
    end

    def delete_config_file(filename:)
      begin
        File.delete("#{MKIt::Config.mkit.haproxy.config_dir}/#{filename}")
      rescue => e
        puts e
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
mkit-0.9.0 lib/mkit/app/helpers/haproxy.rb
mkit-0.8.0 lib/mkit/app/helpers/haproxy.rb
mkit-0.7.2 lib/mkit/app/helpers/haproxy.rb
mkit-0.7.1 lib/mkit/app/helpers/haproxy.rb
mkit-0.7.0 lib/mkit/app/helpers/haproxy.rb
mkit-0.6.3 lib/mkit/app/helpers/haproxy.rb
mkit-0.6.2 lib/mkit/app/helpers/haproxy.rb
mkit-0.6.1 lib/mkit/app/helpers/haproxy.rb
mkit-0.6.0 lib/mkit/app/helpers/haproxy.rb
mkit-0.5.0 lib/mkit/app/helpers/haproxy.rb
mkit-0.4.3 lib/mkit/app/helpers/haproxy.rb
mkit-0.4.2 lib/mkit/app/helpers/haproxy.rb
mkit-0.4.1 lib/mkit/app/helpers/haproxy.rb
mkit-0.4.0 lib/mkit/app/helpers/haproxy.rb
mkit-0.3.0 lib/mkit/app/helpers/haproxy.rb
mkit-0.2.0 lib/mkit/app/helpers/haproxy.rb