Here is my take on this...
0. I don't think it's a good idea to just start with an :export script and deploy it. Scripts deployed by netinstall are passed a variable (like $action) that allows a safe rollback. So start with the device's defaults, then MERGE any customization INTO their defaults...
1. QuickSet/default configuration already does a lot of the default configuration for you & you can provided a customized one to netinstall for deployment. To see the default configuration, use:
:put [/system/default-configuration/script/get script]
That should be the base, for that particular model of Mikrotik. Each device has a different one, and it can change between versions. So make sure pull the default script from the same version you plan to deploy.
2. Modify that script with your own users, change names, etc. Mikrotik uses part of the MAC address of the first ethernet interface as it's unique id (e.g. AACCFF), so if you want more "per device" customization, you can use the MAC too, or similar to generate specifics.. Since one script error it will cause a fail – KISS a good idea. I try to ONLY ADD things to the default, not re-write it... And avoid doing complex scripting "tricks", since some future version upgrades may breaking novel script things. I add a one thing to the default at top:
# force apply if loaded via CLI
:if ([:typeof $action]!="str") do={
:log info "no action, assuming: apply"
:set action "apply"
} else={
:log info "performing config action: $action"
}
3. Test it on single device without netinstal, the "reset-configuration" does similar as netinstall, so no need to wait for netinstall to test debug (let's say your customized file is mydefconfig.rsc) :
/system/reset-configuration no-defaults=yes run-after-reset=mydefconfig.rsc
Logging can be added to the script, so "trace" the configuration if more complex:
/log info "updating this or that"
4. One "newer" approach than flashfig (which I've never used and sees complex unless your really had hundreds)...
But with containers, you could now run a few "netinstall containers" - one for each port if you want to flash multiple ones units. Just need a spare ARM box with V7. If haven't tried that, but that seems WAY easier – netinstall on linux is pretty fool-proof. (Unlike the firewall fiasco created by trying to use netinstall on Windows)
5. Optional... If you really happy with the configuration, you can REPLACE the default-configuration entirely (e.g. so it NEVER could go to Mikrotik's defaults), using the "Branding Kit" and adding the same script as the "Default Configuration" in the branding NPK maker in your Mikroitk account at mikrotik.com. BUT again, one mistake in this approach, the device will need to be netinstall'ed to remove the branding package – e.g. the pin-hole reset is YOUR configuration, so nothing else to fall back too. Thus Step 5 here
.