@@ -139,25 +139,28 @@ def setup_haproxy(
139139 module_haproxy .execute ('firewall-cmd --add-service RH-Satellite-6-capsule' )
140140 module_haproxy .execute ('firewall-cmd --runtime-to-permanent' )
141141 module_haproxy .register (module_org , None , haproxy_ak .name , module_target_sat )
142- result = module_haproxy .execute ('yum install haproxy policycoreutils-python-utils -y ' )
142+ result = module_haproxy .execute ('yum install -y haproxy policycoreutils-python-utils' )
143143 assert result .status == 0
144- module_haproxy .execute ('rm -f /etc/haproxy/haproxy.cfg' )
144+ config_file = '/etc/haproxy/haproxy.cfg'
145+ module_haproxy .execute (f'mv { config_file } { config_file } .bak' )
145146 module_haproxy .session .sftp_write (
146147 source = DataFile .DATA_DIR .joinpath ('haproxy.cfg' ),
147- destination = '/etc/haproxy/haproxy.cfg' ,
148+ destination = config_file ,
148149 )
149150 module_haproxy .execute (
150151 f'sed -i -e s/CAPSULE_1/{ setup_capsules [0 ].hostname } /g '
151- f' - -e s/CAPSULE_2/{ setup_capsules [1 ].hostname } /g '
152- f' /etc/haproxy/haproxy.cfg '
152+ f'-e s/CAPSULE_2/{ setup_capsules [1 ].hostname } /g '
153+ f'{ config_file } '
153154 )
154- module_haproxy .execute ('systemctl restart haproxy.service' )
155+ module_haproxy .execute ('systemctl enable haproxy.service' )
156+ module_haproxy .execute ('semanage boolean -m --on haproxy_connect_any' )
157+ # HAProxy logging setup
155158 module_haproxy .execute ('mkdir /var/lib/haproxy/dev' )
156159 module_haproxy .session .sftp_write (
157160 source = DataFile .DATA_DIR .joinpath ('99-haproxy.conf' ),
158161 destination = '/etc/rsyslog.d/99-haproxy.conf' ,
159162 )
160- module_haproxy .execute ('setenforce permissive' )
163+ module_haproxy .execute ('setenforce permissive' ) # logging setup requires permissive mode
161164 assert module_haproxy .execute ('systemctl restart haproxy.service rsyslog.service' ).status == 0
162165
163166 haproxy_url = f'https://{ module_haproxy .hostname } :9090'
@@ -179,6 +182,7 @@ def setup_haproxy(
179182@pytest .mark .e2e
180183@pytest .mark .rhel_ver_list ([settings .content_host .default_rhel_version ])
181184def test_loadbalancer_install_package (
185+ setup_haproxy ,
182186 setup_capsules ,
183187 content_for_client ,
184188 module_target_sat ,
0 commit comments