Make sure you're aware of the limitations of running OSPF on Meraki MX's - especially in routed mode. Using OSPF to Advertise Remote VPN Subnets - Cisco Meraki Documentation As for enabling and configuring it, you can use configuration templates but given you'll likely need to add local overrides anyway for router ID's and area ID's etc, you're probably best investing some time looking into the API. Assuming there are API configuration endpoints available for OSPF on the MX, this would make it much easier to do.
... View more