About haproxyconfig¶
We put at your disposal three configuration options for haproxy-devlove-views
, and a fourth one that is similar to the second and you can use it directly to modify it and choose a new one. You can appreciate the configuration obtained by choosing the option-<i>
in roles/create_deploys/templates/config/option-<i>/example-results
.
Configurations¶
Option | Description |
---|---|
option-1 |
For local testing. It will automatically configure so that every host is considered to have 127.0.0.1 as their IP address. option-1 download the demo, place it on www and configure the devlove to serve those files. |
option-2 |
For real sites, with an external origin that is online. |
option-3 |
For test sites where it is not necessary to be online, the pages will be served from the same vps. Similar to option-1 (without downloading the demo), ready to be modified according to your requirements. |
option-4 |
For test sites. Similar to option-2 , ready to be modified according to your requirements. |
Add your own configuration option-5
¶
Suppose you want to create a fifth option option-5
, to start you can make a copy of any of the existing options and make the appropriate changes. Note that this works as follows:
In
roles/install_haproxy/templates/config/option-5/haproxy_skeleton/haproxy.cfg.jinja2
there will be the"skeleton"
ofhaproxy.cfg
. This file is uploaded to the server from the task"Copy haproxy_skeleton config to the remote server"
in the reciperoles/install_haproxy/tasks/main.yml
.In this
"skeleton"
there should exist certain regions in which the respective templates will be injected, these templates must be placed inroles/create_deploys/templates/config/option-5/haproxy
. The recipe that is responsible for uploading the templates to the server isroles/create_deploys/tasks/configure-haproxy.yml
. At the end of this recipe there is the task"Updating haproxy.cfg"
that use the respective scriptroles/create_deploys/files/update-haproxy/option-5/update-haproxy.sh"
to"inject"
and/or update the different sections that exist in thehaproxy.cfg
"skeleton"
” .Finally if you need to make changes to the
devlove
, it will be inroles/create_deploys/templates/config/option-5/devlove
and views inroles/create_deploys/templates/config/option-5/views-dir
.