I am in the process of setting up a new Ubuntu 18.04 Server template for our virtual environment, and as part of this I have a script I created and have used on previous versions.

All it does is ask for the host name, IP settings and NTP server to use. It then sets the host name with `hostnamectl`, adds the name to the hosts file, sets the NTP server with `ntpdate`, writes out the IP info to `/etc/network/interfaces`, downloads all updates, applies them and reboots.

This script won't work in 18.04 as the way you set static IPs has changed by quite a bit. So how do I set a static IP/Netmask/DNS/Gateway programmatically?

EDIT: So this install of 18.04 has Cloudinit installed by default, and that is what has thrown me for a loop here. So I am going to download the other ISO and use that instead. 

But to simplify my question, is there a CLI tool that I can install that does this for me in a simple command. EG `cli-tool <IP> <SUBNET> <GATEWAY> <DNS1> <DNS2>` ?