fd3ba428d98e60fb29e4a311786a1a317c78abe6
Commit Graph

422 Commits

This Branch
This Branch
All Branches
Author SHA1 Message Date
Zuul
fd3ba428d9 Merge "Fix warnings in haproxy config" 2022年12月10日 12:16:23 +00:00
Dmitriy Rabotyagov
6532898a3c Make use of haproxy_rise and haproxy_fall variables
At the moment for some reason we're not taking into account default
variables haproxy_rise/haproxy_fall but instead trying to count
based on amount of backends. This makes quite little sense to
depend amount of backend rechecks on amount of backends overall,
so we're chaning behaviour to pre-defined variables that already exist.
Change-Id: I1e53a997f6f443718ea2c6bdfbe8a0b98c44896d
2022年12月09日 15:44:29 +01:00
Damian Dabrowski
34ac0710c5 Fix warnings in haproxy config
Haproxy config check(/usr/sbin/haproxy -c -f /etc/haproxy/haproxy.cfg)
returns 3 warnings:
1. keyword 'forceclose' is deprecated in favor of 'httpclose', and will
not be supported by future versions.
2. backend 'galera-back' : 'option tcplog' directive is ignored in
backends.
3. 'http-request' rules ignored for backend 'galera-back' as they
require HTTP mode.
This change fixes 1. and 2.
Fixing 3. will be a bit more tricky as it's a part of
`openstack_haproxy_stick_table` defined in
/opt/openstack-ansible/inventory/group_vars/haproxy/haproxy.yml
Change-Id: Idaa4b5580039857435f90416924dee26a702deba
2022年12月01日 16:41:04 +00:00
Zuul
31e30e3fe0 Merge "Allow do disable SSL only for stats frontend" 2022年10月07日 09:29:57 +00:00
Dmitriy Rabotyagov
9fc079a65d Validate haproxy conf after assemble
Right now we don't ensure haproxy conf validity and if it's incorrect
role will fail on attempt to reload haproxy. However it's really worth
adding validation step and do not proceed if configuration is wrong
Change-Id: I54717d4f7230b8d8dff2d293592831cc88c51d24
2022年10月05日 13:37:07 +02:00
Dmitriy Rabotyagov
6025eaac36 Allow do disable SSL only for stats frontend
Currently there is no way of disabling SSL connection for stats frontend
as it implies more global variable. However, for some systems consuming
self-signed root certificate might be not an option and disabling
SSL verification tricky. Thus, we introduce new variable that allows to
nicely control if SSL should be served for stats frontend or not.
Change-Id: Ic4bc4393ec89469876e9e95b12bb9c4069972713
2022年10月05日 11:29:50 +00:00
Zuul
a502817a89 Merge "Allow haproxy to bind on the interface" 2022年09月27日 21:11:49 +00:00
Zuul
d41b3bd0eb Merge "Remove redundant vars line" 2022年09月20日 19:11:05 +00:00
Zuul
c1df0a5b56 Merge "Add variable for setting certbot domains option" 2022年09月20日 16:03:26 +00:00
Danila Balagansky
1664c993b6 Add variable for setting certbot domains option
Add `haproxy_ssl_letsencrypt_domains` variable, which
contains a list (defaults to `external_lb_vip_address`)
for `--domains` certbot option.
Change-Id: I2ebfff9eeb5279a3964b8578a6e66aa132d763f5
2022年09月15日 08:03:07 +00:00
Erik Berg
d1d9dead6c Remove redundant vars line
This line was introduced by Ib4f33185202b694b9611cc5fd6323c30a1c8d489
for multi-os support, but should since be covered by the
distribution_major_version line above, introduced at a later date.
Change-Id: I23a8e7aaa3858bce47dcf7610acf1ee58d9e1fc1
2022年09月15日 09:54:38 +02:00
Zuul
23980cfe4e Merge "Do not add cacert when it does not exist" 2022年08月29日 23:37:03 +00:00
Dmitriy Rabotyagov
901523ddbb Allow haproxy to bind on the interface
In some user scenarious (like implementing DNS RR) it might be useful to
bind on 0.0.0.0 but at the same time do not conflict with other services
that are binded to the same ports. For that, we can specify a specific
interface, on which haproxy will be binded to 0.0.0.0.
In netstat it would be represented like `0.0.0.0%br-mgmt:5000`.
With that we also allow to fully override `vip_binds` if assumtions
that role make are not valid for some reason.
Change-Id: Ic4c58ef53abc5f454b6fbebbd87292a932d173ae
2022年08月09日 18:47:29 +00:00
Dmitriy Rabotyagov
dd842f4eb4 Do not add cacert when it does not exist
Right now we assume, that ca-cert is always present. Though, it might
not be the case for user-provided certs or let's encrypt, as they
are already in ca-certificates.
Change-Id: I101f82c5e378596e76a160aacb34a9e1e7e0c123
2022年08月09日 15:18:24 +00:00
Andrew Bonney
8dc0ff4e1f tls1.2: update ciphers to latest recommendations
Based upon usual recommendations from:
https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/
Change-Id: I6e549ab3ffcacebe04e188cbf34d8707fb0fe05d
2022年08月05日 10:44:07 +01:00
Jonathan Rosser
06e76706c7 Allow customisation of stick-tables for each service.
A new variable "haproxy_stick_table" is added which allows a custom
stick-table to be supplied that is used as the default stick-table
for all haproxy back-ends.
In addition, the variable service.haproxy_stick_table can be defined
for each service to allow a unique stick-table to be supplied for
a particular service.
The old default stick-table definition is removed as there was no
use case defined for it in this role before. An example is added
to defaults/main.yml to show how the custom stick-table can be used
to rate-limit requests that generate 4xx responses which commonly
occur during vulnerability scanning or credential stuffing attacks.
There are many other uses for stick-tables, consult the HAProxy
documentation for details.
Change-Id: I50daba08c10f071157d6450ea2fa97df448f99ec
2022年07月11日 14:54:01 +00:00
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
Dmitriy Rabotyagov
8a81b355d8 Switch sphinx language to en
With sphinx release of 5.0.0, they changed default for language variable
to 'en' from None. With that current None valuable is not valid and should
not be used.
Change-Id: Ibea41d4f472fa7b375d9d04e94ad621696f565b1
2022年05月30日 16:01:14 +02:00
Zuul
2336b468c6 Merge "Add functionality to accept both HTTP and HTTPS during upgrade" 2022年04月26日 15:13:05 +00:00
OpenStack Proposal Bot
13e79b2cd7 Updated from OpenStack Ansible Tests
Change-Id: I786353945ca45d16d91678d65610a97798bf98f0
2022年04月04日 09:40:15 +00:00
Jonathan Rosser
d339d576b0 Cleanup setup.py config
Change-Id: Idea36d3b3fd8cdeb04e76f9b3ec7da24eac99b83
2022年04月04日 10:39:41 +01:00
Dmitriy Rabotyagov
01f8a8718e Change location of ipaddr filter
ipaddr filter has been moved from netcommon to utils collection [1]
Based on that we must add that collection to requirements.
[1] db4920ebf6
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/831525
Change-Id: Ib3f982f445cdd944738f897abd0d312e70645bf2
2022年03月02日 14:32:03 +01:00
JamesGibo
d30bb2e6d1 Add functionality to accept both HTTP and HTTPS during upgrade
Enable TLS on internal communication has 2 parts
* Enabling TLS on the internal VIPs for haproxy frontends
* Enabling TLS on the service backends
Haproxy has support for enabling TLS on frontends and backends,
but doing so would cause downtime.
In the case of upgrading frontends, enabling TLS would prevent
openstack services from working until their config is changed
from http to https, as they do not follow redirects.
In the case of backends haproxy would mark each backend as down
because if could not initiate a HTTPS connection to the backend
until the backend is updated.
This patch fixes this and allows haproxy to accept both HTTP and
HTTPS on the same well known port for each service. It also
allows for both HTTP and HTTPS backends.
Support for HTTP and HTTPS on the frontend is enabled by setting
haproxy_tcp_upgrade_frontend: true
Support for HTTP and HTTPS on the backend is enabled by setting
haproxy_tcp_upgrade_backend: true
This is a temporary patch and will be removed once instances have
been upgraded to HTTPS for internal communications in a future
release of OSA.
Change-Id: I4279005d5b4e6133cf85ba43379b51149c838f17
2022年02月18日 14:40:14 +00:00
Zuul
ab0c91f810 Merge "Adjust default configuration to support TLS v1.3" 2022年01月28日 18:56:35 +00:00
Jonathan Rosser
b4a564795b Refactor use of include_vars
Use a first_found lookup instead of a with_first_found loop so that
the 'paths' parameter can be used.
This ensures that only vars from the role are included, and not vars
from a parent calling role. This can happen when a parent role has
a higher priority vars file available for inclusion than the role
it calls.
Change-Id: I65564c23ff0003a575af984c709c1ae365292f35
2022年01月12日 08:48:25 +00:00
Zuul
4fb7a9a198 Merge "Add default CA store to use when haproxy_backend_ca is true" 2022年01月11日 22:54:54 +00: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
Marcus Klein
00587968ac Describe in detail why external and internal keepalived ping addresses should be separated
Change-Id: Iae5c21ee0d604fb015593337815840981ab10ef9
2021年12月24日 15:35:35 +01:00
OpenStack Proposal Bot
036708b9ca Updated from OpenStack Ansible Tests
Change-Id: I290188edc92108960fd4287689ad283eff3503e1
2021年12月17日 16:44:40 +00:00
James Gibson
92dac326a9 Add default CA store to use when haproxy_backend_ca is true
If haproxy_backend_ca set to true, default to using system CA
so you dont have to specify the exact CA to use.
Change-Id: I536c32a0b152a2b754787e07574472ecfaebd7e7
2021年12月15日 14:06:25 +00:00
James Gibson
33dbb82bbb Add option to force encryption of all health checks over SSL
This is required if a server only speaks HTTPS
Change-Id: Ib99eed929dfded2bbf11bc1a54c4184edafe8452
2021年12月06日 17:22:43 +00:00
Zuul
f8b7ce18a2 Merge "Fix inconsistency in haproxy_frontend_raw naming" 2021年11月22日 18:30:50 +00:00
James Gibson
9b1fd69588 Remove httplog directive from backends as ignored
Option httplog directive is ignored in backends
http://cbonte.github.io/haproxy-dconv/2.0/configuration.html#4-option%20httplog
Change-Id: I792f22b8e20b3ca34be78a9c87ca0f1050f9225c
2021年11月12日 10:46:47 +00:00
Dmitriy Rabotyagov
afa12fbc97 Fix inconsistency in haproxy_frontend_raw naming
We have announced and documented haproxy_frontend_raw variable
while in fact introduced haproxy_raw. Since announced variable name
better reflects its purpose and it was announced,
we rename it to haproxy_frontend_raw in template generation.
Change-Id: I7ba9588b599f42dddad395df1a2e18ccfe6b3fe3
2021年11月12日 12:29:57 +02: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
Zuul
27efcbd7bd Merge "Fix haproxy Let's Encrypt SSL path" 2021年10月15日 11:21:44 +00:00
Jonathan Rosser
a8593a876e Fix typo for user supplied certificate variable
Change-Id: I74da6c27a7d0992a45103657cd0800dab8143c4f
2021年10月08日 10:55:34 +01:00
Dmitriy Rabotyagov
1195355b43 Fix haproxy Let's Encrypt SSL path
With releasing PKI role we broke Let's Encrypt option because of
changing directories where certs should be located
and not reflecting these changes for let's encrypt. At the same time
we should not generate self-signed cert when let's encrypt path is used.
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/811742
Closes-Bug: #1938961
Change-Id: I1a6701b171782528373bc1d0a39e70e6d1ef20ab
2021年10月05日 15:08:40 +01:00
Dmitriy Rabotyagov
99415e7692 Fix PKI regen behaviour
We have introduced variables to control CA/certificates regeneration
however never used them anywhere.
This patch fixes that, so that haproxy_pki_regen_cert and
haproxy_pki_regen_ca are respected now.
Change-Id: Id6d5395d5976ec9393a55be7fe9a946cf9ce745e
2021年09月09日 11:36:03 +03:00
Zuul
96087b0867 Merge "Fix service removal condition" 2021年08月31日 11:36:07 +00: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
691f81a6d9 Fix service removal condition
In order to remove service currently we need to satisfy one of
conditions:
- haproxy_backend_nodes and haproxy_backup_nodes are empty and defined
but must be defined
- haproxy_service_enabled is False
- state is absent
There's big issue with logic regarding haproxy_backend_nodes and
haproxy_backup_nodes since they both should be defined and empy,
but in case haproxy_backup_nodes is not defined but haproxy_backend_nodes
is empty we should consider this as condition for removal as well.
But this will make it too complicated.
This change suggest consider rely only on haproxy_service_enabled and
state keys of haproxy_service_configs, as it's sufficient to
drop service based on these 2 options.
Change-Id: Ib37445ad852bcbd8d44d9eda9293565a4e52262b
2021年07月23日 12:25:20 +00:00
Zuul
1dc4fa621c Merge "Generate self-signed SSL per listen IP" 2021年06月25日 17:21:17 +00: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
James Gibson
3139772435 Add variable to disable stick-table
In some use cases you may want to define your own stick-table and
rules, this can be done using the backend_arguments variables.
As you can have only one stick-table per backend or frontend
the default stick-table needs to be disabled.
I am also not convinved the default stick-table is used for anything,
it just logs requests and never uses the logs, i think it could be
removed.
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/797819
Change-Id: I54307c00673ababb277257f2bb0e456e3e011ac4
2021年06月24日 11:53:32 +01:00
Dmitriy Rabotyagov
f058cf8d61 Replace whitelist with allowlist naming
Change-Id: I568273d0ef1d5ee391a42981e66cc9895b9d71b6
2021年06月16日 14:40:19 +03:00
Zuul
834b2927a7 Merge "Use external PKI role to manage haproxy self-signed certificates" 2021年06月10日 13:38:55 +00:00
Zuul
96c572d507 Merge "Update documentation for keepalived ping addresses" 2021年06月03日 11:25:17 +00: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
Jonathan Rosser
ca76349e9f Use http-request set-header instead of reqadd
This is needed for HAProxy 2.1 which is in Debian Bullseye
Change-Id: I912c6d810acc137c3b3e73dc40160d6376cb3884
2021年05月13日 16:08:50 +00:00