Merge pull request #4 from lock8/customize-haproxy.cfg-location
Customize haproxy.cfg location
This commit is contained in:
commit
432752577e
3 changed files with 33 additions and 11 deletions
39
README.rst
39
README.rst
|
@ -1,20 +1,35 @@
|
||||||
|
=======
|
||||||
haproxy
|
haproxy
|
||||||
=======
|
=======
|
||||||
|
|
||||||
haproxy
|
Install, configure and run ``haproxy``.
|
||||||
-------
|
|
||||||
|
|
||||||
Install, configure and run haproxy based on:
|
.. note::
|
||||||
|
|
||||||
- haproxy.install
|
See the full `Salt Formulas installation and usage instructions
|
||||||
- haproxy.config
|
<http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html>`_.
|
||||||
- haproxy.service
|
|
||||||
|
Available states
|
||||||
|
================
|
||||||
|
|
||||||
|
.. contents::
|
||||||
|
:local:
|
||||||
|
|
||||||
Use the supplied haproxy.cfg for a flat file approach,
|
Use the supplied haproxy.cfg for a flat file approach,
|
||||||
or the jinja template and the pillar for a salt approach.
|
or the jinja template and the pillar for a salt approach.
|
||||||
|
|
||||||
haproxy.config
|
``haproxy``
|
||||||
--------------
|
-----------
|
||||||
|
|
||||||
|
Install, configure and run ``haproxy`` service.
|
||||||
|
|
||||||
|
``haproxy.install``
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
Install ``haproxy`` from packages.
|
||||||
|
|
||||||
|
``haproxy.config``
|
||||||
|
------------------
|
||||||
|
|
||||||
Currently, only a handful of options can be set using the pillar:
|
Currently, only a handful of options can be set using the pillar:
|
||||||
|
|
||||||
|
@ -55,4 +70,10 @@ Currently, only a handful of options can be set using the pillar:
|
||||||
+ name: name of the server for haproxy
|
+ name: name of the server for haproxy
|
||||||
+ host: the host to be contacted
|
+ host: the host to be contacted
|
||||||
+ port: the port to contact the server on
|
+ port: the port to contact the server on
|
||||||
+ check: set to check to enable checking
|
+ check: set to check to enable checking
|
||||||
|
|
||||||
|
|
||||||
|
``haproxy.service``
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
Make sure ``haproxy`` service is running.
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
haproxy.config:
|
haproxy.config:
|
||||||
file.managed:
|
file.managed:
|
||||||
- name: /etc/haproxy/haproxy.cfg
|
- name: {{ salt['pillar.get']('haproxy:config_file_path', '/etc/haproxy/haproxy.cfg') }}
|
||||||
- source: salt://haproxy/templates/haproxy.jinja
|
- source: salt://haproxy/templates/haproxy.jinja
|
||||||
- template: jinja
|
- template: jinja
|
||||||
- user: root
|
- user: root
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
haproxy:
|
haproxy:
|
||||||
|
config_file_path: /etc/haproxy/haproxy.cfg
|
||||||
global:
|
global:
|
||||||
stats:
|
stats:
|
||||||
enable: True
|
enable: True
|
||||||
|
@ -82,4 +83,4 @@ haproxy:
|
||||||
name: some-server
|
name: some-server
|
||||||
host: 123.156.189.111
|
host: 123.156.189.111
|
||||||
port: 8080
|
port: 8080
|
||||||
check: check
|
check: check
|
||||||
|
|
Loading…
Reference in a new issue