Quantcast
Channel: HAProxy community - Latest topics
Viewing all articles
Browse latest Browse all 4729

Environment variables in cfg

$
0
0

@Ripper_Dog wrote:

Hey guys,

I would like to ask one question, maybe I am doing something wrong, maybe I found some bug in HAProxy…

One problem is, that we are using version 1.8.12 and not the latest & greatest :slight_smile:

We are calling from SERVER1 thru SSH script thru SUDO on server where HAProxy is installed. But we have problem with ENV variables there.

What script is doing is following:
Take configuration from somewhere, check if configuration is OK (haproxy -c -V -f /path/to/configuration.cfg), then copy configuration to /etc/haproxy/haproxy.cfg and reload haproxy).

And finally to the problem :slight_smile:
When I put to the script echo "Hostname is HOSTNAME" it shows Hostname is myvalid.host.name (so env thru ssh and sudo works), but when script is checking configuration, then it says "[ALERT] 245/164838 (7634) : parsing [/path/to/configuration.cfg:69] : 'bind *:9101' : unable to load SSL certificate file '/etc/haproxy/ssl/.pem' file does not exist." because there is bind *:9101 ssl crt "/etc/haproxy/ssl/{HOSTNAME}.pem. So I find solution, where we can do like ssh user@SERVER1 “export HOSTNAME=$HOSTNAME; sudo /path/to/script.sh”, then check is OK, but reload is not OK… and its not OK even on the server when I do systemctl reload haproxy.service… so should this be hardcoded in systemd service and HAProxy is not taking global envs from system?

Posts: 4

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4729

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>