Module: MKIt::HAProxy
- Defined in:
- lib/mkit/app/helpers/haproxy.rb
Class Method Summary collapse
- .create_config_file(filename:, data:) ⇒ Object
- .delete_config_file(filename:) ⇒ Object
- .reload ⇒ Object
- .restart ⇒ Object
- .start ⇒ Object
- .status ⇒ Object
- .stop ⇒ Object
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 |
.reload ⇒ Object
25 26 27 |
# File 'lib/mkit/app/helpers/haproxy.rb', line 25 def reload %x{#{MKIt::Config.mkit.haproxy.ctrl.reload}} end |
.restart ⇒ Object
16 17 18 19 |
# File 'lib/mkit/app/helpers/haproxy.rb', line 16 def restart stop start end |
.start ⇒ Object
8 9 10 |
# File 'lib/mkit/app/helpers/haproxy.rb', line 8 def start %x{#{MKIt::Config.mkit.haproxy.ctrl.start}} end |