title: How to automate VPS server creation and configuration?
body: <p>I encountered a problem with my current hosting provider. I have around 30 VPS servers, which were all configured manually after purchase. There is no API access for my plan and soon i will have to expand my infrastructure up to several hundred of VPS servers which can't be done manually (ideally a snapshot?).</p>
  
  <p>The default linux distributions (debian) were enhanced with additional packages (dozens of them), like apache, percona-server, git, qt5-default, proftpd, phantomjs (this one manually compiled), to name a few. Also, some manual changes in config files were made.</p>
  
  <p>I actually have a text file with a list of all copy/paste actions, which i perform robotically-like after purchasing new server.</p>
  
  <p>How to start automating this process? I will have a CSV or DB with a list of server IP, SSH logins and passwords. Should i start with remote SSH login and perhaps execute a bash script afterwards? That one could be downloaded from some predefined location on a target machine.</p>
  
  <p>My biggest challenges are auto-editing the config files, filling password queries while installing percona-sql, proftpd and adding usernames. Also, auto-yes when using apt-get install. </p>
  
  <p>Is there a framework for such things? Any help greatly appreciated.</p>
  
  <p>My plan so far:</p>
  
  <ol>
  <li>create a list of servers (with IP, SSH login + password)</li>
  <li>write a bash (or other language?) script to log in to each of the servers</li>
  <li>while on a remote machine, download another bash script there, and execute it</li>
  <li>this latter script installs apache, percona-sql, proftpd, creates users, edits config files, etc.</li>
  <li>log out, proceed to next server</li>
  </ol>
  
  <p>Step number 4 is something i need most help with.</p>