How to add httplog option to haproxy.cfg for horizon with Director
Environment
- Red Hat OpenStack Platform 13
- Red Hat OpenStack Platform 16
Issue
- By default the option
httplog
for horizon inhaproxy.cfg
is not listed.
/var/lib/config-data/puppet-generated/haproxy/etc/haproxy/haproxy.cfg
on a Controller node.
...
listen horizon
bind 10.0.0.111:80 transparent
bind 172.17.1.84:80 transparent
mode http
cookie SERVERID insert indirect nocache
option forwardfor
option httpchk
server controller-1.internalapi.redhat.local 172.17.1.24:80 check cookie controller-1.internalapi.redhat.local fall 5 inter 2000 rise 2
server controller-2.internalapi.redhat.local 172.17.1.39:80 check cookie controller-2.internalapi.redhat.local fall 5 inter 2000 rise 2
server controller-0.internalapi.redhat.local 172.17.1.57:80 check cookie controller-0.internalapi.redhat.local fall 5 inter 2000 rise 2
...
Resolution
- Create a environment file to pass option values to hieradata.
Example file path: /home/stack/templates/haproxy-custom-option.yaml
parameter_defaults:
ControllerExtraConfig:
tripleo::haproxy::horizon::options:
option:
- 'forwardfor'
- 'httpchk'
- 'httplog'
- Please include any other options which have already been configured because all current options are overridden with above customized options.
- And includes the environment file which created above in deploy command like this:
$ openstack overcloud deploy --templates \
...
-e /home/stack/templates/haproxy-custom-option.yaml \
...
- httplog option will be added to horizon settigns in haproxy.cfg after deploy was finished successfuly like this:
/var/lib/config-data/puppet-generated/haproxy/etc/haproxy/haproxy.cfg
on Controller node
listen horizon
bind 10.0.0.111:80 transparent
bind 172.17.1.84:80 transparent
mode http
cookie SERVERID insert indirect nocache
option forwardfor
option httpchk
option httplog <======== here
server controller-1.internalapi.redhat.local 172.17.1.24:80 check cookie controller-1.internalapi.redhat.local fall 5 inter 2000 rise 2
server controller-2.internalapi.redhat.local 172.17.1.39:80 check cookie controller-2.internalapi.redhat.local fall 5 inter 2000 rise 2
server controller-0.internalapi.redhat.local 172.17.1.57:80 check cookie controller-0.internalapi.redhat.local fall 5 inter 2000 rise 2
Root Cause
- At this time no
tripleo-heat-template
parameters to add in this option.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.