I need to configure a new VPN configuration on dozens of macOS Siera 10.12.x machines. Obviously automating this is going to be a lot better than trying to get the users to follow the multi-step process manually.
Is it possible to write a bash script that configures the VPN? (In my case, an LT2P over IPSEC VPN).
Yes. You can use the Apple Configurator 2 from the macOS App Store, configure a profile just for the VPN, save this into a file, distribute this to your clients and then use
/usr/bin/profiles
to install it. This profile can also include stuff like certificates etc. and this method is is widely used at universities for things like Eduroam. Depending on the info in the profile (shared secret etc.), this can be made available for download in your org and is also usable for iOS clients.No additional software is necessary (I'm assuming you mean macOS Server). Configure the VPN in Server.app, then click the "Save Profile..." button at the bottom of the primary VPN window. Open that file on any Mac or iOS device and it will automatically configure.