7. now visit http://$IP1:5050/MAAS/r/ in the browser. This is the address that the haproxy instance is listening on. Verify that the maas web ui loads and remains on the same url.
8. now visit http://$IP1:5050/ . Verify that you will be redirected to http://$IP1:5240/MAAS/r/ . Note the changed port number - this is the evidence of the bug here. Now you're directly accessing the url of the maas server, not the haproxy.
When the bug is fixed, it can be confirmed by checking that in step 8, you are redirected to http://$IP1:5050/MAAS/r/ (ie. retaining the correct port - remaining on haproxy).
Here is a way to reproduce this issue in a lab:
1. create three focal VMs:
``` ms-libvirt sync release=focal arch=amd64
uvt-simplestrea
uvt-kvm create maas1 release=focal --memory 16000 --disk 30
uvt-kvm create maas2 release=focal --memory 16000 --disk 30
uvt-kvm create maas3 release=focal --memory 16000 --disk 30
```
2. retrieve the ip addresses of them:
```
virsh domifaddr maas1
virsh domifaddr maas2
virsh domifaddr maas3
```
We'll refer to the addresses as $IP1, $IP2, and $IP3 below respectively.
3. create an ansible hosts file with the following contents:
```
[maas1]
$IP1
[maas2]
$IP2
[maas3]
$IP3
[maas_postgres_ primary: children]
maas1
[maas_postgres_ secondary: children]
maas2
maas3
[maas_postgres: children] primary secondary
maas_postgres_
maas_postgres_
[maas_region_ controller: children]
maas1
[maas_rack_ controller: children]
maas1
[maas_proxy: children]
maas1
```
4. create an ansible variables file with the following contents:
``` password: mypassword on_type: snap $IP1:5050/ MAAS
maas_version: "3.2"
maas_postgres_
maas_installati
maas_url: http://
ansible_user: ubuntu
```
5. clone the new maas-ansible- playbook repository: https:/ /github. com/maas/ maas-ansible- playbook . At time of writing, main is at commit db80c9b7ebefd06 9809e6368e280ed 38cd968532 .
6. Run the site.yaml playbook with the above hosts and vars to deploy maas - eg.:
```
ansible-playbook -i hosts --extra-vars "@vars.yaml" ./site.yaml
```
7. now visit http:// $IP1:5050/ MAAS/r/ in the browser. This is the address that the haproxy instance is listening on. Verify that the maas web ui loads and remains on the same url.
8. now visit http:// $IP1:5050/ . Verify that you will be redirected to http:// $IP1:5240/ MAAS/r/ . Note the changed port number - this is the evidence of the bug here. Now you're directly accessing the url of the maas server, not the haproxy.
When the bug is fixed, it can be confirmed by checking that in step 8, you are redirected to http:// $IP1:5050/ MAAS/r/ (ie. retaining the correct port - remaining on haproxy).