Module: MKIt::HAProxy

Defined in:
lib/mkit/app/helpers/haproxy.rb

Class Method Summary collapse

Class Method Details

.create_config_file(filename:, data:) ⇒ Object



29
30
31
# File 'lib/mkit/app/helpers/haproxy.rb', line 29

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

.delete_config_file(filename:) ⇒ Object



33
34
35
36
37
38
39
# File 'lib/mkit/app/helpers/haproxy.rb', line 33

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

.reloadObject



25
26
27
# File 'lib/mkit/app/helpers/haproxy.rb', line 25

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

.restartObject



16
17
18
19
# File 'lib/mkit/app/helpers/haproxy.rb', line 16

def restart
  stop
  start
end

.startObject



8
9
10
# File 'lib/mkit/app/helpers/haproxy.rb', line 8

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

.statusObject



21
22
23
# File 'lib/mkit/app/helpers/haproxy.rb', line 21

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

.stopObject



12
13
14
# File 'lib/mkit/app/helpers/haproxy.rb', line 12

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