be9a66c2807b5e7edb4f9868c6491ce26f0b5d7f
Commit Graph

58 Commits

Author SHA1 Message Date
Dmitriy Rabotyagov
be9a66c280 Don't restrict haproxy tunable options
Instead of hardcoding specific supported tunable options, we
just pass key as an option to haproxy config.
This change might break deployments during upgrades, since format of
values in variable has changed, but appropriate release note was written
We also increase maxrewrite by default, as otherwise usage of CSP leads
to 500 error.
Change-Id: I949960420ed5dbd6d58f0de7dae0ac629a85b7fc
Related-Bug: https://github.com/haproxy/haproxy/issues/1597
Needed-By: https://review.opendev.org/c/openstack/openstack-ansible-os_horizon/+/844815 
2022年06月20日 08:27:40 +02:00
Andrew Bonney
0aeaeb590a Adjust default configuration to support TLS v1.3
This adds TLS v1.3 support to the HAProxy role by default, along
with a new variable to manage cipher suites.
The old variable for TLS v1.2 and below ciphers is renamed for
consistency, but is still supported as a default where overridden
by deployments.
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/823943
Change-Id: Iaf9709ac5f5ac8db281a9ec7278cef274186ba15
2022年01月10日 08:57:40 +00:00
James Gibson
800254b354 Add option to use alernative CA server for certbot
This could be achieved using the
haproxy_ssl_letsencrypt_setup_extra_params variable, but this
makes it a bit neater.
Change-Id: Iee2d5a10e1762b23fcb3f3140950c76a754743b7
2021年10月18日 08:50:27 +01:00
Andrew Bonney
964a33558b Add configuration option for native prometheus exporter
HAProxy added native Prometheus support from v2.0. This can be
enabled using the existing stats endpoint via an additional
/metrics path.
Change-Id: If9528969c7915db06138c0746dc419d8302f0e7c
2021年07月30日 09:07:50 +01:00
Dmitriy Rabotyagov
f14ba91798 Generate self-signed SSL per listen IP
We're providing an option to have an IP address per VIP
address. Currently it's used only for creating self-signed
SSLs signed with internal CA per each VIP. With follow-up
patches that will also allow to provide user certificates
per VIP, making possible to cover internal and external
endpoints with different non-wildcard certs.
Change-Id: I0a9eb7689eb42b50daf5c94c874bb7429b271efe
2021年06月25日 13:30:25 +00:00
Dmitriy Rabotyagov
f058cf8d61 Replace whitelist with allowlist naming
Change-Id: I568273d0ef1d5ee391a42981e66cc9895b9d71b6
2021年06月16日 14:40:19 +03:00
Jonathan Rosser
fd7509cd43 Use external PKI role to manage haproxy self-signed certificates
The external PKI role can generate a self signed CA and Intermediate
certificate, and then create a server certificate for haproxy if
no defaults are overridden.
The new openstack_pki_* settings allow an external self signed CA
to be used, but still create valid haproxy server certificates from
that external CA in an openstack-ansible deployment.
The original beheviour providing user supplied certificates in the
haproxy_user_ssl_* variables will still work, disabling the generation
of certificates but using the external PKI role to just install the
supplied certs and keys.
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/788031
Change-Id: I7482f55e991bacd9dccd2748c236dcd9d01124f3
2021年06月01日 15:37:29 +00:00
Andrew Bonney
357daad5c8 Allow HAProxy stats to be pinned to one or more processes
When HAProxy is run in multi-process mode, the single stats page
shows metrics for one of the processes at a time, with a random
selection made on page reload.
Whilst a more complete solution may be to enable a stats page for
each process, this is a little cumbersome. This addition allows
the stats page to be pinned to one process, providing a partial
snapshot of the state of the instance.
Change-Id: Id9314e5b267aafeaf34c82874eb8bfe0713dfac3
2021年03月25日 14:08:15 +00:00
Satish Patel
0ef22fa4df Fix HATop for haproxy
Readjust hatop installtion method, removed haproxy_hatop_downloader and
deployment-host variables. added "haproxy_hatop_install | bool" condition.
Change-Id: I51423fff67e6e427f6c7d163d8d1aac6bcd82ca9
2020年12月30日 17:20:42 +00:00
Marc Gariepy
ca2c011cf2 Add haproxy_frontend_only and haproxy_raw feature.
you can add prometheus metric exposed directly via haproxy if your
version is recent enough.
https://www.haproxy.com/blog/haproxy-exposes-a-prometheus-metrics-endpoint/
Change-Id: I10e7220071290301a85409a1f74fcbad2743d19d
2020年12月14日 19:10:29 +00:00
Satish Patel
a46106d4e7 Python3 supported version of hatop
New hatop package has python3 support.
Change-Id: I69c01f330feb67d92b6b01fea589a35969879da2
2020年12月04日 14:27:42 +00:00
Dmitriy Rabotyagov
0343893881 Define http-01 params with already provided variables
There's no real need in asking user to manually provide http-01 port and
address when we already have corresponding variables we rely on.
Change-Id: Id0d2a73c863d9bbb8b6280ce42f918127baea354
2020年09月24日 09:55:09 +00:00
Dmitriy Rabotyagov
6bd42911f7 Add haproxy_ssl_all_vips variable
This variable will allow to globally control if SSL should be also used
for internal/admin endpoints, or for public only
Change-Id: I1fa990bab5801a6e6fde7176b2011ab1977b30ae
2020年08月20日 13:27:44 +03:00
Jonathan Rosser
aa737c5c42 Allow ansible group for self signed certificate distribution to be overidden
If this role is used outside the context of openstack-ansible then the
self signed certificate distribution tasks will fail if the haproxy_all
group is not defined, even if self signed certificates are not being used.
Change-Id: Iebc4a293fa8e3566bc910de305e6519a25f2884f
2020年05月07日 13:16:18 +00:00
Jonathan Rosser
dbc8fe1fe2 Use a certbot pre-hook to ensure haproxy backend is up before renewal
We use the built in python3 http server to bring up a temporary backend
on the node which wants to renew a certificate. The timeout set so that
the haproxy health check has noticed the backend come up before certbot
runs.
There is otherwise a race condition between the haproxy healthcheck and
the certbot challenge request arriving at the acme-challenge endpoint.
Change-Id: I2f5f9457c43c68f2881bf9d44f43434ca7b43859
2020年05月07日 13:15:54 +00:00
Jonathan Rosser
ba3a89944b Allow multiple methods of installing certbot
Currently the only method is by downloading the certbot-auto script
and executing that. Some distros supply a so this patch sets up
an option for a future patch to add distro package support
Change-Id: Ie32e6f577c9aa898906ee76199fd0ebe75d5ae95
2020年05月05日 14:01:23 +00:00
Jonathan Rosser
04932a7c74 Allow extra parameters to be passed to certbot
When setting up certbot for the first time, many extra parameters
are available. This new variable allows these to be passed. A typical
example is passing --staging in order to use the letsencrypt staging
endpoint rather than the production one.
Change-Id: I42f9e1f68c3a3533a3377f37063f4924cdf77bd6
2020年04月23日 19:32:08 +01:00
Jonathan Rosser
f35867466c Add extra controls for frontend redirects
This patch adds two new variables for a service:
* haproxy_redirect_scheme
This variable allows a custom string to be specified to override
the default condition used to redirect http to https.
* haproxy_frontend_acls
This variable works in the same way as haproxy_acls except it applies
the acl to the frontend rather than the backend configuration. This
can be required when some paths are not redirected to https but must
instead be handled by a specific backend.
Change-Id: I6b13375ba738d7659681ca773297d0b6b0fd7efb
2020年04月23日 19:32:06 +01:00
Magnus Bergman
049b479b65 Add options to override which addresses haproxy binds to
Adding options to be able to override the default behaviour of
haproxy binding to external_lb_vip_address and internal_lb_vip_address.
The default behaviour stays the same after this change.
Change-Id: I76044aea498d73e97087719279ba0a37a9eb28e9
2020年03月02日 14:29:12 +01:00
Magnus Bergman
693cdb1afc Align the usage of the two extra lb vip parameters
As extra_lb_tls_vip_addresses required a default due to how it's used
I'm also adding a default for extra_lb_vip_addresses and removing the if
defined for it for clarity.
Change-Id: If217f811dab9cfa2f459f5f50bc67bcf31ddbaaa
2020年02月04日 11:57:05 +01:00
Magnus Bergman
b7834dd051 Add support for extra VIPs with TLS enabled
The existing extra_lb_vip_addresses parameter will add extra haproxy
VIPs without TLS. This patch adds a new extra_lb_tls_vip_addresses
parameter for adding VIPs with TLS enabled.
Change-Id: Ib6f38200775d31633d57a680fae475dbf7abc6c9
2020年01月31日 15:38:22 +01:00
Georgina Shippey
38f7ec04bc Make log socket available to chrooted filesystem
Had an issue where HAProxy logs could not be found.
The /dev/log socket was not available to the chrooted filesystem.
We need to mount the socket and persist it.
Change-Id: I2a1ce48f90c5f85b1238842f17ad2c9708333629
2019年12月02日 14:03:33 +00:00
Zuul
ca51879876 Merge "Variable to set HTTP keepalive mode" 2019年03月19日 03:03:52 +00:00
Gaudenz Steinlin
e911f3f2d2 Variable to set HTTP keepalive mode
The HTTP keepalive mode is currently hardcoded to "http-server-close"
for all HTTP services. This disables keepalive for HAProxy to backend
connections, but leaves it enabled for client connections to HAProxy.
This is problematic especially for service to service calls (e.g.
nova-api to neutron). If a request is made at the same time the HAProxy
keepalive timeout expires, the result of the request is undefined. This
leads to code 500 error responses from the nova-api because the request
from nova-api to neutron failed. "Connection aborted" error messages in
the logs are an indication of this issue.
There is also a bug report[1] about the same issue in devstack which was
solved by disabling keepalive and a script[2] to reproduce the issue in
devstack.
This adds a default and per service variables to set the HTTP keepalive
mode used by HAProxy. The default value is changed to "forceclose" to
disable HTTP keepalive on the server and client side. With HTTP
keepalive disabled the issue can no longer be reproduced.
[1] https://bugs.launchpad.net/devstack/+bug/1630664
[2] https://github.com/JordanP/openstack-snippets/blob/master/keepalive-race/keep-alive-race.py
Change-Id: If819912873270f0568974925490023310f9cbd66
2019年03月04日 18:29:25 +01:00
Frank Kloeker
b9cb133bb0 Fix venv installation of Letsencrypt certbot
certbot-auto wants to install depedencies which are possibly
not fulfilled by the repo-server - so bypass installation here.
Use the venv bin later for the renew script.
Minor errors are also fixed.
Change-Id: I4087bbcb4fe6182cb090a5b6b85bea36768b4f4f
2019年02月02日 01:14:18 +01:00
Frank Kloeker
4fb2059a3b Add feature Letsencrypt SSL certification
- installs certbot-auto
- generates and validates ssl cert
- installs cert in haproxy settings
- renew cert with cron
Change-Id: Iea59ec2893a988b184ca8bc70e1d273ac071551e
2019年01月17日 17:54:50 +01:00
Zuul
7d8b9f31ad Merge "Force force-tlsv12 only" 2018年12月17日 17:16:45 +00:00
Matthew Thode
547d7f91be Force force-tlsv12 only
Secure by default
Change-Id: I70007af94bfd5e482662ab72d25bf090cf5d0834
2018年12月13日 14:20:37 -06:00
Jonathan Rosser
4a22e7683b Allow user defined options for the backend servers
There are many possible options that can be set for haproxy backend
servers but the current template does not provide a means for these
to be supplied. This patch follows the pattern already used with
haproxy_backend_options and creates a new haproxy_backend_server_options.
Change-Id: Ic312e5915a5df07121ffadca643ca6e4013e00ee
2018年12月05日 12:44:33 +00:00
Logan V
972ebbe5db Add 'absent' service state
Allow deprecation of haproxy endpoints by setting the state of the
service to 'absent'. It will also now clean up any config files
when there are no backends, or the service is disabled.
Change-Id: I1db5932c559b5e04d330c114164869dd43c1cbb2
2018年10月08日 15:11:10 +01:00
Jake Briggs
c85793ed21 Corrected haproxy template. Needed to have a
space between variable and value also the variable name was incorrect
corrected the name throughout playbook
This closes-bug: 1775938
Change-Id: I3920d7d89b74f12a6a7633d5c5c54a27ee029d31
2018年06月08日 22:20:21 -05:00
Zuul
1bd0b32519 Merge "Fix parameter name in defaults" 2018年03月05日 22:39:14 +00:00
Gaudenz Steinlin
6b7694cb4a Fix parameter name in defaults
The commented out section in the defaults file referenced wrong
parameter names. The parameters are called haproxy_* instead of hap_*.
Change-Id: Ieb6afece65d8872e8be83c8a848577cc052117f0
2018年03月05日 18:50:50 +01:00
Jonathan Rosser
2f84df46ca Unify extra package download with other OSA roles
Convert the extra package download tasks to use the same pattern as
other roles, including validating the checksum of the download.
Change-Id: I72891a3321eda65ef802bcbc5073251fc2fb9a03
2018年03月05日 09:31:35 +00:00
Major Hayden
6c588e41b4 Make haproxy stats refresh interval configurable
This patch adds a new variable, ``haproxy_stats_refresh_interval``,
which allows a deployer to configure their preferred refresh
interval for the haproxy stats page.
Release notes are included.
Closes-Bug: 1742526
Change-Id: I3979299478a8e9b479a4c4e821f2a45e1b2679cb
2018年01月10日 13:14:15 -06:00
Jesse Pretorius
2470c01693 Remove unused/unnecessary haproxy_server vars/files
The repo/keys are left over from Newton/Trusty and
were not removed when Trusty support was removed.
The required packages were only necessary in order
to facilitate the repo addition.
The var haproxy_distro_packages is defined in all
distro-specific vars files, so its presence in
defaults is unnecessary.
The apt pinning meta dependency is no longer
required - it's another leftover from Ubuntu Trusty.
A task is included to remove the old config files.
Change-Id: I912cd170d05c4a9befe3420971ddf68ff2ddde2b
2017年08月21日 13:21:58 +01:00
Chenjun Shen
88ec33a6c0 Replace hard coded timeout values with variables
Currently the timeout values for client/connect/server are hard coded
in templates/haproxy.cfg.j2. In order to give users flexibility to
override these values, for example increase timeout or reduce timeout,
I replaced hard coded timeout values with variables.
The original default values are still kept in defaults/main.yml.
Closes-Bug: #1696703
Change-Id: I72e9691a074df04e9fb7c4ddc0fe610c8d13feff
2017年06月14日 09:40:23 +02:00
Jesse Pretorius
4e9dd2ab5a Allow cert validation for hatop download to be disabled
When using a TLS proxy, the certificate validation may fail.
This patch allows the validation to be optionally disabled.
Change-Id: I4bc854486a5ef694c4bc8a29546586a068f55af7
2017年03月29日 18:54:02 +00:00
Andrey
c477565acb Added Haproxy global tunables
Max number of connection may be set up, as well as major tunables
may be added as the variables.
Change-Id: I5b333b79680d81b030810a7e94e3cc4bfe724649
2017年03月15日 18:06:16 -05:00
Satheesh Kumar Ulaganathan
00ec5971ab Enable timeout for http_request
This fix supports to configure timeout for http-request which in turn
helps in avoiding DDOS Attack. This ensures HAProxy to let five seconds
to a client to send its whole HTTP request, otherwise HAProxy would
shut the connection with an error.
Change-Id: I2e6b886e6c1e4a63ecb6513cd2d2672ac738a909
2017年03月03日 13:14:08 -08:00
Tom Jose Kalapura
ec73944b79 Define haproxy_ssl_bind_options variable.
This fix will help in overriding the haproxy ssl bind options.
Change-Id: I45ebf6d532988bd5f842e553de24330863f3989f
2017年03月02日 13:36:09 -08:00
Jimmy McCrory
eb33fb39ca Provide default haproxy_ssl_cipher_suite
Provide a default 'haproxy_ssl_cipher_suite' var for when this role is
run outside of an integrated OpenStack-Ansible deployment.
Change-Id: Ib6ec9c95e166eb78173c9d3a642494cd2f04f0f8
2017年02月09日 17:33:45 -08:00
Nish Patwa
31ff67dc86 Added ACL module in service.conf.j2
Added an option to configure acl in haproxy_server role by modifying
service.conf.j2 file. It makes developer easy to specify multiple
acl rules to front end that maps to a single backend server.
Change-Id: I528d9f276b4e1f680dd35d77999836f5a87c7c87
2016年11月03日 15:22:05 +00:00
Jesse Pretorius
075cb9edcd Rename package lists (and related vars) appropriately
In order to make it easier to differentiate between the lists of
python packages, distribution packages, downloaded packages,
package pins and other similar variables the variable names are
being changed to ensure that they have a more explicit suffix
that defines the purpose and makes the naming more consistent.
This is to facilitate a lookup plugin which will be able to look
up all the package lists and present them as a consolidated piece
of data which may be used for artifact preparation.
Change-Id: Id9a356f78162a77edc27209be215f04380a631dc
2016年08月26日 16:56:16 +01:00
Kevin Carter
2cfee3530e Fix broken hatop URL and role gate
google storage url changed so this URL needs to be updated.
Change-Id: I99b577badc8db3ce0cb6f683c233ef6fee18022e
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2016年08月25日 17:31:02 -04:00
Jesse Pretorius
a9ab13daf4 Add ability to change apt/yum package state for the haproxy_server role
The current method of installing the distribution packages required is
set in the tasks and cannot be changed by a deployer.
Currently the apt task always installs the latest package. This results
in unexpected binary changes when a deployer may simply be trying to
execute a configuration change.
This patch adds the ability for a deployer to change the desired state
so that the results are predictable.
Change-Id: I3732efabfa4fc7e80a8f172abd1415fd54489763
2016年08月13日 01:10:17 +00:00
Kevin Carter
4510d37dcd Update HAProxy for multi-OS support
This change implements CentOS7 and Ubuntu 16.04 support for the HAProxy
role. Because RHEL does not package HATop the installation of HATop has
been moved to a source installation so that it can be used universally.
Implements: blueprint multi-platform-host
Change-Id: Ib4f33185202b694b9611cc5fd6323c30a1c8d489
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2016年05月27日 11:12:17 +00:00
Kevin Carter
e86139506d Enable SSL termination for all services
This change makes it so that all services are expecting SSL termination
at the load balancer by default. This is more indicative of how a real
world deployment will be setup and is being added such that we can test
a more production like deployment system by default.
The AIO will now terminate SSL in HAProxy using a self-signed cert.
Depends-On: I63cfecd6793ba2b28c294d939c9b1c466940cbd1
Depends-On: Iba63636d733fa1eb095564b8bf33a8159d9c2a00
Depends-On: Ib31a48dd480ecb376a6a8c5b35b09dfa5d2e58f6
Depends-On: Ibdeb8b981ca770ce4f56beeae05afd3379964859
Change-Id: Id87fab39c929e0860abbc3755ad386aa6893b151
Co-Authored-By: Logan V <logan2211@gmail.com>
Signed-off-by: Logan V <logan2211@gmail.com>
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2016年04月27日 18:36:07 +00:00
Jean-Philippe Evrard
a3237381de Only update apt cache if necessary
Workarounding the upstream ansible apt module bug
documented here:
https://github.com/ansible/ansible-modules-core/pull/1517
For the next versions of ansible we'll be using, we should
check if the apt bug is fixed. When it's fixed, we could
abandon this change and use the standard apt module
with correct cache handling.
Change-Id: I2aaf00da175f31d0157bbc4ae30a4e176b055078
2016年02月09日 16:46:22 +01:00
Logan V
3cbc31166c Install psmisc with haproxy
The haproxy check script that is installed with keepalived expects to use
'killall', however this package is not installed in the container templates
by default and therefore the haproxy role must install it in order for
keepalived to leave FAULT state.
Change-Id: I8048aaa16b163acfe3da6863aef26adbe18bd73e
2016年01月31日 22:35:10 -06:00