Skip to content

Commit

Permalink
Merge pull request #3 from keen99/master
Browse files Browse the repository at this point in the history
basic example set with config tree and sample configs
  • Loading branch information
joewilliams committed Sep 7, 2012
2 parents cfaaf31 + 0a9a16d commit ca38969
Show file tree
Hide file tree
Showing 13 changed files with 32 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README
Expand Up @@ -6,11 +6,11 @@ Details:


This script accepts a filename (FILE_NAME) as the first arg and a path (HAPROXY_PATH) as the second. It expects the haproxy files/directories to be located as follows: This script accepts a filename (FILE_NAME) as the first arg and a path (HAPROXY_PATH) as the second. It expects the haproxy files/directories to be located as follows:


HAPROXY_PATH/conf/global.cfg (file) HAPROXY_PATH/conf/global.cfg (file - required)
HAPROXY_PATH/conf/defaults.cfg (file) HAPROXY_PATH/conf/defaults.cfg (file - required)
HAPROXY_PATH/conf/frontend.cfg (file) HAPROXY_PATH/conf/frontend.cfg (file - required)
HAPROXY_PATH/conf/frontend.d (dir of frontend configs) HAPROXY_PATH/conf/frontend.d (dir of frontend configs - optional)
HAPROXY_PATH/conf/backend.d (dir backend configs) HAPROXY_PATH/conf/backend.d (dir backend configs - optional)


The script will concatenate these files together to in the appropriate order to create a single large haproxy configuration at HAPROXY_PATH/FILE_NAME. Also note that under the frontend.d and backend.d the script only picks up files with a ".cfg" extension. It wil also attempt to create a backup of the already joined config file. The script will concatenate these files together to in the appropriate order to create a single large haproxy configuration at HAPROXY_PATH/FILE_NAME. Also note that under the frontend.d and backend.d the script only picks up files with a ".cfg" extension. It wil also attempt to create a backup of the already joined config file.


Expand Down
Empty file modified bin/haproxy_join 100644 → 100755
Empty file.
7 changes: 7 additions & 0 deletions examples/README
@@ -0,0 +1,7 @@

example directory and file tree layout so you can see (and copy for your
own use) the supported structure

to create the output file (example/haproxy/conf/haproxy.cfg) run:
sh build.sh

6 changes: 6 additions & 0 deletions examples/build.sh
@@ -0,0 +1,6 @@
basedir=$(dirname $0)
chmod +x $basedir/../bin/haproxy_join
$basedir/../bin/haproxy_join haproxy.cfg haproxy
echo "output file is:"
ls -l haproxy/haproxy.cfg

1 change: 1 addition & 0 deletions examples/haproxy/conf/backend.d/2backendd.cfg
@@ -0,0 +1 @@
#2backendd
1 change: 1 addition & 0 deletions examples/haproxy/conf/backend.d/backendd.cfg
@@ -0,0 +1 @@
#backendd
1 change: 1 addition & 0 deletions examples/haproxy/conf/defaults.cfg
@@ -0,0 +1 @@
#defaults
1 change: 1 addition & 0 deletions examples/haproxy/conf/frontend.cfg
@@ -0,0 +1 @@
#frontend
1 change: 1 addition & 0 deletions examples/haproxy/conf/frontend.d/2frontendd.cfg
@@ -0,0 +1 @@
#2frontendd
1 change: 1 addition & 0 deletions examples/haproxy/conf/frontend.d/frontendd.cfg
@@ -0,0 +1 @@
#frontendd
1 change: 1 addition & 0 deletions examples/haproxy/conf/global.cfg
@@ -0,0 +1 @@
#global
Empty file.
7 changes: 7 additions & 0 deletions examples/haproxy/haproxy.cfg
@@ -0,0 +1,7 @@
#global
#defaults
#frontend
#frontendd
#2frontendd
#backendd
#2backendd

0 comments on commit ca38969

Please sign in to comment.