Page 1 of 1

Fully automated OpenVPN AS installation, i.e scripted response to Initial Startup Questions

Posted: Tue Mar 30, 2021 5:45 pm
by arickanderson
We are in a Dev/Ops environment, so the creation of all of our servers has to be fully automated, including the initial server instantiation. If I use an OpenVPN Access Server AMI as my starting point, is this possible? (i.e. OpenVPN 3)

To put it another way, is there a way to script the responses to the OpenVPN Access Server initial startup questions, so that when the User-Data section of the Cloud-Init kicks in, the OpenVPN Access Server is already running?

I have read pages of the online documentation, and all of the examples that I have found, assume that a human being is logging in the first time that a server is created. That is a non-starter for us.

Re: Fully automated OpenVPN AS installation, i.e scripted response to Initial Startup Questions

Posted: Tue Apr 13, 2021 6:24 am
by openvpn_inc
Hello arickanderson,

I would recommend not worrying about ovpn-init's answers - it doesn't accept an 'answer file'. But you can still do what you want. I would recommend just running ovpn-init with the --batch option so that it sets up your AS with all default configuration. All those questions can be reconfigured afterwards on the command line interface.

To get your Access Server up and running with the necessary basic information you can run this command:
ovpn-init --batch

This indicates to ovpn-init that you want to do the first-time setup but not answer any questions. All the defaults will be assumed and your Access Server will be up and running. After this you can use sacli to reconfigure any setting. This script is capable of reconfiguring pretty much any setting of the Access Server from the command line.

Kind regards,
Johan

Re: Fully automated OpenVPN AS installation, i.e scripted response to Initial Startup Questions

Posted: Thu Apr 15, 2021 5:21 pm
by arickanderson
Umm, I thought that I had tried that. If so, I must have done something wrong. I will have to give this another go, the next time that I have some cycles. In the meantime, we have proceeded ahead with 2.5.

Thank-you for your response.