56fef3de83bded3a5539faf428b4f94cfee1b824
Commit Graph

440 Commits

This Branch
This Branch
All Branches
Author SHA1 Message Date
Zuul
56fef3de83 Merge "Allow default_backend to be specified" 2023年03月15日 18:07:58 +00:00
Zuul
0c69464fa1 Merge "Serialise initial issuing of LetsEncrypt certificates" 2023年03月07日 18:12:25 +00:00
Zuul
23b18f89da Merge "Fix tags usage for letsencrypt setup" 2023年03月07日 17:40:42 +00:00
Jonathan Rosser
42d80464af Allow default_backend to be specified
Currently default_backend for a service is always set to the
haproxy_service_name for a service, but this might not be what is
required for some configurations.
This patch allows haproxy_default_backend to be configured for
a service to customise the default_backend setting.
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible-rabbitmq_server/+/876436
Change-Id: I9e2be37cb27a33350577a93f23b69e560493b320
2023年03月06日 11:56:51 +00:00
Zuul
044d65e9bb Merge "Accept both HTTP and HTTPS also for external VIP during upgrade" 2023年03月01日 00:27:41 +00:00
Jonathan Rosser
34f153b139 Serialise initial issuing of LetsEncrypt certificates
Currently the role will run against all target hosts, and it is
possible that the calling playbook runs with a serial: setting
to control how many hosts are targetted simultaneously.
However, this is not sufficient to guarantee that each potential
haproxy server requests a LetsEncrypt certificate sequentially.
It is only possible for the loadbalancer to direct the challenge
from the ACME server to one certbot instance at a time, so this
patch enforces serialisation of the initial certificate generation
regardless of the number of target hosts and setting of serial:
outside this role.
Change-Id: If8ae64bc01510d3570fa4c554463bd6121b21f86
2023年02月28日 18:40:01 +00:00
Dmitriy Rabotyagov
6c4a2b8eaa Fix tags usage for letsencrypt setup
We haven't specified tags for let's encrypt task which resulted in task
not being executed when using them.
Change-Id: I294e962bdb796190d1e7a2555708fbfaa8384a0a
Co-Authored-By: Damian Dąbrowski <damian@dabrowski.cloud>
2023年02月28日 18:38:14 +01:00
Zuul
7dea60f263 Merge "Move selinux fix to haproxy_post_install.yml" 2023年02月21日 23:12:39 +00:00
Zuul
8514c0d775 Merge "Add a variable to allow extra raw config to be applied to all frontends" 2023年02月21日 20:18:48 +00:00
Zuul
a9aee345b8 Merge "Use let's encrypt standalone flag only for http-01" 2023年02月21日 20:11:10 +00:00
Damian Dabrowski
a30ecbee08 Accept both HTTP and HTTPS also for external VIP during upgrade
In change [1] we have added functionality to accept both HTTP and
HTTPS during an upgrade.
However it's only limited to internal VIP. I see no reason not to
implement this also for external VIP. Some people may find it useful.
[1] https://review.opendev.org/c/openstack/openstack-ansible-haproxy_server/+/829899
Change-Id: I672016b75d4b514d87dbb47119ff549bbc4e923e
2023年02月21日 15:23:40 +00:00
Jonathan Rosser
0d56cfe64b Update hatop to latest release, 0.8.2
Change-Id: I300206a79fcb9e809c1ae714f492583fb9d4e363
2023年02月17日 17:22:08 +01:00
Jonathan Rosser
f7c87fd118 Add a variable to allow extra raw config to be applied to all frontends
Currently this must be configured on a per-frontend basis through
service.haproxy_frontend_raw. This patch adds a new role default
variable haproxy_frontend_extra_raw which will be combined with all
per service raw config lines.
Change-Id: I506d46d64df93bbb9e6d1ebfa3d3caa44c80fdd5
2023年02月14日 18:55:00 +00:00
Damian Dabrowski
d5b3bdba20 Move selinux fix to haproxy_post_install.yml
haproxy_service_config.yml is not a valid place for selinux fix.
It should be moved to haproxy_post_install.yml.
Change-Id: Ice55e1cd9fdbac6e564c7f084dc1a020940a0da8
2023年02月14日 12:29:47 +01:00
Dmitriy Rabotyagov
908427222b Use let's encrypt standalone flag only for http-01
In case of using dns-01 challange deployers might want
to avoid using
standalone flag.
Change-Id: I3c6cfd7779e9ec9322e655cdda5bb6866bf695ca
Closes-Bug: #2006938 
2023年02月13日 19:02:29 +01:00
Andrew Bonney
445b15f9c3 Fix dict object key error when haproxy interfaces not defined
The ternary options appear to be getting evaluated whether they
are used or not, so item['interface'] is always accessed.
This patch aims to check for the key's presence before performing
ternary operations, or use Ansible variables to postpone evaluation
until absolutely necessary.
Change-Id: Ib1462c04d1a0820a37998f989e2ed16566f71f54
2023年01月11日 11:03:31 +00:00
Dmitriy Rabotyagov
a5daa83172 Update tox.ini to work with 4.0
With tox release of 4.0, some parameters were deprecated and are ignored now
which causes tox failures. One of the most spread issues we have is using
`whitelist_externals` isntead of `allowlist_externals`
Change-Id: I73cad1846dd3fbcbf9e3317227c472d769d1e7b6
2022年12月27日 17:53:11 +01:00
289cfdac03 Update master for stable/zed
Add file to the reno documentation build to show release notes for
stable/zed.
Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/zed.
Sem-Ver: feature
Change-Id: I819c1252ed66a169de60dcd5f8e88e4bc94c22ab
2022年12月13日 13:08:17 +00:00
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