UPDATE, note is below but I've confirmed this is a problem with ROS not confirming the saving of the custom default script. Previous versions it would prompt and ask to keep or revert, and that response was passed back to the script through $action. While it is setting $action="apply" before running the script, it's never actually confirming it within the OS somewhere, and thus causing the config to remain unconfirmed. I cannot figure out how to "confirm" to keep the default config via any script or scheduler.
Original Post for reference:
I'm having a strange issue with default configs that seems almost like either A) ROS is running the default config script run but thinking that it didn't complete for some reason (it does), and then at next reboot clearing the config and resetting everything again, and continuing to do this in a loop until someone goes in and makes some change to the config on the device (literally any change). or B) like following the default config script finishing, the running config isn't written to disk until a change is made by a user logged in.
I'm seeing this when testing on 7.11.2 and 7.12.2 on a hAP AC and a hAP AC3, have not tested this on other versions yet at the time of writing.
After performing a factory reset and applying a custom setup script that's loaded via branding maker the router applies the configuration as expected and without problem. The issue comes when I reboot the device. When rebooted, the config is usually lost and the default script is reapplied. This happens multiple times in a row, usually until someone (or a script) actually changes something in the config while it's running, and only then does it retain the config.
For testing I just loaded set reset two routers to default and loaded my defaults. Routers booted up fine and configured everything as normal. I rebooted them 5-6 times each and every time could see from the logs after logging in they had been reset and reapplied all the defaults again. It wasn't until I made a change to the config (as a test I changed the clock timezone on one and manually added a route on another) that it would retain the config and not reset every time it was rebooted. It's not just a software reboot, it's every time it reboots including power loss.
This may not seem like much of a problem, but our default setup script is paired with an inhouse provisioning tool, and most of these devices are NEVER logged into even a single time. We load the default configs on in bulk in the production lab and ship the devices out to customers, once in the field they plug them in and the router phones home and pulls its running config from our provisioning system which is working fine. For most of the lives of these devices no one ever logs into the router, our provisioning system pushes firmware and config updates to the devices automatically, so them resetting their config each reboot when no-one logs in is actually a REALLY big problem as it means every time it's powered off or rebooted the router has to go through and build a new config from scratch, which our provisioning system can't tell the difference between a router that "forgot" it's config and one that's been intentionally factory reset and therefore should have new credentials and Wi-Fi settings deployed to.
Has anyone else ran into something like this? or does anyone know if there's something with :global defconfMode, $action or anything similar that needs to be set after the default config script completes in order to tell ROS that the script was successful and to NOT reset itself again next boot?