Merge "Add default CA store to use when haproxy_backend_ca is true"

This commit is contained in:
Zuul 2022-01-11 22:54:54 +00:00 committed by Gerrit Code Review
commit 4fb7a9a198
5 changed files with 13 additions and 2 deletions

View File

@ -278,6 +278,8 @@ An example HTTP service could look like:
# If backend connections should be secured with SSL (default False) # If backend connections should be secured with SSL (default False)
haproxy_backend_ssl: True haproxy_backend_ssl: True
haproxy_backend_ca: /path/to/ca/cert.pem haproxy_backend_ca: /path/to/ca/cert.pem
# Or to use system CA for validation
# haproxy_backend_ca: True
# Or if certificate validation should be disabled # Or if certificate validation should be disabled
# haproxy_backend_ca: False # haproxy_backend_ca: False

View File

@ -132,7 +132,7 @@ backend {{ item.service.haproxy_service_name }}-back
{% endif %} {% endif %}
{% if item.service.haproxy_backend_ca %} {% if item.service.haproxy_backend_ca %}
{% set _ = entry.append("ca-file") %} {% set _ = entry.append("ca-file") %}
{% set _ = entry.append(item.service.haproxy_backend_ca) %} {% set _ = entry.append(item.service.haproxy_backend_ca is string | ternary(item.service.haproxy_backend_ca, haproxy_system_ca)) %}
{% else %} {% else %}
{% set _ = entry.append("verify none") %} {% set _ = entry.append("verify none") %}
{% endif %} {% endif %}
@ -173,7 +173,7 @@ backend {{ item.service.haproxy_service_name }}-back
{% endif %} {% endif %}
{% if item.service.haproxy_backend_ca %} {% if item.service.haproxy_backend_ca %}
{% set _ = entry.append("ca-file") %} {% set _ = entry.append("ca-file") %}
{% set _ = entry.append(item.service.haproxy_backend_ca) %} {% set _ = entry.append(item.service.haproxy_backend_ca is string | ternary(item.service.haproxy_backend_ca, haproxy_system_ca)) %}
{% else %} {% else %}
{% set _ = entry.append("verify none") %} {% set _ = entry.append("verify none") %}
{% endif %} {% endif %}

View File

@ -24,3 +24,6 @@ haproxy_distro_packages:
haproxy_distro_certbot_packages: haproxy_distro_certbot_packages:
- certbot - certbot
# Set system CA store which can be used to verify backends
haproxy_system_ca: /etc/ssl/certs/ca-certificates.crt

View File

@ -16,3 +16,6 @@
haproxy_distro_packages: haproxy_distro_packages:
- haproxy - haproxy
- nc # Used for the Ansible haproxy module - nc # Used for the Ansible haproxy module
# Set system CA store which can be used to verify backends
haproxy_system_ca: /etc/pki/tls/certs/ca-bundle.crt

View File

@ -24,3 +24,6 @@ haproxy_distro_packages:
haproxy_distro_certbot_packages: haproxy_distro_certbot_packages:
- certbot - certbot
# Set system CA store which can be used to verify backends
haproxy_system_ca: /etc/ssl/certs/ca-certificates.crt