Factory Reset HAProxy

Started by BoodahsFever, April 24, 2023, 10:34:02 AM

Previous topic - Next topic
Hello all,

Does anyone know a way to factory reset only HAProxy? There is an old configuration in there and i stopped using it for a while. Now i cannot remove the old config and rules and such. It's giving me errors. Starting over with HAProxy seems like the easiest way to solve it.

Thanks,
Misja

Quote from: BoodahsFever on April 24, 2023, 10:34:02 AM
Hello all,

Does anyone know a way to factory reset only HAProxy? There is an old configuration in there and i stopped using it for a while. Now i cannot remove the old config and rules and such. It's giving me errors. Starting over with HAProxy seems like the easiest way to solve it.

Thanks,
Misja

If you want to remove all rules, frontends and backends
You need to remove them with correct order (as you cannot remove one item when other is still using it):
Frontends->Rules->Conditions->Map Files->Backends->Real Servers

(I don't know any other way to reset the configuration)

Thanks a Bunch.. I already tried that but the config file is is old and the new HAProxy version has trouble with the old config. So that gives a lot of errors.

Download the entire configuration. Open XML file in an editor. Remove the HAproxy bits (possibly keeping the opening and closing line to create an empty section). Restore configuration.
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

Or, Does removing the plugin and re-installing not remove the config, allowing to start again?

Quote from: pmhausen on April 24, 2023, 01:04:04 PM
Download the entire configuration. Open XML file in an editor. Remove the HAproxy bits (possibly keeping the opening and closing line to create an empty section). Restore configuration.

Thanks i will try that.

Quote from: cookiemonster on April 24, 2023, 01:14:37 PM
Or, Does removing the plugin and re-installing not remove the config, allowing to start again?

No removing the plugin does not remove the configuration. I think that's also why the config does not work anymore. I removed the plugin about a year ago. In the mean time OPNSense gets updated but the plugin does not so the configuration does not migrate to a newer version of the plugin. If you then reinstall the plugin months later the config does not match the plugin version anymore. And.. Well factory reset becomes handy :)

Quote from: cookiemonster on April 24, 2023, 01:14:37 PM
Or, Does removing the plugin and re-installing not remove the config, allowing to start again?

Perfect that worked like a charm:

    <HAProxy version="4.0.0">
     remove all bits inbetween this
    </HAProxy>

Thanks!