From 9bf451fc0363b444fc89b70366ce151d54c3eef9 Mon Sep 17 00:00:00 2001 From: Nicolas Delaby Date: Tue, 17 Mar 2015 10:16:55 +0100 Subject: [PATCH 1/2] Allow customization of configuration file path --- haproxy/config.sls | 2 +- pillar.example | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/haproxy/config.sls b/haproxy/config.sls index 63f51f2..e4fa11d 100644 --- a/haproxy/config.sls +++ b/haproxy/config.sls @@ -1,6 +1,6 @@ haproxy.config: 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 - template: jinja - user: root diff --git a/pillar.example b/pillar.example index 78ed658..137b9de 100644 --- a/pillar.example +++ b/pillar.example @@ -3,6 +3,7 @@ # haproxy: + config_file_path: /etc/haproxy/haproxy.cfg global: stats: enable: True @@ -82,4 +83,4 @@ haproxy: name: some-server host: 123.156.189.111 port: 8080 - check: check \ No newline at end of file + check: check From fa9426d1e4a583099c83da7ec917fc75e002962e Mon Sep 17 00:00:00 2001 From: Nicolas Delaby Date: Tue, 17 Mar 2015 11:03:02 +0100 Subject: [PATCH 2/2] Follow template of formulas --- README.rst | 39 ++++++++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/README.rst b/README.rst index cc2eb48..353bd74 100644 --- a/README.rst +++ b/README.rst @@ -1,20 +1,35 @@ +======= haproxy ======= -haproxy -------- +Install, configure and run ``haproxy``. -Install, configure and run haproxy based on: +.. note:: -- haproxy.install -- haproxy.config -- haproxy.service + See the full `Salt Formulas installation and usage instructions + `_. + +Available states +================ + +.. contents:: + :local: Use the supplied haproxy.cfg for a flat file 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: @@ -55,4 +70,10 @@ Currently, only a handful of options can be set using the pillar: + name: name of the server for haproxy + host: the host to be contacted + port: the port to contact the server on - + check: set to check to enable checking \ No newline at end of file + + check: set to check to enable checking + + +``haproxy.service`` +------------------- + +Make sure ``haproxy`` service is running.