Cookbooks
haproxy
documentation
Haproxy Service

Back To Resource List (opens in a new tab)


haproxy_service

Configures HAProxy as a systemd service. To reload HAProxy service add a subscribes option to the resource block. See example below. To reload the HAProxy service add a subscribes option to the resource block. See example below.

Introduced: v4.0.0

Actions

  • :create
  • :delete
  • :start
  • :stop
  • :restart
  • :reload
  • :enable

Properties

This resource also uses the following partial resources:

NameTypeDefaultDescriptionAllowed Values
bin_prefixString/usrBin location of the haproxy binary, defaults to /usr
service_nameStringhaproxy
systemd_unit_contentString, HashSee the service resourceA string or hash that contains a systemd unit file definition
config_testtrue, falsetruePerform configuration file test before performing service action
config_test_fail_actionSymbol:raiseAction to perform upon configuration test failure

Examples

haproxy_service 'haproxy'
haproxy_service 'haproxy' do
  subscribes :reload, 'template[/etc/haproxy/haproxy.cfg]', :delayed
end
haproxy_service 'haproxy' do
  subscribes :reload, ['template[/etc/haproxy/haproxy.cfg]', 'file[/etc/haproxy/ssl/haproxy.pem]'], :delayed
end