Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

haproxy.sh: allows certificate deployment to multiple hosts #5180

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

lgrawet
Copy link

@lgrawet lgrawet commented Jun 18, 2024

Hi,

This PR is to allow certificates deployment to multiple HAProxy hosts without needing to reload HAProxy.

export DEPLOY_HAPROXY_STATS_SOCKET="UNIX:/run/haproxy/admin.sock"

OPTIONAL: Deploy the certificate over the HAProxy stats socket without
needing to reload HAProxy. Default is "no".

Require the socat binary. DEPLOY_HAPROXY_STATS_SOCKET variable uses the socat
address format. The certificate can be deployed to a comma separated ',' list
of hosts ("TCP4:10.0.0.1:1999,TCP4:10.0.0.2:1999")

eval "${_socat_crtlist_show_cmd}"
export IFS=','
for _statssock in ${Le_Deploy_haproxy_stats_socket}; do
# look for the certificate on the stats socket, to choVse between updating or creating one

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# look for the certificate on the stats socket, to choVse between updating or creating one
# look for the certificate on the stats socket, to choose between updating or creating one

_socat_crtlist_show_cmd="echo '${_cmdpfx}show ssl crt-list' | socat '${_statssock}' - | grep -q '^${Le_Deploy_haproxy_pem_path}$'"
_debug _socat_crtlist_show_cmd "${_socat_crtlist_show_cmd}"
eval "${_socat_crtlist_show_cmd}"
export IFS=','

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
export IFS=','
IFS=','

I don't see any reason to export IFS here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants